You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an option on activities to have them run asynchronously (when Kind == ActivityKind.Task). When these activities are executed asynchronously their outputs are not properly reported in the associated ActivityExecutionRecord - only outputs that are actively mapped to a variable appear, unmapped outputs are always reported as null.
Additionally, only mapped outputs are reported in the activity output register, but incorrectly - all mapped outputs are reported to the activity output register with the output name of "output". This implies that you would not ever be able to map the outputs from an activity which was run asynchronously to a subsequent activity.
Steps to Reproduce
Create a test activity similar to this
[Activity("Elsa.Test", Kind = ActivityKind.Task)]
internal class SampleActivity : CodeActivity
{
public SampleActivity()
{
RunAsynchronously = true;
}
public Input<int>? Number1 { get; set; } = default;
public Input<int>? Number2 { get; set; } = default;
public Output<int>? Sum { get; set; } = default;
public Output<int>? Product { get; set; } = default;
protected override void Execute(ActivityExecutionContext context)
{
int number1 = context.Get(Number1);
int number2 = context.Get(Number2);
context.Set(Sum, number1 + number2);
context.Set(Product, number1 * number2);
}
}
Run a workflow that uses this activity
TestWorkflow workflow = new(workflowBuilder =>
{
workflowBuilder.DefinitionId = "sampleWorkflow";
workflowBuilder.Id = "sampleWorkflow";
var variable1 = new Variable<int>();
workflowBuilder.Root = new Sequence
{
Variables =
{
variable1
},
Activities =
{
new SampleActivity()
{
Id = "SampleActivity1",
RunAsynchronously = runAsynchronously,
Number1 = new(4),
Number2 = new(8),
Sum = new(variable1),
Product = null,
}
}
};
}
);
Notice that the associated ActivityExecutionRecord only contains the mapped Sum output value, and that the unmapped Product output is indicated to be null.
Also notice that activity output register only shows the value for the mapped value. And that the name of the output is incorrectly set as "output", not "Sum"
Expected Behavior
My expectation is that all outputs, mapped or not, are properly reported in the ActivityExecutionRecord regardless of whether they are run synchronously or asynchronously.
As well, I would expect that all outputs are properly recorded in the activity output register.
Actual Behavior
Only mapped outputs are reported properly in the ActivityExecutionRecord when the activity is run asynchronously (they are all reported properly currently when run synchronously).
Also, when run asynchornously, only mapped outputs appear in the activity output register, but with an output name of "output". As well, I would expect that all outputs are properly recorded in the activity output register (again, they are all reported properly currently when run synchronously).
Environment
Elsa Package Version: 3.3 RC4
The text was updated successfully, but these errors were encountered:
Description
There is an option on activities to have them run asynchronously (when Kind == ActivityKind.Task). When these activities are executed asynchronously their outputs are not properly reported in the associated ActivityExecutionRecord - only outputs that are actively mapped to a variable appear, unmapped outputs are always reported as null.
Additionally, only mapped outputs are reported in the activity output register, but incorrectly - all mapped outputs are reported to the activity output register with the output name of "output". This implies that you would not ever be able to map the outputs from an activity which was run asynchronously to a subsequent activity.
Steps to Reproduce
Expected Behavior
My expectation is that all outputs, mapped or not, are properly reported in the ActivityExecutionRecord regardless of whether they are run synchronously or asynchronously.
As well, I would expect that all outputs are properly recorded in the activity output register.
Actual Behavior
Only mapped outputs are reported properly in the ActivityExecutionRecord when the activity is run asynchronously (they are all reported properly currently when run synchronously).
Also, when run asynchornously, only mapped outputs appear in the activity output register, but with an output name of "output". As well, I would expect that all outputs are properly recorded in the activity output register (again, they are all reported properly currently when run synchronously).
Environment
The text was updated successfully, but these errors were encountered: