question

chao.g avatar image
1 Like"
chao.g asked Jordan Johnson commented

List Entry Count by partition ID

Is there a way or command to quickly count the # of entries in a list under a certain partition ID? The list is defined in process flow, track the content of 4 racks, each rack can have 5 different type of items.

FlexSim 17.0.0
process flow lists
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

Matt Long avatar image
3 Likes"
Matt Long answered Jordan Johnson commented

If you're using the internal list of a List Shared Asset in Process Flow, then the biggest issue becomes trying to get the path as to where the actual list resides. Let's assume that your List Shared Asset is pointing at a Global List in the Toolbox. To get the number of entries in a partition looks like this:

getstat(globallist("List1"), "PartitionContent", STAT_CURRENT, paritionID)
· 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.

chao.g avatar image chao.g commented ·

I am not having that point to a global list, can I use this?

getstat(getactivity(processFlow, "List"),"Content", STAT_CURRENT,1) to get # of entries on List with partition ID 1? Tried this, seems give incorrect results, it provides all the entries on the list. When using getstat(getactivity(processFlow, "List"),"Content", STAT_CURRENT), it gives me total entries currently on the list.

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ chao.g commented ·

For a ProcessFlow list in a general flow, or if the list is marked "Global", you should use:

getstat(getactivity(processFlow, "List"), "PartitionContent", STAT_CURRENT, 0, partitionID)

For a ProcessFlow list in an FR or TE flow that is marked Local, you should use

getstat(getactivity(processFlow, "List"), "PartitionContent", STAT_CURRENT, instance, partitionID)

If you are trying to get the content of a particular partition, be sure to use "PartitionContent", and not just plain "Content".

2 Likes 2 ·
Matt Long avatar image Matt Long chao.g commented ·

I think this is a bug. It should actually work with:

getstat(getactivity(processFlow, "List"), "Content", STAT_CURRENT, current, partitionID)

Where current is the instance owner object.

@jordan.johnson can you confirm this?

1 Like 1 ·