Set Staff States Using token label?

JacksonG
Not applicable
1 View
6 Replies
Message 1 of 7

Set Staff States Using token label?

JacksonG
Not applicable

[ FlexSim 22.2.2 ]

I am trying to collect utilization on my staff in my model by collecting different times they are performing different specific tasks. I have a label on the token coming in define the action and have the specific action defined in my Staff State Table. I am trying to collect the time by assigning the action in the "Perform Task" using the label on the incoming token.


(e.g. on the token label "pulled.ActionType" would say "FillerCIP")

1674235862516.png1674235942912.png


When I do this, it will not collect the time in the dashboard under the action I specified. It will collect the time as "Idle." Is there a way to do this apart from the example below?

1674236005875.png

My problem is that I am using this subflow for several different actions. So the token label may have different action types specified depending on what token comes in.


Thanks.

0 Likes
Accepted solutions (1)
2 Views
6 Replies
Replies (6)
Message 2 of 7

matthew_gillespie
Not applicable
That should work. Can you verify that the object on token.pulled has an ActionType label with the correct value? If you attach your model I can look into it.
0 Likes
Message 3 of 7

JacksonG
Not applicable

RoundLake_v4.fsm

Yes, the token label should have the label that I'm looking for.

The process flow Main Model feeds to the process flows MaterialFlow and the PersonnelFlow. These both contain the code of interest.

0 Likes
Message 4 of 7

matthew_gillespie
Not applicable
Accepted solution

There seems to be a bug with that State field where it's not recognizing that code has been typed in and it's just treating it as a string literal, i.e. it's setting the state to the "token.pulled.ActionType" state.

I've updated your model using the 2nd workaround listed below. roundlake-v4_1.fsm

Here are two workarounds you could use for now:

1. Use an AssignLabels activity to put the state string on a label on the token. Then in the State field, click the drop down, go to Token Labels, and choose the label you assigned it onto.

OR

2. In the State field, click the drop down, and choose Code Editor. Then paste in code like this:

Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);

return /**/token.pulled.ActionType/**direct*/;
0 Likes
Message 5 of 7

JacksonG
Not applicable

How were you able to set both the custom code and the token label? Mine was only able to set one or the other.

1674497862068.png

i.e. if I write to the custom code it removes the label, and vice versa.

0 Likes
Message 6 of 7

JacksonG
Not applicable
Oh never mind, sorry figured it out.
0 Likes
Message 7 of 7

jeanette_fullmer88DK3
Autodesk
Autodesk

Hi @JacksonG, was Matthew Gillespie's answer helpful? If so, please click the "Accept" button at the bottom of their answer. 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

Type a product name