question

dougdurbin avatar image
1 Like"
dougdurbin asked dougdurbin commented

Staff assignment based on token label

I've reviewed some other answers and this seems relatively easy but I can't get it to work. I assign a label to the token based on which OR is acquired. After acquiring the OR and assigning the label (token.OR), I try to acquire an RN based on the assigned OR label. On the shared resource activity properties I'm trying to choose staff based on the condition: token.OR? == "OR1" , if true then: Model.find("ORRN1") and if false Model.find("ORRN2"). The model keeps selecting ORRN2 even though the acquired OR was OR1. It seems fairly straight forward.

FlexSim 20.0.2
labelstokenstaffassign
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
1 Like"
Matthew Gillespie answered dougdurbin commented

The issue is that you're comparing the object on the OR label to a text value:

token.OR? == "OR1"

You need to use the Model.find() command to turn the text "OR1" into an object reference:

token.OR? == Model.find("OR1")

Here's a sample model where I get an RN based off which OR I just acquired. I'm using the By Case pickoption on the Staff resource and for the Case Function I'm using the getlastacquiredresourcecommand():

getlastacquiredresource(getactivity(processFlow, "OR"), token)

staffbylocation.fsm


staffbylocation.fsm (64.6 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.

dougdurbin avatar image dougdurbin commented ·

Ahh knew it was something easy, thank you for the provided example. Thanks as always Matthew!

1 Like 1 ·