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

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

mohamed_slama
Not applicable
11 Views
3 Replies
Message 1 of 4

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

mohamed_slama
Not applicable

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

0 Likes
Accepted solutions (1)
12 Views
3 Replies
Replies (3)
Message 2 of 4

sam_stubbsYXX86
Community Manager
Community Manager
Accepted solution

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.

6872-onmessage.png

0 Likes
Message 3 of 4

mohamed_slama
Not applicable

@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
Message 4 of 4

sam_stubbsYXX86
Community Manager
Community Manager

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