question

Zhengli Y avatar image
0 Likes"
Zhengli Y asked Matthew Gillespie answered

using loops in process flow with labels

HC.fsm

Hi everyone. I'm making some changes based on the people-based model tutorial. I attached two labels to each patient, finishedturns and wholeturns, recording the number of turns of care a patient has received and the amount of turns of health care a patient needs, respectively. After finishing a health care, it should be decided whether a patient needs further care, or the times of health care (finishedturns) has met the number needed (wholeturns) for a patient, thus making a loop. "Exception: FlexScript exception: label finishedturns doesn't exist on token" occured when running the model. I noticed that some similar models refer to people in the process flow as "token.Person", while it doesn't seem to work in my model and I use "current", not sure is this relevant to the problem I meet.

FlexSim 19.0.0
processflowlooping
hc.fsm (286.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.

1 Answer

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

In the Assign Labels you're assigning the label to current (the patient), but in the Decide activity you're looking for the label on the token, so you have a mismatch. Either assign the label to the token or change the Decide to look for the label on current.

Here's your model where I changed it to assign the label to the token:

hc_1.fsm


hc-1.fsm (286.2 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.