What's the meaning of 'compensation is thrown for an activity' and 'compensation is thrown for the current scope'? - bpmn

Even if i have read the compensation-intermediate-throwing-event of bpmn construct for serveral times, i still cannot understand the meaning of 'compensation is thrown for an activity' and 'compensation is thrown for the current scope'.
Does it means a compensation-intermediate-throwing-event can be configured to thrown for a specific acivity or can be configured to thrown to current scope?

Related

How do I query a collection or index using REST/http in an embedded RavenDB v3.5?

Firstly I feel like the need to qualify why having to do this on such an old version of RavenDB:
We are using Particular ServiceControl for NServiceBus/RabbitMQ message handling, namely error messages. Latest version of ServiceControl (v4.22.0) uses an embedded RavenDB v3.5 for storing among other things failed messages.
We need to monitor these failed messages using an external monitoring tool, and therefore I need to periodically scrape and group the failed messages and expose these groupings as metrics for the monitoring software to react upon.
Attempts so far
I have managed to expose the RavenDB database thus allowing myself to access it via REST/http. As such I can loop through e.g. an index using a request like
curl -X GET "http://localhost:33334/indexes/FailedMessageViewIndex?pageSize=5"
This works, but have no filtering options, field selectors or the like.
According to docs (of later versions, I admit), I should be able to query indices like this with RQL syntax:
curl -X POST "http://live-test.ravendb.net/databases/<system>/queries" -d "{ \"Query\": \"from doc in docs.FailedMessages\" }"
but I can only get it to produce the following error:
{"Url":"/databases/%3Csystem%3E/queries?debug=true","Error":"System.Exception: Error reading RavenJArray from JsonReader. Current JsonReader item is not an array: StartObject\r\n at Raven.Json.Linq.RavenJArray.Load(JsonReader reader)\r\n at Raven.Database.Server.Controllers.RavenBaseApiController.d__28.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Raven.Database.Server.Controllers.QueriesController.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.d__1`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.d__6.MoveNext()"}
Now I can deduce that this /queries endpoint expects an array of some sort, but poking around Raven Studio this seems to be a fixed list of strings with which to obtain various information, e.g. payloads ["Raven/StudioConfig"], ["Raven/Alerts"] et.al.
Lastly I can seem to touch something by using the GET request I started out with with a "query" query string parameter, but I get no results - i.e.
curl -X GET http://localhost:33334/indexes/FailedMessageViewIndex?pageSize=3&query=from%20index%20FailedMessageViewIndex
Result:
{
"Results": [],
"Includes": [],
"IsStale": false,
"IndexTimestamp": "2022-10-11T23:01:30.7137228Z",
"TotalResults": 0,
"SkippedResults": 0,
"IndexName": "FailedMessageViewIndex",
"IndexEtag": "01000000-0000-0101-0000-00000000DE8D",
"ResultEtag": "6F5C0902-5EAA-79A4-9D23-B493D5048FB6",
"Highlightings": {},
"NonAuthoritativeInformation": false,
"LastQueryTime": "2022-10-11T23:01:31.6916452Z",
"DurationMilliseconds": 0,
"ScoreExplanations": {},
"TimingsInMilliseconds": {},
"ResultSize": 0
}
The question
I realize that I am at this point merely trying to guess my way through.
But my question is: can I somehow query my embedded RavenDB v3.5 with REST/http using RQL, Lucene or in some other way provide arguments as to what I wish to retrieve?

XMLUnitException - Caught exception during comparison

Caught exception during comparison] Exception[org.xmlunit.XMLUnitException] follows: org.xmlunit.XMLUnitException: Caught exception during comparison at org.xmlunit.diff.DOMDifferenceEngine.compare(DOMDifferenceEngine.java:88) at org.xmlunit.builder.DiffBuilder.build(DiffBuilder.java:386)
Am getting the above error when i make continuous call for
comparison.During high volume it fails with the above error.Nothing wrong with the input.

ASP.NET Core - Exception inside HealtCheck message

I'm wonder what is the purpose of exception parameter that we can pass to
HealthCheckResult.Unhealthy("Message", exception);
When this result is used in health-check endpoint only message and status are used and no info from exception?
An Exception representing the exception that was thrown when checking for status. Optional.
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.diagnostics.healthchecks.healthcheckresult.unhealthy?view=dotnet-plat-ext-3.0
Here's a good explanation on how to use it: https://blog.elmah.io/asp-net-core-2-2-health-checks-explained/

How to get Exception source “Activity Description name”

When exceptions occur in a UIPath project I have an email that is sent out with the exception info included. There seems to be an issue though where I can only see where the error occured by looking at the selector information such as:
Cannot find the UI element corresponding to this selector:
<html app='chrome.exe' title='Microsoft Dynamics GP' />
<webctrl aaname='Add' idx='1'
parentid='a00000000000000008549000000030009000000000001000000000000' tag='DIV' />
This info and the stack trace or any other info is not really helpful for quickly finding the source of the problem. I have looked through the UIPath documentation and forum and found only the this question, which seemed to point to using the exception.Source to show the name of the activity where the error occurred. exception.Source only returns “UiPath.Core.Activities” though instead of "Type into Copy Job# 'INPUT'" in the following example:
This obviously causes a big problem with exception handling. How can I easily return the source with each exception?
When your selector fails, you will end up with a new object of type UiPath.Core.SelectorNotFoundException. However, until the team at UiPath decides to add the Display Name into the inner exception, there is little you can do in this particular case.
Take the following example - the first line shows the Inner Exception, and the second one in red is essentially just the exception being rethrown. Note that only the latter one contains the Display Name property.
The Source itself will usually be of type UiPath.Core.Activities, but since this is just the type's name, we don't have any link to the faulting object. Here's what you can do:
Add some details to your exception. You don't want to do this for each activity, but you could have certain blocks of try-catches (example: logging into the system consists of three individual activites, and they reside in one block).
Rethrow the exception. That way the Display Name will end up in the execution log file.

NServiceBus 6 (6.0.0-beta0004) - The requested service 'NServiceBus.RecoverabilityExecutorFactory' has not been registered

Just running with a vanilla NServiceBus 6.0.0-beta0004
var endpointConfiguration = new EndpointConfiguration("endpoint");
endpointInstance = await Endpoint.Start(endpointConfiguration).ConfigureAwait(false);
This throws an exception:
Bus.ProgramService An unhandled error has occurred.
Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'NServiceBus.RecoverabilityExecutorFactory' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
at NServiceBus.AutofacObjectBuilder.Build(Type typeToBuild) in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\ObjectBuilder\Autofac\AutofacObjectBuilder.cs:line 39
at NServiceBus.CommonObjectBuilder.Build[T]() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\ObjectBuilder\Common\CommonObjectBuilder.cs:line 28
at NServiceBus.StartableEndpoint.CreateReceivers() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\StartableEndpoint.cs:line 93
at NServiceBus.StartableEndpoint.<Start>d__1.MoveNext() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\StartableEndpoint.cs:line 45
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at NServiceBus.Endpoint.<Start>d__1.MoveNext() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\Endpoint.cs:line 28
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
What am I missing? My understanding is that the Recoverability stuff is to do with the First Level Retries + Second Level Retries but I've not set this up yet. Moreover, there seems to be discussion between the guys about this already: https://github.com/Particular/NServiceBus/pull/3828
Any help would be greatly appreciated :)
As Daniel already mentioned in the comments, this code should not be part of the available beta packages. It's highly recommended to stick with the available beta packages on NuGet instead because it's very likely to run into issues when using any persistence/transport package otherwise. The release-6.0.0 branch is still under active development.
(But of course that exception should not occur at all ;) )