question

Steven Hamoen avatar image
0 Likes"
Steven Hamoen asked Jeff Nordgren edited

Release all batches in a Batch activity

I have a Batch activity containing 2 batches based on a "Group By" label. If in one of those batches a token enters that is the last of everything I want to release all current batches. But currently only the batch in which the last token entered is released. How can I achieve that both batches are released?

FlexSim 16.2.0
process flowbatchingrelease
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

·
Sam Stubbs avatar image
1 Like"
Sam Stubbs answered Jeff Nordgren edited

I'm not entirely sure how you have your model configured so I'm not sure on a specific answer, but you can use the getbatch() command to get a reference to your batches, and the releasebatch() command to release those batches.

So one example could be to set it up such that you have an event triggered source that fires when your first batch releases, which would then go onto a custom code activity that parses through and releases the other batch too.

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

Steven Hamoen avatar image Steven Hamoen commented ·

Thanks Sam, the getbatch function is quite usefull but never mentioned anywhere ( except in the what's new) so I didn't think of that!

0 Likes 0 ·
Majid A avatar image Majid A commented ·

Hi @Sam Stubbs,

I have a Batch activity in the Process Flow. I am trying to test code in the Script window to release all incomplete batches but the above functions don't seem to work.

@Sam Stubbs.

Thanks.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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