Collect/Group tokens within a time frame



I think it is an often used pattern, but I was not able to find a solution how to implement it in BPMN: I would like to collect or group all token arriving at an activity within an amount of time.

For example: A shop is collecting all orders until midnight and then all orders sent in one package.

How is this modeled?


would those orders each be different instances?
Or the same instance with multiple tokens?


Each order is processed in an own instance, just at the packaging step everything is collected / grouped together.


You could just let all of instances finish then run a process to pick them up


@Niall Thanks for your Reply. I just don’t understand how the “Collect completed instances for the day” should look like.
If for example 3 tokens pass the midnight clock at midnight the process “Collect completed instances for the day” should run once with the information (e.g businessKey) of the three token.
In fact it would be enough to get only one of the three business keys or an other variable the the tokens are grouped by.


The idea is to completely decouple the orders process from the packing sending process.
in the case above this would mean that the package process would do a search for all order processes that have finished and not been packaged and then for each of those create one package.