question

Maryam H2 avatar image
0 Likes"
Maryam H2 asked Maryam H2 commented

Check entries's count of a list in Decide Activity

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?

FlexSim 24.0.1
listlist entries
5 |100000

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Maryam H2 commented

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

Then

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

returns number of entries.


· 1
5 |100000

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

Maryam H2 avatar image Maryam H2 commented ·
that worked, thanks!
0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jason Lightfoot commented

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

· 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.

Maryam H2 avatar image Maryam H2 commented ·
@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 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Maryam H2 commented ·
You said in your question you just wanted to know if it was empty...
0 Likes 0 ·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Maryam H2 commented

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?

· 1
5 |100000

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

Maryam H2 avatar image Maryam H2 commented ·

@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 0 ·