I have an existing Workflow engine that picks up xml messages from an Azure queue. The XML piece has the information on the WorkflowAction executed, which in turn is passed to and processed in the actual Workflo开发者_开发百科w class.
For example, we have the following steps in my Workflow class A
:
Step 1 --> Step 2 --> Step 3
Step 2
is a prerequisite of Step 3
, while Step 1
is a requirement of Step 2
.
So if A
receives a message called WaitforStep1
action from the engine, it will mark Step 1
complete for that particular instance and proceed it to Step 2
.
Now my issue is: If a message is received that contains the information WaitforStep2
instead of WaitforStep1
, the instance will jump to Step 3
directly without passing through Step 2
.
Is there a way to prevent this from happening?
Disclaimer: I'm a beginner at WF.
You can't skip activities in a workflow without explicitly modeling the workflow to do so. So if messages are received out of order they will be rejected because they are trying to resume an non existent bookmark.
I employ a Sequence variable that indicates which step a task is currently in. I then put in an If
statement at the PickBranch Action that verifies whether I'm currently at the correct step or not.
精彩评论