question

Kaspar Chabot avatar image
0 Likes"
Kaspar Chabot asked Kaspar Chabot commented

Process Flow: racing events with alternative outcomes

Hi,

Is there some way to have racing events following a process flow (e.g. Custom Code) activity? I want to wait for either one of two events after executing some code, base the rest of the process flow on which of those events triggered first and completely ignore the token that comes out of the second event that triggers (put it to sink).

I know there is a possiblity to add multiple listeners to a single 'Wait for Event' activity but I don't know how to base a decision - following that activity - on which of both events triggered.

I can probably find a solution but most of my ideas so far have been quite unwieldy.

Many thanks in advance.

Kind regards,

Kaspar

FlexSim 16.2.2
process flowwait for event
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Matt Long avatar image
3 Likes"
Matt Long answered Kaspar Chabot commented

If you're listening to events on different objects then you can utilize the Assign Event Object To property in the Wait for Event activity. Listen to both events and assign the event object to a label on the token. Then place a Decide immediately after the Wait for Event and check to see which object the event was fired on.

If you're listening to events on the same object then the Wait for Event won't give you any info about which event triggered the Token to be release. Instead, use a Split or Create Tokens activity to create two tokens and send each one of them to their own Wait for Event.


wait-for-event.png (79.1 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Kaspar Chabot avatar image Kaspar Chabot commented ·

Thank you! In my case they were different objects so I'll go with the option to the right.

0 Likes 0 ·