Syncing process for state execution #316
Replies: 1 comment
-
Not yet, but this is a great feature ask. I have a similar issue here to track it: #268 The best workaround is to use a separate workflow to wait for a signal from this workflow. (In fact, we may end up implementing the feature this way internally). For example, your current workflow has state A->B->C-D. And you want to wait for state B to complete. Then you can create a new workflow type In your current workflow at State C(right after state B), signal or start + signal the new workflow using the workflowId. In your application's waiter code that needs to wait, use To signal or start a workflow if not exists in current workflow stateC: try {
iwfClient.startWorkflow(WaitStateExecutionWorkflow.class, <wfId>, waitTimeout);
} catch (final ClientSideException e) {
if (e.getErrorSubStatus() == ErrorSubStatus.WORKFLOW_ALREADY_STARTED_SUB_STATUS) {
// ignore this as it could be started by waiter
}
}
iwfClient.signalWorkflow(WaitStateExecutionWorkflow.class, <wfId>, COMPLETE_CHANNEL, completeData); To get result or start a new one in waiter code: try {
iwfClient.startWorkflow(WaitStateExecutionWorkflow.class, <wfId>, waitTimeout);
} catch (final ClientSideException e) {
if (e.getErrorSubStatus() == ErrorSubStatus.WORKFLOW_ALREADY_STARTED_SUB_STATUS) {
// ignore this as it could be started by signaler
}
}
iwfClient.getSimpleWorkflowResult(<wfId>, DataClass.class); |
Beta Was this translation helpful? Give feedback.
-
Can we do synchronization for when a state is completed?
In my use case, i send a signal to move a workflow to another state, but i want to synchronize this process so that I can return the process after the workflow already moved to another state. Currently it returns immediately and GetWorkflowResults only works for workflow completion
Beta Was this translation helpful? Give feedback.
All reactions