question

Tommy Heyser avatar image
0 Likes"
Tommy Heyser asked Tommy Heyser commented

Wait for Event and Decide based on firing-event object

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?

FlexSim 18.2.2
wait for eventdecide
· 3
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

please attach the model. Thanks!

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·

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 0 ·
Tommy Heyser avatar image Tommy Heyser Joerg Vogel commented ·

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 0 ·
test3.fsm (35.3 KiB)

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Tommy Heyser commented

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.

· 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.

Tommy Heyser avatar image Tommy Heyser commented ·

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.

1 Like 1 ·

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.