Can't match the correct value in Wait for Event activity

Can't match the correct value in Wait for Event activity

imasjc_
Participant Participant
111 Views
3 Replies
Message 1 of 4

Can't match the correct value in Wait for Event activity

imasjc_
Participant
Participant

Hi there,

I'm trying to simulate the creation of a picking process with its OrderId and order lines.

I have the following structure where an order takes a Picking Port and doesn't leave it until all order lines are finished:

imasjc__0-1749825892852.png

In the Create Tokens step, the number of line orders are created and sent to another flow. Once this order lines finish their process, all of them are gathered together in a Batch activity, and this is the activity that fires the Wait for Event. See below the example where one order's finished and two still missing.

imasjc__1-1749825996423.png

 

The thing is that i want the Wait for Event activity to release the parent token that is related to the childs, not any of these. The child and parent's share the OrderId label but when I try to do the matching it doesn't work. It only works if I put the OrderId as seen below but the Wait for Event activity releases the incorrect token (which it doesn't make really sense).

imasjc__3-1749826221418.png

 

 

What is wrong here? How can I make the Wait for Event activity to release the correct parent token?

Thanks!

 

 

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

moehlmann_fe
Participant
Participant
Accepted solution

The name of the parameter is chosen somewhat poorly here. The "Batch ID" is not the value the tokens get grouped by in the Batch activity. It is simply a counter variable. The first batch that gets started will have ID 1, the second 2 and so on.

To sync tokens in a situation like this I mostly use a list. The children push themselves to a partition defined by their parent. The parent needs to pull as many tokens from that partition as there are children. (With "All Or Nothing" checked so the children continue at the same time once all are accounted for).

 

Another option would be to have a child token actively release the parent. You don't need a Wait for Event activity for this necessarily. The parent could just enter a Decide activity that returns -1 (doesn't release the token by default). Another token can then release it in a Custom Code activity.

moehlmann_fe_0-1750059171782.png

 

0 Likes
Message 3 of 4

imasjc_
Participant
Participant

Thank you, it works perfect. One last question, how did you change the token's colors in the process flow?

Did you place a trigger on creation somewhere?

0 Likes
Message 4 of 4

moehlmann_fe
Participant
Participant

I set token color to be based on the "OrderID" label in the process flow properties. You can also change their color in a Change Visual activity or using code (token.color = Color....). Those would override the setting in the properties.

moehlmann_fe_0-1750423213787.png