question

Mischa Spelt avatar image
1 Like"
Mischa Spelt asked Matt Long commented

Cannot assign Process Flow Variable from Create Object

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

FlexSim 16.2.0
process flowcreate objectvariable
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

·
Matt Long avatar image
2 Likes"
Matt Long answered Matt Long commented

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.

· 2
5 |100000

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

Mischa Spelt avatar image Mischa Spelt commented ·

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 0 ·
Matt Long avatar image Matt Long Mischa Spelt commented ·

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

0 Likes 0 ·
pfvariable.png (21.5 KiB)
pfvariable2.png (5.7 KiB)

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.