question

Raashid Mohammed avatar image
0 Likes"
Raashid Mohammed asked Patrick Cloutier commented

wait for event match token from push to list

I have two different source creating tokens with label type with random value ( 1 to 10 )

One source is push it to the list

the other source is sending it to wait for event

I want wait for event to look at push to list and match with token label type and have the token at wait for event to move to delay

I know how to do it via pull for list

but was wondering if I can wait for event by watching push list and match token label Value

the reason I want this is that I have a separate tokens pulling from list and I want some tokens to wait and move accordingly

see attached model

model4.fsm

Choose One
wait ofr event
model4.fsm (18.8 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.

Adrian Haws avatar image
0 Likes"
Adrian Haws answered Patrick Cloutier commented

This is probably best to do with a "Pull from List", but leaving the entries on the list. In the "Push to List" you can set the partition ID as the "type" label. Then in the "Pull from List" set the Partition ID to be the label that you set on the pulling token. Also, check the box that says "Leave Entries On List". See attached model for example.


1803-model4-1.fsm (18.3 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.

Patrick Cloutier avatar image Patrick Cloutier commented ·

1- Why check the "Leave entries on list"? It works fine when its unchecked. I don't see the difference.

2- How would I transfer a label value from the pulled token to the puller token? I've succesfully put it on the list by adding a filed with the same name as the label. Now how can I transfer that label value to the puller token?

Thanks,

0 Likes 0 ·
Matt Long avatar image
0 Likes"
Matt Long answered

model4-updated.fsmThe Label Name column of the Label Matching/Assignment table is referring to labels on the Entering token. In your model, this is referencing type which is a number. The match will try to match the value of type (a numer) with the Token that is entering the Push to List activity (treenode).

Since you're trying to match label values between the two tokens, the best way to accomplish this is through a query on a Pull from List. Set the query to be:

WHERE type == puller.type

Then check the box Leave Entries On List so the entry isn't removed from the list and your other tokens are still able to pull.

If you only want to match with tokens that have entered the list AFTER the token in the Wait for Event, then you can add a field to the list that is the push time. You'll also add a time label to the Wait for Event token. Then change the query to:

WHERE type == puller.type AND pushTime > puller.time

See the attached model for an examples.


model4-updated.fsm (22.1 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.

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.