FlexScript exception: label ArrivalGroups doesn't exist on token id: 142 !

FlexScript exception: label ArrivalGroups doesn't exist on token id: 142 !

sara_s2
Not applicable
16 Views
4 Replies
Message 1 of 5

FlexScript exception: label ArrivalGroups doesn't exist on token id: 142 !

sara_s2
Not applicable

Hello,

I am modeling a hospital process in the attached model, where the first patients arrival (named group 1 and contains 3 patients) in the process flow 2 have two delays (delay1 and delay2) according to their locations (location 1 and location 2). The next patients arrival (named group 2 and contains 3 patients) have different delays (delay3 and delay4) from the two mentioned ones (delay1 and delay2). In order to model this, I assigned a label to the created tokens of process flow 2 (Fig1), then I fixed the mentioned four delays according to decision "decide" about this label value (Fig2). But, I get the following error (ERROR):

FlexScript exception: label ArrivalGroups doesn't exist on token id: 142 at MODEL:/Tools/ProcessFlow/Person Flow2/Patient of group1? >variables/decision

I really don't understand why the label doesn’t exist while it is well defined. Please help me to fix this.

fig1.png

fig2.png

error.png

Regards.

0 Likes
Accepted solutions (1)
17 Views
4 Replies
Replies (4)
Message 2 of 5

sara_s2
Not applicable

Here is the model :

hospital1.fsm

0 Likes
Message 3 of 5

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

You assign the label to a token in the Arrivals flow and then that token goes to the Create Person activity. When that activity creates a person it copies all the token labels onto the person, so now the ArrivalsGroup label is on the person.

So in the decide activity you should change the code from token.ArrivalsGroup to

current.ArrivalsGroup
since current refers to the person in a person flow.


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 4 of 5

sara_s2
Not applicable

Thank you @Matthew Gillespie for your help.

When I set "current.ArrivalsGroup" I don't get the error message, but all tokens go to group1 and wait the delays of group1, even the tokens that belong to group2.

Would you please help me to fix this.

hospital1.fsm

0 Likes
Message 5 of 5

Matthew_Gillespie
Autodesk
Autodesk

You had a mistake in the code where you set the ArrivalsGroup label:

if(rowNumber=1)

this sets rowNumber equal to 1 and then returns true for the if statement. You meant to say:

if(rowNumber == 1)

which actually compares the value.

I simplified it by just using the rowNumber variable itself.

hospitalfixed.fsm



Matthew Gillespie
FlexSim Software Developer

0 Likes