question

Aaron C avatar image
1 Like"
Aaron C asked Joseph Gillespie commented

Why is my Wait For Event not working as expected?

In the image, just before a token enters the Wait For Event, it creates a token (an independent copy) which enters a loop. When the loop is finished, the Wait For Event Activity should fire IF the token.Unit value is a match. As you can see, the token made it to the delay, but the other token has not been released from the Wait Activity. And while not in the image, I've confirmed that the value of token.Unit reference the same object.
I've tried every conceivable combination of inputs in the Label Matching/Assignment, but it never allows the token to progress (except when there are NO conditions at all, but I absolutely need that condition). Is my syntax for the Label Matching/Assignment incorrect? (I've also tried token.Unit as the label name, and "match value" and those didn't work either)

FlexSim 19.1.1
labelswait for eventreleasewaitlabel matchin
waitforevent.jpg (124.7 KiB)
· 3
5 |100000

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

zacharyh avatar image zacharyh ♦ commented ·

Can you please post your model with each question? As we can better see your problems in the model. Thanks

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel zacharyh ♦ commented ·

@Zac H, the attached model has the same problem.wait-for-event-match-token.fsm

0 Likes 0 ·
Aaron C avatar image Aaron C zacharyh ♦ commented ·

@Zac H I'd have to create a model with no confidential info in it, but the model that @Jörg Vogel posted, as he said, is experiencing the exact issue.

0 Likes 0 ·

1 Answer

·
Joseph Gillespie avatar image
2 Likes"
Joseph Gillespie answered Joseph Gillespie commented

@Aaron C

The problem you are having has to do with how the "Wait for Event" matching operation works.

From the manual's definition of how "match" works, it says "This will match the label's existing value to the parameter that is being referenced. The token will only finish the activity when the event fires AND the event's parameter matches the value of the token's label."

What this means is that "match" matches a parameter to a label you specify.

The parameter in this case is the token that triggered the event (circled in blue), not a label on that token. In order to match with the token itself, you need a reference to that token from your original token.

I did that here by assigning the newly created token to token.Unit so that the parent token has a reference to it:

Here's an updated version of Jorg's model with this fix working: matchtokenanswer.fsm


capture.png (10.0 KiB)
capture2.png (6.3 KiB)
· 3
5 |100000

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

Aaron C avatar image Aaron C commented ·

@Joseph Gillespie Thanks! Works perfect. Once I wrapped my head around it, it was an easy fix.

1 Like 1 ·
Joseph Gillespie avatar image Joseph Gillespie Aaron C commented ·

@Aaron C

Glad to be of help!

0 Likes 0 ·
Aaron C avatar image Aaron C commented ·

@leslie H - good info ^

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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