views:

145

answers:

1

Hi

I have a State machine workflow. State Machine workflow requires EventDriven activity ,

This state needs to wait for set of two event, that is Either event (A1 or A2) And event (B1 or B2). In total there are four event handlers

In any combination, but my state should wait for at least two to be raised. I thought of using ParallelActvivity, but I cant use it directly inside state machine.

Any pointers to achieve this?

A: 

The most practical way of doing this would be to add 4 boolean variables, lets call them A1Fired, A2Fired, B1Fires and B2Fires. Now in each EventDrivenActivity set the appropriate variable and use a SetStateActivity to reactivate the same state. Finally add a StateInitialization event and check which of the variables are set and if so do whatever you need to do like switch to a next state.

Maurice