Cannot assign Process Flow Variable from Create Object

mischa_spelt
Not applicable
0 Views
3 Replies
Message 1 of 4

Cannot assign Process Flow Variable from Create Object

mischa_spelt
Not applicable

[ FlexSim 16.2.0 ]

The Create Object activity allows me to select a Process Flow Variable in the Assign To Field, so I assumed that it would work. However, it seems that it doesn't.

I can work around it by assigning the object to a label on the token first, then using an Assign Labels activity to copy it over to the PF Variable, but it would be better if either the Process Flow Variable option just worked, or it wasn't there.

Same seems to hold for the global variables. Please see the attached model assigntopfvariable.fsm

Accepted solutions (1)
1 View
3 Replies
Replies (3)
Message 2 of 4

matt_long
Not applicable
Accepted solution

Your Process Flow Variable has no value, so when it is evaluated by the Create Object activity, the activity gets back a NULL which tells it not to assign the created objects to anything.

You can only use Process Flow Variables to get information. You can't store information on them. If you need to store information globally, you can use labels on the Process Flow object.

There are three main purposes of Process Flow Variables.

1. Allow you to define data globally and easily access it.

2. Allow another user to easily change that value without having to know how the Process Flow works (using the User Accessible option).

3. Allow the Experimenter to modify data on your Process Flow for different scenarios.

If you want to use a Process Flow Variable here, what you need to do is have the variable point to a node somewhere that the created objects will be assigned to. This could be a direct pointer or using label() or node() commands.

Message 3 of 4

mischa_spelt
Not applicable

Thanks @Matt. Just a quick follow-up question regarding your point

3. Allow the Experimenter to modify data on your Process Flow for different scenarios.

Should I also use the trick to

[...] have the variable point to a node somewhere that the created objects will be assigned to.

Because I cannot seem to sample the variable directly from the Experimenter interface (the sampler does not pick it up from the Quick Properties, nor the Process Flow properties GUI, nor directly from the tree (variables/blackbox/...).

0 Likes
Message 4 of 4

matt_long
Not applicable

We should perhaps look into allowing you to use the sampler, but for now it's a drop down option.

2785-pfvariable.png

2786-pfvariable2.png

0 Likes