Release resource from created token.

Release resource from created token.

kari_payton
Not applicable
93 Views
5 Replies
Message 1 of 6

Release resource from created token.

kari_payton
Not applicable

[ FlexSim 21.2.4 ]

release resource.fsm

In my main process flow, multiple resources are used in a sub-flow. After the resources are done with that process, I send the resources to a different sub-flow. The issue is when I try to release the resources they are still assigned to the token.

In real world terms, I need the resources(machines) to be recharged before being released, however I want the main process to continue. The attached model is a scaled-down version of the main model. I can't use a split or or any of the synchronize options.

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

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

You have to pass in the label that the resource was acquired on, which is the label on the parent token. You are passing in the child token's label, which is different.

You can change the Release to pass in the parent's label like this:

token.parent.labels["resource"]

Or you can check the Label Access on Parent Only checkbox in the Recharge IM activity and delete the Resource label you're assigning to the child token. This makes the child token act as a proxy of the parent so that when you say token.resource it instead uses the parent's resource label.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 6

kari_payton
Not applicable
Thanks @Matthew Gillespie. How do I then access the specific resource in the array? So after the recharge activity, I need to update a label on the resource. However I am not sure how to change a specific machine then release that same one.
0 Likes
Message 4 of 6

moehlmann_fe
Enthusiast
Enthusiast

Despite the name of the option Label Access on Parent Only suggesting otherwise, such a child token can still have labels of its own. So you can have a label that contains a reference to the specific object and use it in the Release activity to specify which object to release.

capture1.png

capture2.png

Message 5 of 6

jason_lightfootVL7B4
Autodesk
Autodesk
You can also consider replacing all resource references with List/Push/Pull activities which many may find more powerful and less complicated.
Message 6 of 6

kari_payton
Not applicable
0 Likes