question

G C avatar image
0 Likes"
G C asked G C commented

wait for event increase to exact value by token label

I have a waitForEvent activity which I want to have a change rule "Increase to Exact Value" but I want it to only count specific token labels at another activity. Should I write code for the Event? How do I accomplish this?

Choose One
process flowlabelswait for eventtokens
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

·
Matt Long avatar image
2 Likes"
Matt Long answered G C commented

The first thing you'll need to do is make sure the label on the token is a Tracked Variable. This can be accomplished by using the Add Tracked Variable pick option in the Assign Labels activity.

Once the label is a tracked variable, the Wait for Event activity can listen to it change. Run the model until you have a token with a Tracked Variable label on it. Go to your Wait for Event and use the Sampler (either in the Process Flow view or next to the Object field) and mouse over the token.

You'll see a Token: On Label Value Change option. Click on the token and then select this option. The Wait for Event properties will now look like this:

Change the Label Name field to the name of your tracked variable label. Then you just have to update the token.Unassigned! to reference the correct token. The easiest way to do this would be to have a label on the token that enters the Wait for Event that references the correct token. Then you would just put

token.TokenRefLabelName

into the Object field of the Wait for Event. Otherwise you can use the command gettoken().


listentotv.png (23.7 KiB)
· 9
5 |100000

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

G C avatar image G C commented ·

I don't get an option on my waitForEvent to select a labelName. Is there something I'm missing?

Also, what type of tracked variable do I choose? Input?

0 Likes 0 ·
Matt Long avatar image Matt Long G C commented ·

Does your token have a tracked variable label on it?

A tracked variable label will show up with a small green arrow at the upper left corner of the value column. If the token doesn't have a tracked variable label, the On Label Value Change will not be in the event list.

If the value will only increase then Cumulative is okay. If it will increase and decrease use Level.

0 Likes 0 ·
sampletoken.png (43.0 KiB)
G C avatar image G C Matt Long commented ·

Here is tracked variable token:

Here is my waitForEvent after I use an eye dropper on the token above:

I can't seem to choose the label name criteria like you can...

0 Likes 0 ·
capture.png (17.5 KiB)
capture2.png (12.4 KiB)
capture3.png (5.8 KiB)
Show more comments
G C avatar image G C commented ·

Can you supply an example model? I might understand your solution better if I can see it in action.

0 Likes 0 ·
Matt Long avatar image Matt Long G C commented ·

Here's an example model.

listentotokenlabel.fsm

0 Likes 0 ·
G C avatar image G C Matt Long commented ·

So I looked at the model, and here is where I get lost. Your model has this option, which did not appear on mine:

0 Likes 0 ·
capture.png (14.3 KiB)
Show more comments

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.