question

michael.smith avatar image
0 Likes"
michael.smith asked Matt Long commented

Process Flow Resources in Case Statements across flows

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;

FlexSim 16.0.1
process flow
5 |100000

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

michael.smith avatar image
0 Likes"
michael.smith answered Matthew Gillespie converted comment to answer

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

  1. treenode current = param(1);
  2. treenode activity = param(2);
  3. treenode token = param(3);
  4. treenode processFlow = ownerobject(activity);
  5. treenode Target = node("Tools/ProcessFlow/Target Process Flow",model());//<Inserted Line
  6. /***popup:ActivityByCase:classType=Resource*/
  7. /***tag:desc*//**Resource By Case*/
  8. int case_val = /** \nCase Function: *//***tag:ValueFunc*//**/gettablenum("Rehabilitation",1,14)/**/;
  9. string Resource = "";
  10. /** \nCases:\n*/
  11. switch (case_val) {
  12. /***tagex:data*/
  13. case /**\nCase: *//**/1/**/: Resource = /** Resource: *//**/"R1"/**/;break;
  14. case /**\nCase: *//**/2/**/: Resource = /** Resource: *//**/"R2"/**/;break;
  15. case /**\nCase: *//**/3/**/: Resource = /** Resource: *//**/"R3"/**/;break;
  16. case /**\nCase: *//**/4/**/: Resource = /** Resource: *//**/"R4"/**/;break;
  17. case /**\nCase: *//**/5/**/: Resource = /** Resource: *//**/"R5"/**/;break;
  18. case /**\nCase: *//**/6/**/: Resource = /** Resource: *//**/"R6"/**/;break;/***//**/ /**/
  19. default: Resource = /**\nDefault:*//***tag:default*//**/"Resource"/**/;break;
  20. }
  21. return getactivity(Target, Resource); //<Modified Line
  22. /** \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

5 |100000

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

Marco Baccalaro avatar image
0 Likes"
Marco Baccalaro answered Matt Long commented

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


· 3
5 |100000

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