question

Oscar C13 avatar image
0 Likes"
Oscar C13 asked Felix Möhlmann commented

Load non-group items

Hello,
My question is related to https://answers.flexsim.com/questions/110158/load-all-items-from-queue.html

Imagine that you want to take all the elements of the queue, but removing those items that belong a group or a table. That it, in the attached model i want to take all the items except "tubo" and "tubo2". but whithout indicating that they are the ones that I don´t want to take exactly.
I would like to tell the program to take those items that don´t belong to the group "x" or those that don´t appear in the table "x" or that don´t belong to a list. I don´t know which is the best method.
I have explained?

I want to do this because in my model what is going to be in queue will depend on other factors. So I want to be able to make distinction between what I am interested in getting and what I am not.

lavar-1.fsm

FlexSim 21.2.1
processflowqueuegroups
lavar-1.fsm (37.9 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 Felix Möhlmann commented

All three suggestions are possible (List, Group, Table). The group is probably the least suited. since it's normally used as a fixed collection object, there are no pre-defined options to add and remove members and you'd have to use custom code to do that.

Lists would be the best in my opinion, since removing a row with a specific entry requires some custom code as well. (Table.deleteRow() with the command to find a row by key (see further below) as argument)

If you use a list, you'd "try" to pull the specific item from it, by referencing it in the query field of a "Pull from List" activity. Checking "Leave Entries On List" means the item will remain on the list, so it can be found by further attempts as well. Finally, activating the "Use Max Wait Timer" option allows the token to leave the activity through a different connector if it couldn't pull the item successfully.

For groups and tables you'd use a "Decide" activity set to conditional decide with the following commands.

Group:

  1. Group("Groupname").isMember(Object)

Table:

  1. Table("Tablename").getRowByKey(Object, col)  
  2. // "col" is column in which the object reference would be written

All three options are demonstrated in the attached model.

lavar-1.1.fsm


lavar-11.fsm (44.6 KiB)
· 4
5 |100000

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