Send to Port: Execute SubFlow

Send to Port: Execute SubFlow

joaquin_macanas
Observer Observer
11 Views
3 Replies
Message 1 of 4

Send to Port: Execute SubFlow

joaquin_macanas
Observer
Observer

[ FlexSim 24.0.5 ]

Hello all,

I want to implement a simple logic to delay de transfer from a Processor to a Queue (or whatever other element). For that I'm using in the processor the option of Send to Port: Execute SubFlow. There I take out the item from the processor to the origin of the model and then move it back after the delay to the corresponding destination. Technically it makes what is expected, but in the log I get the following error everytime the SubFlow is executed:

time: 10.000000 exception: Error in executesubflow: No token arrived at finish activity "Finish SubFlow" in sub flow "Delayed Trasfer".

But it seems that the token did arrdelayedTransfer_test.fsmive, indeed. What can be happening?

Thanks in advance.

0 Likes
Accepted solutions (1)
12 Views
3 Replies
Replies (3)
Message 2 of 4

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

Send To Port is a function expecting immediately a port number as a result to return. Any mechanism delaying this is not allowed. You can hold an item by return -1 in this function and release this item explicitly later by function releaseitem(obj item, num port).

This is suitable approach if you call a subflow. This subflow returns immediately a -1 value for the required return value and an independent created token delays the execution of releaseitem.

Message 3 of 4

joaquin_macanas
Observer
Observer

Hello Joerg,

Thanks for the explanation. I've returned immediately the -1 as you said and later move out with another token the item out of processor. Technically the idea is not to block the item inside the processor, but making a transfer to another element without having to add a TaskExecuter that makes the transportation.

captura-de-pantalla-2024-10-24-110722.png

In this way I can make a transfer of variable duration. I guess to use the releaseitem(obj item, num port) I need an output port, don't i? And in that case, I would be blocking the processor for a new item until it is released.

And thanks again for the help.

delayedTransfer_test.fsm

0 Likes
Message 4 of 4

joerg_vogel_HsH
Mentor
Mentor
Instead of Send to Port you can move an item by command moveobject somewhere else. This can be your model, too. This will set your processor to being available again.
0 Likes