question

Allyson avatar image
0 Likes"
Allyson asked Andrew O commented

Accessing a process flow instance

I am trying to create a token and move it to an activity within a specific instance of a FR process flow. I can't find how to reference a specific process flow instance. I understand that 'current' returns the object instance, but how to I get the process flow instance? I poked around in the model tree during the simulation run but haven't found what I'm looking for. If someone knows the exact tree structure that's used for pointing to a FR process flow instance, that would be most helpful.

FlexSim 23.0.0
instanced process flowobject process flowfr process flow
· 1
5 |100000

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

Andrew O avatar image Andrew O commented ·

Hi @Allyson, was one of Jason Lightfoot's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

There isn't an instance of the process flow in the tree as such - the instance view you see has the same process flow as the viewfocus, with a non-null objectfocus referring to the instance object, allowing the view to know which subset of tokens/ labels you want to see.

You can use the Token.create() static method to create the token in an activity and pass the ownerNode (your instance object) to the method.

Unfortunately the documentation doesn't seem to show the case where you may have more than one process flow instance attached to your 3D object. For safety I'd find the activity first rather than using just the activity name in a single 'Token.create' call:

Object activity=getactivity("Process1","Delay");
Token newToken=Token.create(Model.find("Combiner1"),activity,0,NULL,0);
newToken.release(0);


5 |100000

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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

I don't think that this is supported. Instead I would suggest to create the token in the correct instance to begin with. For example by using an Event-Triggered Source that reacts to a message being send to the instance object.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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