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
I'm creating a custom Event Activity, the idea is to:
have a starting block be the event activity, on triggering the first event start the workflow
halt on the 2nd block which is also the same event activity
upon receiving the 2nd event resume the workflow
I trigger the event using await manager .TriggerEventAsync(CustomEvent.EventName, messageData);
and in the first event block, the CanExecute method is triggered, however, for the 2nd block that method is never triggered, and my workflow is always stuck in an halted state.
Is there an issue with my implementation?
I can't reproduce it if i use my event followed by a signal.
public override bool CanExecute(WorkflowExecutionContext workflowContext, ActivityContext activityContext)
{
if (workflowContext.Input is not null
&& workflowContext.Input.TryGetValue(RabbitMqEventBus.DEFAULT_INPUT_EVENT_NAME, out var topic)
&& !string.IsNullOrWhiteSpace(topic as string))
{
if (Event.Equals(topic as string, StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
}
return false;
}
public override IEnumerable<Outcome> GetPossibleOutcomes(WorkflowExecutionContext workflowContext, ActivityContext activityContext)
{
return Outcomes(S["Done"]);
}
public override ActivityExecutionResult Resume(WorkflowExecutionContext workflowContext, ActivityContext activityContext)
{
workflowContext.Properties.Add(PropertyName, workflowContext.Input);
return Outcomes("Done");
}
Stepping through the workflowManager TriggerEventAsync method, it seems that this block always returns true, so it continues, and doesn't hit the await ResumeWorkflowAsync line, why is this so?
Ok so I solved it by setting IsAlwaysCorrelated to true, but I'm curious about IsExclusive, for my use case, should I leave it to false? or should I follow the timer and use IsExclusive = true?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm creating a custom Event Activity, the idea is to:
I trigger the event using
await manager .TriggerEventAsync(CustomEvent.EventName, messageData);
and in the first event block, the
CanExecute
method is triggered, however, for the 2nd block that method is never triggered, and my workflow is always stuck in an halted state.Is there an issue with my implementation?
I can't reproduce it if i use my event followed by a signal.
Stepping through the workflowManager
TriggerEventAsync
method, it seems that this block always returnstrue
, so it continues, and doesn't hit theawait ResumeWorkflowAsync
line, why is this so?Ok so I solved it by setting IsAlwaysCorrelated to true, but I'm curious about IsExclusive, for my use case, should I leave it to false? or should I follow the timer and use IsExclusive = true?
Beta Was this translation helpful? Give feedback.
All reactions