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
As per this issue, the event payload is missing. This fix only applies to events which trigger a workflow, not for events which are mid-workflow and use bookmarks to suspend and resume.
Steps to Reproduce
We are using the Elsa Studio to define the workflows.:
In one workflow, publish an event with a payload.
In another workflow, have an event activity which is not a workflow trigger which subscribes to the publish event from the workflow.
Start the second workflow with the event activity which will run and suspend at the event activity.
Run the first workflow with the publish activity which will publish the event and complete.
The second workflow will resume and complete, however the event payload will not be in the event result.
On further investigation, modifying the ExecuteAsync method in Event.cs to add a callback which retrieves the payload from the WorkflowInputMessageInbox resolves this issue:
protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var eventName = context.Get(EventName)!;
if (!context.IsTriggerOfWorkflow())
{
var options = new CreateBookmarkArgs
{
Stimulus = new EventStimulus(eventName),
IncludeActivityInstanceId = false,
Callback = OnResumeAsync
};
context.CreateBookmark(options);
return;
}
var input = context.GetWorkflowInput<object?>(EventInputWorkflowInputKey);
context.SetResult(input);
await context.CompleteActivityAsync();
}
private async ValueTask OnResumeAsync(ActivityExecutionContext context)
{
var input = context.GetWorkflowInput<object?>(EventInputWorkflowInputKey);
context.SetResult(input);
await context.CompleteActivityAsync();
}
I have made the changes above in a fork and am happy to raise a PR if this is acceptable.
The text was updated successfully, but these errors were encountered:
Description
As per this issue, the event payload is missing. This fix only applies to events which trigger a workflow, not for events which are mid-workflow and use bookmarks to suspend and resume.
Steps to Reproduce
We are using the Elsa Studio to define the workflows.:
On further investigation, modifying the ExecuteAsync method in Event.cs to add a callback which retrieves the payload from the WorkflowInputMessageInbox resolves this issue:
I have made the changes above in a fork and am happy to raise a PR if this is acceptable.
The text was updated successfully, but these errors were encountered: