question

michela-08 avatar image
0 Likes"
michela-08 asked michela-08 commented

Create object using process flow

Hi,

In my model, I want to create parts based on the labels Variant and Station using process flow in the respective Queue as shown in the model's process flow. I want to create parts as per the Variant and Station name as given in the global table. I have tried the "Create Object" option in the process flow and I have written a code for the parts destination ,but this logic is not working.

Can you please tell me how to achieve this and tell me what is wrong in my process flow.

Trial_model.fsm

FlexSim 22.2.3
processflowprocessorcreate object
trial-model.fsm (34.6 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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered michela-08 commented

Why are you assigning new "Variant" and "Station" values to the token instead of using the ones that are written to the item when created by the source?

"Table(...).cell" returns a reference to the node that represents the table cell. To get its value you have to add ".value" to the end. Or just use the [][] syntax ( Table(...)[token.Row]["ItemName] ).

You are not returning a pointer to an object in your custom code, so no item gets created since there is no valid destination given.

Example:

  1. if(token.Variant == "L" && token.Station == "Station 1")
  2. {
  3.     token.Part_Name = Table("Parts_creation").cell(token.Row,"ItemName").value;
  4.     return Model.find("Queue1");
  5. }
· 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.