question

Mohamed Slama avatar image
0 Likes"
Mohamed Slama asked Sam Stubbs commented

How to use a msg parameter in a wait for event ?

ppmv03.fsmHi,

In my model, I am using an onmessage event in a wait for event trigger.

I want to use the value of the message parameter to decrease this value from a previous value in a label in the process flow instance.

So In my model, when the photoeye will be "OnBlock" or "OnClear" it will send a message to the corresponding processflow instance (plane), and in the 'wait for event' I want to use the value of this message parameter to decrease this value from the "stopped" label in this instance.

Thank you,

Slama

Choose One
process flowlabelswait for eventonmessage triggermessage param
ppmv03.fsm (354.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.

1 Answer

Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered Sam Stubbs commented

You can assign the msg parameter to a label on your token, using the label table in the Wait for Event activity properties. You'll notice that one of the table options for an OnMessage trigger, is the Msg Param from the message. Just assign this value to a label name of your choosing, and then you can use it in your logic.


onmessage.png (16.0 KiB)
· 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.

Mohamed Slama avatar image Mohamed Slama commented ·

@Sam Stubbs Thank you for your answer. But after that how can I use the token's label in the code ? Just by writing current.LabelName ? or something like current.token.LabelName ?

0 Likes 0 ·
Sam Stubbs avatar image Sam Stubbs ♦ Mohamed Slama commented ·

Once the label is on the token, you can reference it in Process Flow activities by calling token.labelName.

1 Like 1 ·