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
Is it possible for the framework to wait until any one of two (or more) events has been received?
I can make the work flow wait for a generic ApproveOrReject event - which carries enough data to be used for either an approval or rejection, but it would be nicer to have dedicated events for each purpose.
builder.StartWith(context =>ExecutionResult.Next()).While(data =>data.IsApproved==false).Do(workflow =>workflow.StartWith(context =>ExecutionResult.Next()).WaitFor(WellKnownEventNames.ApproveOrReject,(data,context)=>context.Workflow.Id, data =>DateTime.Now).Output(data =>data.RequestId, step =>((ApproveOrRejectModel)step.EventData).RequestId).Output(data =>data.IsApproved, step =>((ApproveOrRejectModel)step.EventData).IsApproved).Output(data =>data.ApprovedBy, step =>((ApproveOrRejectModel)step.EventData).ApprovedBy).Output(data =>data.LastRejectedBy, step =>((ApproveOrRejectModel)step.EventData).RejectedBy).Output(data =>data.RejectionReason, step =>((ApproveOrRejectModel)step.EventData).RejectionReason).Then(context =>Console.WriteLine("workflow complete"))// Seems to need a final step after the `.If(...)` step or it wont complete.);
```
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
-
Is it possible for the framework to wait until any one of two (or more) events has been received?
I can make the work flow wait for a generic
ApproveOrReject
event - which carries enough data to be used for either an approval or rejection, but it would be nicer to have dedicated events for each purpose.Beta Was this translation helpful? Give feedback.
All reactions