Check entries's count of a list in Decide Activity

Check entries's count of a list in Decide Activity

maryamh11
Collaborator Collaborator
956 Views
7 Replies
Message 1 of 8

Check entries's count of a list in Decide Activity

maryamh11
Collaborator
Collaborator

[ FlexSim 24.0.1 ]

If I'm working with a Global List and need to check if it's empty or count the entries in a Decide Activity, but I don't have a partition ID, what should the checking clause be in the Decide Activity? None of the options below seem to work. Also, could you explain what "processFlow" refers to?

  1. List.entries().length

OR

  1. getstat(getactivity(processFlow, "List"), "PartitionContent", STAT_CURRENT, 0, partitionID) https://answers.flexsim.com/questions/32530/list-entry-count-by-partition-id.html

Also, how I check entries of two Lists at the same time?

0 Likes
Accepted solutions (1)
957 Views
7 Replies
Replies (7)
Message 2 of 8

jason_lightfoot_adsk
Autodesk
Autodesk

Instead of a decide can you not just use a pull activity set to leave entries on the list and with a timeout to send the token to port 2 if it fails to pull?

0 Likes
Message 3 of 8

joerg_vogel_HsH
Mentor
Mentor

I assume you want to check entries of a global list, without knowing actually the partition ID. You find a global list still in your model tree. And you find all entries and their partitions, too.
https://answers.flexsim.com/answers/64417/view.html

0 Likes
Message 4 of 8

maryamh11
Collaborator
Collaborator
@Joerg Vogel yes, it's a globall list and there is no partition ID on my list.

I want to know how I can check the count of entries of a global list in a Decide Activity, the link you've shared doesn't answer to this question.

0 Likes
Message 5 of 8

jason_lightfoot_adsk
Autodesk
Autodesk
You said in your question you just wanted to know if it was empty...
0 Likes
Message 6 of 8

maryamh11
Collaborator
Collaborator

@Jason Lightfoot I understand that strategy, but I need to know on implementing it within a Decide Activity. There's a scenario where the token is directed to connector 2 due to a Max Wait Timer setting. If it fails to retrieve an item from the list, it moves to a Decide activity. Here, it needs to count the entries from a different list in another process flow before making a decision. Is it feasible?

* I rephrased the question.

0 Likes
Message 7 of 8

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

Let we say, you call your list "myList".

Then

List("myList").entries().length

returns number of entries.


0 Likes
Message 8 of 8

maryamh11
Collaborator
Collaborator
that worked, thanks!
0 Likes