question

Gui Vaccaro avatar image
0 Likes"
Gui Vaccaro asked Gui Vaccaro commented

How to automatically load a milestone collector with a processflow?

Hello,

I noticed that even if milestone collectors are added to a flow, if the flow is in a library, the milestone collector (and the links) are lost when the flow is instantiated. Foe example, for an object process flow, if the object is dragged, the flow is dragged, but any milestone connections are empty in the flow. Is there a way to automate this so a pre-configured collector can be brought in automatically?

Thank you.

FlexSim 25.0.2
processs flowuser librarymilestone collector
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Gui Vaccaro commented

You can add an Object node to the user library and place both the Process Flow and the collector as its subnodes. Then you write a dropscript that copies the collector to the model (possibly after checking if it already exists), adds the Process Flow and finally creates links between all milestone activities in the flow and the collector.

An example library is attached.

milestone_lib_test.fsl


· 11
5 |100000

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

Gui Vaccaro avatar image Gui Vaccaro commented ·

Hi, @Felix Möhlmann ,

thank you. I have a few follow-up questions, please:

1. How would you implement this if the object to drag is in a popup menu? I tried it and it does not seem to work;

2. How would the dropscript be written using the object.copy() notation, as createcopy() is deprecated? (this is for my understanding of the difference between the two commands, as they do not seem to produce the same result)

3. What would need to be added to also attach a calculated table to the milestone?

Greatly appreciated!

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Gui Vaccaro commented ·

1. I don't know. I asked this as a follow-up under this post.

2. The available parameters differ slightly between object.copy() and createcopy() (use ctrl-f to find the command). But "object.copy(dest)" and "createcopy(object, dest, 1)" should give the same result.

3. Once the query of the Calculated Table is defined it doesn't need any pointer references to other nodes to function, so you could simply copy it into the model like the stats collector.

// Check if calculated table is present in the model
treenode calcTables = Model.find("Tools").subnodes.assert("CalculatedTables");
Object table = calcTables.find("MyCalcTable");
if(!objectexists(table))
{
    // Copy the table into the model
    table = current.subnodes["MyCalcTable"].copy(calcTables);
}

milestone_lib_test_2.fsl

For the table to be shown in the query builder interface, you would need to add a coupling node to the respective table (yellow, under "tables" variable node) and link to that node in any expressions (pink).

1738139434811.png


1 Like 1 ·
Gui Vaccaro avatar image Gui Vaccaro Felix Möhlmann commented ·
Hi, @Felix Möhlmann , excellent, thank you very much!

I also realized that the reason my extension was not working is because I created the flexscript nodes in the "folder" mode (colorful node), not "property/variable" mode (grayed node icon) of the host object. My bad!

Thank you very much, Sir!


0 Likes 0 ·
Show more comments