I would like create some flow items inside a basicFR on the fly (imagine a cheese cake factory which takes in milk, flour, egg and produces cheese cakes). I used the following code to create this flow item:
treenode template = model().find("Tools/FlowItemBin").subnodes[1].first; treenode newitem = insertcopy(template, basicfr); applicationcommand("trackdefaultsoncreate", newitem);
However, this code always triggers the onEntry trigger and closes the input ports. Since this flow item is produced inside the basicfr, I don't want the onEntry trigger to be fired and I don't want it to affect any input ports.
Firing onEntry trigger is not that bad. if the item is created, the port would be 0 in the onEntry trigger, I can simply check the port number.
The problem is that creation of a flow item will close all input ports. The workaround is reopen the input ports every time a flow item is created. I was wondering if there is a way to create the flow item on the fly without affecting input ports?
Any help would be appreciated!