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
Hi there!
I'm new to WorkflowCore and find it very useful but I ran into a weird scenario.
I might be missing something, if somebody could help that would be appreciated.
public class WaitForOneOfTwoData
{
public string eventKey1 { get; set; } = string.Empty;
public string eventKey2 { get; set; } = string.Empty;
}
public class WaitForOneOfTwoWorkflow : IWorkflow<WaitForOneOfTwoData>
{
public string Id => "WaitForOneOfTwo";
public int Version => 1;
public WaitForOneOfTwoWorkflow(){}
public void Build(IWorkflowBuilder<WaitForOneOfTwoData> builder)
{
builder
.StartWith<WorkflowStartingStep>()
.Then<HelloWorld>()
.Parallel()
// Workflow is waiting for both
// So, I need to publish the missing one
.Do(x => x
.WaitFor("e1", data => data.eventKey1)
.Then<PublishEventStep>()
.Input(step => step.eventName, data => "e2")
.Input(step => step.eventKey, data => data.eventKey2)
)
.Do(x => x
.WaitFor("e2", data => data.eventKey2)
)
.Join()
.Then<GoodbyeWorld>();
}
}
The 2 branches of a Parallel are waiting for their own event. If branch one receives its event, it publishes branch 2 event so that the Parallel step finishes.
What I am getting:
/// - If we run the workflow and publish event e1 in the same host.run session, both subscriptions
/// will be satisfied and the workflow will finish. That's what I was expecting.
/// - If we run the workflow, then restart the host and publish the e1 then the workflow
/// will not finish (subscription for e2 will not be filled).
/// - But then if we just stop and restart the host, then e2 is filled without doing nothing
/// and the workflow finishes.
It's as if restarting the host doesn't recreate the exact same execution state.
Any explanation?
Thanks
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
I'm new to WorkflowCore and find it very useful but I ran into a weird scenario.
I might be missing something, if somebody could help that would be appreciated.
The 2 branches of a Parallel are waiting for their own event. If branch one receives its event, it publishes branch 2 event so that the Parallel step finishes.
What I am getting:
/// - If we run the workflow and publish event e1 in the same host.run session, both subscriptions
/// will be satisfied and the workflow will finish. That's what I was expecting.
/// - If we run the workflow, then restart the host and publish the e1 then the workflow
/// will not finish (subscription for e2 will not be filled).
/// - But then if we just stop and restart the host, then e2 is filled without doing nothing
/// and the workflow finishes.
It's as if restarting the host doesn't recreate the exact same execution state.
Any explanation?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions