question

Steven Hamoen avatar image
0 Likes"
Steven Hamoen asked Jordan Johnson commented

Bugs?

Hi Guys,

I'm trying to have an event-triggered source listening to an "OnPartitionContentChange" event of a zone. But this gives an error on reset: "exception: Error: Invalid triggering event, event rank 1, at wait for event activity Inbound/Source inbound 2 in process flow "ProcessFlow" Actually it looks like al partition events give the same problem.

The wait for event also gives the same problem (once a token enters), just as the partitions on a list .

Is there a workaround?

The other thing I noticed is the refreshing of the quick properties is not working as intented:

FlexSim 20.2.1
flexsim 20.2.1quick propertiespartition events
· 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

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Jordan Johnson commented

The issue with listening to partition content change (or any partition events, for that matter) is that the partition likely doesn't exist when you try to create the listener; listening to a partition doesn't create the partition. On a List, the problem can be worse if you don't keep empty partitions; the list destroys partitions when they become empty by default.

The only workaround that I know of is to listen to OnEntry/OnExit of the zone, and check the partition with the command zonegetpartitionfortoken(). You could use a Tracked Variable, and set it whenever that number changes, creating a persistent value for that partition. If you need to listen to all the partitions, then you could make a global table of TrackedVariables, one for each partition, and listen to those.

There is a question of whether it should work this way, or whether we should somehow exclude partition events from the WaitForEvent/EventTriggeredSource list. I will add that issue to the dev list, linked to this question.

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