question

shanice.c avatar image
0 Likes"
shanice.c asked Jeanette F commented

Get value in code: Table.getRowByKey() and Table.getValueByKey()

Hello, I need some help in reading value in code.

1. I'd like to know the time item exit the Queue and Processor, there is one field that I need some help, which is exit time from Processor and Queue. I use Trigger onExit to record the time. But the value follows item. How could I track the item just leave from Queue or Processor, and read it's label value?

1627465556403.png


2. I would use the data in GlobalTable above, and then add fields in ItemLists. I use global table lookup to refer the data, but have problem with [value.row]. I tried to use Table.getRowByKey() and Table.getValueByKey(). but can not read values from table.

1627521360815.png



3. There's an exception: FlexScript exception: MODEL:/Tools/ProcessFlow/ProcessFlow/Custom Code: Update EQ Table>variables/codeNode. What is the problem?

4. I use 3 Itemlists currently in my model, but I'd like to let AGV load item to Processor first if available, then load item to Queue secondly. Is there any way to push item from source to 2 different lists?

Thank you!

AGV write to table.fsm

FlexSim 21.1.4
flexsim 21.1.4getvaluebykeygetrowbykey
1627465556403.png (55.2 KiB)
1627521360815.png (141.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.

1 Answer

Jeanette F avatar image
0 Likes"
Jeanette F answered Jeanette F commented

Hello @Fiona C,

Bullet 1: I suggest that you use the triggers on each of the objects to write to the global table instead of your custom code. I set this up on Processor1 for you.

Bullet 2: You were not using the .getRowByKey correctly. How I demonstrated above in code is how you should use it. I also used it in the list 3, so you can look there for a better example as well. Please note, the columns "pickupCP" and "EQID" still do not work because the EQLocation is written into the list like "/Processor1" and you write it into your table like "Processor1". I could not find where you write it into your table to fix this.

Bullet 3: This exception was from Process Flow in the activity called "custom code: Update EQ Table". To debug your custom code I used a break point and then went line by line through your code. The problem seemed to be coming from line 56 where you try to have "n/a" assigned to a number field. Please look at this and decide what you would like to have filled there instead. You could change the data in that field to be flexscipt.

Other Error: In your ProcessFlow_02 in the activity called custom code: Get Task, there is a character being used in line 10 that should not be there. Please review this code.

Several of your collums in your field could more easily be filled by triggers on the objects than by using your custom code. I suggest you consider changing that.

Bullet 4: This question requires better understanding of what you are trying to do with your process flow. I suggest creating a new post for this question. When you do so please give more deatails about what you are trying to accomplish overall and where in your process flow you might see your problem. I think there might be a simpler way to do this. You can tag me in the new question to help.

We are happy to help answer your questions. Please, consider making separate posts for different questions. Your questions are more likely to be answered quickly that way. Please, refer to our best practices.

agv-write-to-table_JF.fsm


· 6
5 |100000

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