How do I get the connection name of an (ProcessFlow) activity? I have a decision activity that is connected to two activities. The connections have names (like 5% and 95%) and I'd like to use the connection name when select the output for the token.
How do I get the connection name of an (ProcessFlow) activity? I have a decision activity that is connected to two activities. The connections have names (like 5% and 95%) and I'd like to use the connection name when select the output for the token.
Just reference the name of the connector instead of the rank:
See attached model: connectornamed.fsm
Thanks for the answer Matthew. I still would like to use the connection name as then I could easily create more flexible process blocks for my needs. So is it possible to get the text out from the connection node?
getname(node("1+",rank(connectionsout(<activity>),<connectionrank>)))
so in the decide code:
getname(node("1+",rank(connectionsout(activity),1)))
and:
getname(node("1+",rank(connectionsout(activity),2)))
will return "95%" and "5%" depending on which is port 1 and which is port 2.
I can only think of the function
ipopno( object, port number); // used as: ipopno(getactivity(processFlow, "Custom Code"),1)
Wherein "custom code" is the name of activity the coneection goes to. But you still need the inport number or rank of the activity.
Thanks, now it works!
string connection_name = "";
int my_rank_no = 1;
treenode currobj = first(connectionsout(activity));
while (objectexists(currobj)) {
connection_name = getname(node("1+",rank(connectionsout(activity),my_rank_no)));
my_rank_no++;
currobj = next(currobj);
}
with that construct you could remove my_rank_no completely and just use:
connection_name=getname(node("1+",currobj));
What are you doing with this code? Unless this is a part of a more complicated script I don't see why this is any better than just using the connection rank.
I'm guessing the idea is to just put the percentages on the connectors in the process flow and have the logic figure out which tokens to send where purely based on that - avoiding the need to edit the decision activity. As you say - part of a bigger script.
12 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved