question

Stan Davis avatar image
0 Likes"
Stan Davis asked Ryan Clark commented

Wait For Event Issue with Referenced 3D Object's Token Value Change

I am testing logic where a token will wait until its 3D object's label has been updated by another token. Ultimately, the 3D object's label value will provide move destination information.

The test logic works except for implementing the 'Wait for Event' activity to monitor for a change in the 3D object's token value.

I have created a simple model demonstrating my issue.

In process flow, a 'creation' token creates and pushes a 3D object to a list. The 'creation' token then waits until the 'Main' token arrives, pulls the object from the list and updates its 'Line' label.

I have created the 3D object's 'Line' label as a regular label and as a tracked variable. Both methods result in the same 'Wait for Event' error:

Error: Invalid triggering event, event rank 1, at wait for event activity

Any help will be greatly appreciated.


Wait for Label Value Change Event Issue.fsm

FlexSim 21.1.5
processflowevent triggerflexsim 21.1.5
· 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @stan.davis, was Felix Möhlmann's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

I would suggest you instead wait for the puller token to enter the next activity after it assigned the label value. That seems much easier than listening for a value change. Or would this not be possible in the model you want to integrate this in?

Another way could be to wait for message to the process flow containing the id of the token that created the item. (Create a label on the item to reference the token, then the puller token can send a message with its id value)

In both cases, a delay should be added after the "Pull from List" activity (and removed after the "Push to List") to make sure the first token has arrived in the Wait for Event activity before the puller token sets the label.

wait-for-label-value-change-event-issue_alternative.fsm


· 2
5 |100000

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

Stan Davis avatar image Stan Davis commented ·

Felix,

Thank you for the alternative solutions. I really like the 'Wait for Message' solution as it helps me understand messaging much better. I updated the messaging solution to have the change on the creation token itself instead of the 3D object's token. The whole point of this was to be able to have the Main token reference the Creator token. I am proceeding with your messaging solution.

I would still like to understand why the original example of waiting for a token value to change didn't work. I see scenarios where that would be the most elegant solution. Obviously, I do not have the wiring correct to set a wait for token value change event on a 3D object's token.

Thanks again. Very helpful!!

Stan

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Stan Davis commented ·

It took me some experimenting to get it to work as well:

First up, in your upper flow, you only create a "normal" label on the item, not a tracked variable.

More importantly, in the "Wait for Event" activity the object reference has to be written as

token.FS.labels["Line"]

This references the treenode of the label instead of the value directly. (You could get the value with "token.FS.labels["Line"].value)

1630523174842.png

wait-for-label-value-change-event-issue_fixed.fsm

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.