question

shanice.c avatar image
0 Likes"
shanice.c asked Ryan Clark commented

OnMessage in wait for event

Hello everyone, I have two process flows. I'd like to release token waiting in flowA by sending message from flowB. The token in flowA is kept in a wait for event activity and listen to onMessage.

It seems the token is releases but my model has exceptions below. How could I fix it in wait for event activity?1643545501811.png

testonMessage (1).fsm

FlexSim 21.2.0
onmessage
1643545501811.png (9.5 KiB)
testonmessage-1.fsm (32.9 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @fiona.c, was Jason Lightfoot's answer helpful? If so, please click the "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

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered

The problem is not in the WaitforEvent activity, it's in the ill-defined Assign And Send Message.

1643550579514.png

Your 'toObject' is NULL since it's the second, optional parameter that requires the activity name - not the first. The instance to use in gettoken() would not be "current", and also the token is likely unable to handle the message anyway.

Synchronisation like this is better done using lists - I recommend you try that.


1643550579514.png (16.7 KiB)
5 |100000

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