question

JacksonG avatar image
0 Likes"
JacksonG asked Jeanette F commented

Set Staff States Using token label?

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.

FlexSim 22.2.2
statesstaffpeople
1674235862516.png (41.9 KiB)
1674235942912.png (49.2 KiB)
1674236005875.png (60.4 KiB)
· 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.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·
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 0 ·
JacksonG avatar image JacksonG Matthew Gillespie ♦♦ commented ·

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 0 ·
roundlake-v4.fsm (928.7 KiB)
Jeanette F avatar image Jeanette F ♦♦ commented ·

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

1 Answer

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered JacksonG commented

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*/;

roundlake-v4-1.fsm (914.9 KiB)
· 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.

JacksonG avatar image JacksonG commented ·

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 0 ·
1674497862068.png (4.5 KiB)
JacksonG avatar image JacksonG JacksonG commented ·
Oh never mind, sorry figured it out.
0 Likes 0 ·

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.