question

Kari Payton avatar image
0 Likes"
Kari Payton asked Matt Long commented

Display label values in process flow?

Is there a way to display label values as text in process flow? For example I have assigned labels to the condition of the blade surface, the square meters of thin gelcoat, and meters of cracks based on a random distribution. Then I add and multiply those labels by some constants to get a label "totalManHours". Is there a way to display this label in the process flow pane? Also how can I check what the value of the label is? I tried using the script and the command getlabel(current, "totalManHours") but it returns 0. I also tried finding the value in the Tree, but no luck.

FlexSim 16.1.2
process flowlabelsdisplay
displayvalue.png (35.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

Adrian Haws avatar image
0 Likes"
Adrian Haws answered Matt Long commented

@Kari Payton There are various ways to reference labels, but I'm not completely sure where the labels you want to reference are stored, when you want to get the label, etc.

The most common way to store a label is in a token, so here are a few ways you might find that label. If you click on a token and look at the quick properties you'll see label values there. You can also go into the Process Flow Properties and open "View Tokens". Another way is to go into "More Properties" in the Process Flow Properties and select to display a label value for the token text in the "Visualization" tab.

To display a current label value for a specific token, you can add a text display and enter a code something like this:

getlabel(gettoken(processFlow, "Delay", 1), "labelName")

This code will display the label value for "labelName" of the first token in the "Delay" activity.

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

Kari Payton avatar image Kari Payton commented ·

Hey @Adrian Haws thanks for your response. I was able to click on the token and get the values and your answer about the code to display the label value was what I was looking for. The only issue I'm having is the name of the process flow. I have created a custom fixed resource process flow with the title "Finishing_and_Assembly_Bay_1". When I insert that name where you have "processFlow" i get the error:

unknown variable "Finishing_and_Assembly_Bay_1" Could not finish parsing because of previous errors.

Any ideas why it's not recognizing that fixed resource process flow?

0 Likes 0 ·
Adrian Haws avatar image Adrian Haws Kari Payton commented ·

@Kari Payton "processFlow" is simply a variable that was set in line 3 of that code:

treenode processFlow = ownerobject(textObject);

Even if you change the name of your Process Flow you wouldn't need to change that parameter value.

I did try setting this custom text display in a Fixed Resource Process Flow and couldn't get it to work. For some reason we can't get a reference to the token. However, I would recommend the method I mentioned above of going to "More Properties" in the Process Flow Properties.

0 Likes 0 ·
Matt Long avatar image Matt Long Kari Payton commented ·

The gettoken command's first parameter is the instance owner object. In a general process flow, the Process Flow object itself is the instance object. However, if you are using a fixed resource process flow, then it is the object the process flow is tied to. For instance, if your process flow is tied to Processor3 in the model, then you would say:

gettoken(node("Processor3", model()), "Activity Name", 1)
0 Likes 0 ·