I want to be able to destroy a parent token from a sub flow. I know that as long as a child token exists you can't, but what if I destroy the child token along with the parent token? Can that work? How?
I want to be able to destroy a parent token from a sub flow. I know that as long as a child token exists you can't, but what if I destroy the child token along with the parent token? Can that work? How?
The only way to destroy tokens is to send them to a Sink or Finish activity. But you are correct in stating that a token that has children still alive will not be destroy until all its children are destroyed. If the parent is sitting in a Sink or Finish activity when its last child is destroyed, the parent will automatically be destroyed.
If you're in a Run Sub Flow activity, the parent will remain in that activity until all of its children have hit a Finish activity. You could then send the parent to a Sink.
If you're using a Create Tokens, then you could have the parent already sitting in a Sink. Hopefully this helps.
I was afraid of that. I have many places in a general process flow where this logic will be needed and I was hoping to not have to copy and paste everywhere, that's why I was looking for a sub flow solution.
It's a yield loss implementation. The attached sample is the way I think I'll have to implement it. In my real model, I have many tokens being created from distinct sources and they go through a set of sub flows in different order/combinations. So for example, after executing Sub Flow 1, I check the label and decide whether the parent needs to be destroyed. I do the same thing after Sub Flow 2. If I use this solution, I'll have to add a Decide activity after each sub flow run, that's what I was trying to avoid by only having this type of logic in the sub flows (which there's less of than sources).flexsimyieldexample.fsm
I couldn't think of any really slick way of doing this, but you could at least simplify things down by changing your decide from sending it out connectors to sending it directly to the Scrap activities. I've attached an updated model. 6515-flexsimyieldexample.fsm
6 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved