Wait for Event and Decide based on firing-event object

Wait for Event and Decide based on firing-event object

tommy_heyser
Contributor Contributor
632 Views
5 Replies
Message 1 of 6

Wait for Event and Decide based on firing-event object

tommy_heyser
Contributor
Contributor

[ FlexSim 18.2.2 ]

I have two queues (queue2A and queue2B) downstream of another queue. I want to trigger a task executer to load items from the upstream queue and unload them at one of the two downstream queues when their respective level falls below a certain quantity.

I tried to use a Wait for Event activity to listen to the content of the two queues (the queue's OnContentChange Event and Change Rule "Decrease To Or Through Value"). I then assigned the firing-event object to token.queueRequiringItems via Assign Event Object To. After some other activities, I tried to use a Decide activity to choose which queue to unload at, using Conditional Decide expression, token.queueRequiringItems == "queue2A", 1 for true and 2 for false. I connected an Unload associated with queue2A and queue2B to port 1 and 2, respectively.

I am getting an exception in the System Console saying that "label queueRequiringItems doesn't exist on token id: 1".

The task executer then moves onto the next activity on port 1.

Any suggestion?

0 Likes
Accepted solutions (1)
633 Views
5 Replies
Replies (5)
Message 2 of 6

joerg_vogel_HsH
Mentor
Mentor

please attach the model. Thanks!

0 Likes
Message 3 of 6

joerg_vogel_HsH
Mentor
Mentor

Let run the model. Stop the model, when the label was assigned. Mark the token and look for the labels of the token in the quick properties. Does the token contains a label of the name?

0 Likes
Message 4 of 6

tommy_heyser
Contributor
Contributor

test3.fsm attached. Looking at the token when it arrives at the Delay activity immediately after the Wait for Event activity, there's no label containing the queue object.

What am I missing?

0 Likes
Message 5 of 6

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

The attribute "Fire if Initial Value Meets Rule" does not execute Assign Event Object To a label , thus you get the error. If you check in an additional decide activity the content of the queue, you can assign the label instead.

0 Likes
Message 6 of 6

tommy_heyser
Contributor
Contributor

Thanks, I added a Decide activity after the Wait for Event and cleared the Assign Event Object To entry. The Decide logic favors one of the queues more than the other if both queues meet the criteria, since I'm using If-Else-If, but that should be okay for now.