question

Kari Payton avatar image
2 Likes"
Kari Payton asked Matt Long commented

Task Sequence as Processing Time Error in executesubflow: No token arrived at any Finish activity in Sub Flow "SubFlow".

I have a processor that I set the process time as 'ProcessFlow: Execute Sub Flow'. However I am getting an error ... 'exception: Error in executesubflow: No token arrived at any Finish activity in Sub Flow "SubFlow".

subflow-example.fsm

FlexSim 16.1.0
process flowprocessorsubflow3d view
subflow-example.fsm (17.6 KiB)
5 |100000

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

Matt Long avatar image
3 Likes"
Matt Long answered Matt Long commented

The Execute Sub Flow pick option that is available in fields like Setup Time, Process Time, Send To Port and others gives you the ability to kick off a process flow to graphically decide what the return value will be. Taking the Process Time field, it's expecting a number to be returned by the process flow that will be the Processor's Processing Time.

In it's simplest form, the two Processing Times shown below do the exact same thing:

Each processor will process for 5 seconds.

Where the Execute Sub Flow gives you real power is through your ability to put in more complex logic to decide what the return value will be. This of course could also be done by writing code with if statements, for loops, etc. But a more graphical representation may be more beneficial and easier to follow:

The above sub flow has some decision making based upon item type and loops through a set of items to add up a total time to process for. In this case, we have multiple start and finish activities. To ensure we receive the correct processing time return value, we define the name of the start and finish activities in the pick option.

You'll notice all of the activities used in this sub flow contain no delays or waits. This is important when executing a sub flow as a function call like a Process Time. The Process Time field is expecting a return value immediately. Any kind of delay in the sub flow will cause no tokens to enter the finish activity and so, no return value will be evaluated. This is why you get the error 'Error in executesubflow: No token arrived at any Finish activity in Sub Flow "SubFlow".'

Now you aren't limited to just evaluating the Process Time, though that is the purpose of the Execute Sub Flow option. As long as tokens still exist within the Sub Flow, it will remain alive and you can continue performing logic and/or tasks. For example:

The original token exits through the activity Finish, but it creates a token that calls an operator over to the Processor while it's in the middle of processing it's item. The sub flow will remain 'alive' until the last token exits through a finish activity.

See model for more information: executesubflowexample.fsm


· 2
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 ·

@Matt Long Could you attach this file?

0 Likes 0 ·
Matt Long avatar image Matt Long Kari Payton commented ·

I have added the sample model to the answer.

1 Like 1 ·
Adrian Haws avatar image
3 Likes"
Adrian Haws answered Adrian Haws commented

Hi Kari,

The issue is that since the object logic is controlled in the 3D view, the processor won't allow the sub flow to control it. So when you run the sub flow it's throwing an error because it's expecting an immediate return value. What you can do, however, is have only a Start and Finish activity and set the "Return Value" on the Finish activity to be 60 (your delay time). That will then tell the processor to take that amount of time.

If you want your model's logic to be centralized within Process Flow you can have the tokens create objects in a 3D destination and run it that way.

Let us know if you have any more questions.


· 8
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 ·

Hi Adrian,

I see that works, however I wanted to use sub flows within sub flows that have different statistical distributions. Therefore I am not sure what the overall process time will add up to. I tried to have tokens create objects in 3D queue, but I get the same error.

0 Likes 0 ·
Adrian Haws avatar image Adrian Haws Kari Payton commented ·

@Kari Payton I'm not sure exactly how you need this to be set up, but one way you might look at it is that you can define various custom statistical distributions in the "Return Value" for the Finish activity. For example using: uniform(exponential(10,20), duniform(30,35)) or: exponential(10,20) + uniform(1,3). In this situation, the sub flow logic is not meant to do anything but return a value.

When creating an object in a 3D Queue from Process Flow simply reference the Queue as the object's destination. This then facilitates centralizing your model's logic in a highly visual and controllable way with Process Flow.

1 Like 1 ·
3d-objects.gif (140.3 KiB)
Kari Payton avatar image Kari Payton Adrian Haws commented ·

@Adrian Haws Could you give me more information about creating the object in a 3D Queue from Process Flow. I understand how to do that in 3D but I'm not understanding how this will help me run the sub-flows for processor time because it still gives me the same error. Would I have to create a label on the token to keep track of the time as it goes through both sub flows? The overall picture is that I have multiple actions on the one processor. So my idea was that I could make subflows in process flow to break all of those actions down into their different cycle times.

0 Likes 0 ·
Show more comments
Kari Payton avatar image Kari Payton commented ·

@Adrian Haws yes that makes sense. Thank you for the examples. But the main issue is with adding multiple sub flows. I was too general in my first question I think. I thought I could have multiple sub flows within the main sub flow. But maybe this isn't the best way to do this. Foe example for the processor I have two actions that happen at that station. So I don't know the specific return value for the main sub process just a statistical distribution for the smaller sub processes. So 'screw on top' could take uniform(60,90) and 'paint top' could take (30,45). I'm pulling these values from a global table. I tried to create a label for the time then sum labels in the return value but the commands to sum using labels returned errors. screenshot-13.png

0 Likes 0 ·
screenshot-13.png (37.7 KiB)
Adrian Haws avatar image Adrian Haws Kari Payton commented ·

@Kari Payton if I understand what you're trying to do, you can just use labels without any extra subflows (not that using extra subflows wouldn't work). So I just created two labels for each part of the process and assigned them statistical distributions that you mentioned. Then I added them together in the return value like this:

getlabel(token, "paint") + getlabel(token, "screw")

0 Likes 0 ·
label-sum.png (9.9 KiB)
Kari Payton avatar image Kari Payton Adrian Haws commented ·

Do you know a way to use extra subflows like in the picture I posted above?

0 Likes 0 ·
Show more comments
Kari Payton avatar image
1 Like"
Kari Payton answered

After some research, what I think is the best way to do this is to setup a Fixed Resource Process Flow. Thank you @Adrian Haws for the information about sub-flows. I learned a lot. Click link for details and a tutorial on Custom Fixed Resource Process Flow.

5 |100000

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