MultiInstance usertask should not wait for other task for completion

OrderMgmt

I have a order management process which can process list of orders. Lets say, i have two different orders “Order-1”,“Order-2” placed by same user & same time.

Service tasks “prepare order” and “prepare invoice” execution completed.
Now, Deliver Order is a multi-instance userTask , and delivery executives will be different for both orders.

So what i wanted is,

  1. Two DeliverOrder userTask needs to be created and assigned to different executives.
  2. if one of the order was delivered it must move to “Order completed” state
  3. one order should not wait for other order in multi instance for order completion end state
  4. both order must be delivered.

So how to model the “DeliverOrder” userTask?

@StephenOTT @Philipp_Ossler @Ingo_Richtsmeier @Niall @thorben @Webcyberrob any suggestions would be helpful. I was trying to solve this issue long time. No luck. :frowning:

Can you explain your number 2. Why does the order move to order completed if only 1 order was delivered?

What is your current issue? You describe your scenario but you have not provided any errors or problem.

I tried using multi-instance task for list of orders. For example, the list contains 5 orders, in multi-instance activity, it will be considered as completed when all the 5 orders completed or based on completion condition. Until 5th order completes, other 4 order will wait and once 5th order completes then only all the 5 order moves to the end state of the defined workflow.

What i was trying is, in multi-instance none of the order should wait for other orders need to be completed. some orders can be processed in future. If one of the order processed it should move to end of the workflow, and keep active of other 4 orders to proceed when it ready.

I know this is not possible with Multi-instance task markers. I have attached below image and marked some numbers on DeliverOrder activity and OrderCompleted end event. This is what i try to achieve.

OrderMgmt

So then you should consider restructure the layering of your BPMN. Sounds like you have two processes going on: the first is the order handler. This is the overall order. And for each item in the order you have their own processes for processing that individual item in the order.

Here’s more detailed picture
OrderMgmt

I want to create user tasks for each order(iterate the order from list) with different delivery executives.

Other steps(Prepare order & Prepare invoice) are processed as single unit of task. But in “Deliver order” step i wanted to iterate over the list of orders and assign different executives.

In my case, it should create 5 “DeliverOrder” tasks created and assigned to 5 different executives.

For example, Amazon has warehouse only in New York, and it delivers orders to the customers globally. Orders are processed as batch, and the delivery address of each order may be different geographical location and different delivery executives will be sent. Lets say, 5 orders as a batch, in that 1 customer lives in New York itself and the order could be delivered in same day. Other 4 customers are in Germany, Japan, UK and Australia. So the delivery would happen on different days by different executives. But when delivery happened to any one of the customer, that order must be moved to “ordercompleted” end stage of workflow as mentioned in diagram, and other orders still stay in “DeliverOrder” step. But multi instance task makes to wait all the other deliveries need to be completed, inorder to move to end state of workflow.

Hi,

I would make a few quick suggestions;

  • It looks like the granularity of your process is a process instance may work on a batch of orders.
  • Thus, the process is only complete when the batch is complete.
  • If you want to see an order complete, consider a multi-instance inline subprocess rather than a multi-instance task, that way you will see how many are complete.
  • Are you mixing process versus business object state? For example, the process state is only complete once all orders in the batch are complete. You could consider a task in the process to update order status to complete. Thus you could query the order business object to see if its complete rather than infer it from process state (I assume here there is a repository of orders)…

regards

Rob

1 Like