question

Joaquín MSV avatar image
0 Likes"
Joaquín MSV asked Joaquín MSV commented

Send to Port: Execute SubFlow

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.

FlexSim 24.0.5
processorsubflowoutput port
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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joaquín MSV commented

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.

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

Joaquín MSV avatar image Joaquín MSV commented ·

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 0 ·
Joerg Vogel avatar image Joerg Vogel Joaquín MSV commented ·
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 0 ·