Process Flow Resources in Case Statements across flows

Process Flow Resources in Case Statements across flows

michael_smith4
Not applicable
13 Views
5 Replies
Message 1 of 6

Process Flow Resources in Case Statements across flows

michael_smith4
Not applicable

[ FlexSim 16.0.1 ]

I'm using a central set of resources on the main flow page for all my processes (they are shared)

What is the correct syntax for entering the reference in the case statement

by default on the same page as the resource it would be

case /**\nCase: *//**/1/**/: Resource = /** Resource: *//**/"Resource1"/**/;break; case /**\nCase: *//**/2/**/: Resource = /** Resource: *//**/"Resource2"/**/;break;

0 Likes
Accepted solutions (1)
14 Views
5 Replies
Replies (5)
Message 2 of 6

marco_baccalaro
Not applicable

The syntax is correct. I tried it in the attached model.

0 Likes
Message 3 of 6

michael_smith4
Not applicable

Thanks Marco, that is the right Syntax for the same PF page but I'm trying to reference across pages/flows.

0 Likes
Message 4 of 6

michael_smith4
Not applicable
Accepted solution

As an update I spotted that the getactivity command determines the target page

treenode current = param(1);
treenode activity = param(2);
treenode token = param(3);
treenode processFlow = ownerobject(activity);
treenode Target = node("Tools/ProcessFlow/Target Process Flow",model());//<Inserted Line
/***popup:ActivityByCase:classType=Resource*/
/***tag:desc*//**Resource By Case*/
int case_val = /** \nCase Function: *//***tag:ValueFunc*//**/gettablenum("Rehabilitation",1,14)/**/;
string Resource = "";
/** \nCases:\n*/
switch (case_val) {
/***tagex:data*/
case /**\nCase: *//**/1/**/: Resource = /** Resource: *//**/"R1"/**/;break;
case /**\nCase: *//**/2/**/: Resource = /** Resource: *//**/"R2"/**/;break;
case /**\nCase: *//**/3/**/: Resource = /** Resource: *//**/"R3"/**/;break;
case /**\nCase: *//**/4/**/: Resource = /** Resource: *//**/"R4"/**/;break;
case /**\nCase: *//**/5/**/: Resource = /** Resource: *//**/"R5"/**/;break;
case /**\nCase: *//**/6/**/: Resource = /** Resource: *//**/"R6"/**/;break;/***//**/ /**/
default: Resource = /**\nDefault:*//***tag:default*//**/"Resource"/**/;break;
}
return getactivity(Target, Resource); //<Modified Line
/** \nNote: Case values must be positive integers.*/

Re pointing the look up destination by adding another line means I can reference the other PF's. As this is something that will probably be done a lot perhaps adding a target PF option to the trigger would help. If there is a neater solution please let me know

0 Likes
Message 5 of 6

marco_baccalaro
Not applicable

Ok, now I know what you mean. I tried too but no way, seems Process Flow doesn't want you to use resources on other Process Flows. I think it's because of the link that cannot be maintained between the token and the resource if they are in different Process Flows.

0 Likes
Message 6 of 6

matt_long
Not applicable

It's actually perfectly legal to acquire resources, push/pull from lists and enter/exit zones that are contained in a General Process Flow object from any other General, Fixed Resource, Task Executer or Sub Flow. There just isn't a good Case pick option for doing so at this time. That's something we'll have to look at adding.