question

Julio R avatar image
0 Likes"
Julio R asked Julio R commented

Referencing an object from central port conection on Process Flow

I want to reference an operator linked to a decision port with a central connection instead of the regular direct object reference (the one the eye drop gives) inside process flow.

I tried token.current.centerObjects[2] but is not a valid reference. I send the model with the regular reference. Thank you.

prueba2.fsm

FlexSim 17.1.2
process flowconnections
pregunta.png (511.8 KiB)
prueba2.fsm (27.8 KiB)
5 |100000

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

1 Answer

Mischa Spelt avatar image
1 Like"
Mischa Spelt answered Julio R commented

Hi Julio,

Hopefully I understood your question correctly: you have an event-triggered source that listens to an event on the Decision Point, and you would like to access the Decision Point's center objects later in the flow.

Since you have a General Process Flow with a hardcoded reference, you can of course always use

model.find("/DP2").as(Object).centerObjects[1]

Another option is to have the event triggered source assign a label with the Decision Point. The source has an option "Assign Event Object To" which will assign the object that triggered the event (in this case DP2) to a token label.

If you do that, you can use the label to access the center objects

token.event.as(Object).centerObjects[1]

If you need the same logic for multiple decision points, you can consider turning the whole thing into a Fixed Resource Process Flow, in that case you can change the event source to wait for OnArrival of current, and access the center objects simply through

current.centerObjects[1]

Note that in the first two examples, model.find("/DP2") or token.event, you get a reference to a treenode. If you want to access the centerObjects, you need to tell FlexSim that you are actually dealing with the specific type of treenode called Object, by inserting .as(Object) into the expression. In the Fixed Resource Process Flow code headers, current is already declared as Object so you can just write current.centerObjects directly.


· 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.

Julio R avatar image Julio R commented ·

Thanks you,

I think Fixed Resource is the way to go in this case.

0 Likes 0 ·