question

Kari Payton avatar image
0 Likes"
Kari Payton asked Kari Payton commented

Release resource from created token.

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.

FlexSim 21.2.4
release resource
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 Kari Payton commented

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.

· 4
5 |100000

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

Kari Payton avatar image Kari Payton commented ·
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 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Kari Payton commented ·
You can also consider replacing all resource references with List/Push/Pull activities which many may find more powerful and less complicated.
2 Likes 2 ·
Kari Payton avatar image Kari Payton Jason Lightfoot ♦♦ commented ·
@Jason Lightfoot I agree!
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Kari Payton commented ·

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

1 Like 1 ·
capture1.png (10.9 KiB)
capture2.png (12.4 KiB)