Hi,
How should one give the resource to free to the release resource activity so that the resource is released? For the aquire resource the resource can be given with
return getactivity(processFlow, resourceName);
but that does not seem to work with release resource. I would like to not use the picklist option Label: resource. What is FlexSim doing behind the scenes here? I am curios as the manual only states that
"The return value of this field should be a label on a token where an Acquire Resource activity assigned the acquired resource to."
but if I e.g. copy the resource label using a "create tokens" activity and use independent tokens in the sub-process then I cannot release the resource from the sub flow. It seems that the only way to do this is to create tokens as child nodes and allow access to the parent labels where the resource was reserved. Is the resource reservation somehow connected to the parent label or can the resource be freed from anywhere if we have a reference to the resource?
The case: I reserve a resource in the main process flow. When a certain time has elapsed the main token can continue execution, but the resource should not be released until is has been cleaned. Thus the main process flow creates a token to a sub flow where the cleaning is done and when ready the resource should be released. My problem is that the resource is not always on the "resource" label as I have multiple resources that I store in labels with different names, but I would like to use the same cleaning sub flow for any resource that is to be cleaned and then released.
A possible solution is to release the resource in the main process flow after the sub flow has been called. In the sub flow I acquire the resource again and then free it at the end of the sub flow. This requires extra acquiring and releasing and I need to make sure with queries in the resources and a label on the token that no one else gets to acquire the resource before the cleaning is done.
Any pointers on this?
Thank you!
Kind regards,
Axel