How to approach Intermediate dynamic task having separate flow

Hi All,

I have integrated flowable workflow engine and I am stuck how to approach this particular scenario. I have a process instance initiated and that request is assigned to head of the department. Now the head creates dynamic actions to that particular request. Actions are nothing but tasks that needs to be completed to move ahead in the workflow. Suppose head creates ‘3’ actions/tasks with a due date set by him. On completion of action/task will have a separate workflow not the one that has been initiated before. Once the action has been completed will move for verification and approval by different individuals and once all the tasks are completed it will return to the main workflow with its further process.

I hope the scenario is clear. How do I approach this use case

  1. Do I have to create a separate workflow for actions ? Then a new process Id will be generated for every single action but these task are a part of single request. On completion how can I return to the main process.

Please guide me through this and any example of this kind would definetly help.

Awaiting for a response.

Thanks

Awaiting for a quick response. Thanks

Please assist. Awaiting for a response. Thanks

The question is how reusable those ‘actions’ are:

  • If they need to be reusable (used in different process definitions), you can use a call activity and use the ‘called element’ of the call activity to set which process definition to call. The flow definition of the process is not part of the parent process (it’s a separate process model). This will indeed create a new process instance, but it is linked to the parent process instance (for example if the parent would be deleted, the called ones will be deleted too)
  • If not, you can use an embedded subprocess. The flow of that subprocess is part of the parent.

In both cases, having a sequence flow out of the call activity/subprocess will make the engine wait for completion of the inner flow.

Thanks for the reply. As of now, it is not reusable. I have created ‘n’ actions using multi instance and setting loopCardinality to the count of dynamic actions/tasks to be created. Now once these actions are submitted, the task for creating these actions are completed and parent process will move ahead and won’t wait for actions subprocess workflow to get completed at this point. Instead there is a stage further in the parent process where it is to wait for the actions subprocess for completion.

The actions task created and assigned can ask for due date extension which will have same subprocess created for approval and once approved will be re-assigned to the same assignee. So the completion and editing of action task will move the same sub process and depending on condition of completion or editing will be handled accordingly inside that sub process.

Can I use parallel gateway like passing all actions tasks to a subprocess and task for actions creation completion and other parent process task both running in parallel and when the stage comes of converging these then I can join them to that particular stage ??

Please guide me as to how I proceed. I don’t even know how will I implement actions to subprocess and parent process in parallel manner.

Awaiting for a quick response…

I’m not sure I’m following your use case 100%, so tell me if i’m interpreting it wrong.

What you can do, is gather all the ‘actions’ in a collection (regular java.util.Collection) and pass that in a multi-instance subprocess. For each element of the collection (note: don’t use the loopCardinality in this case) one instance of the multi instance will be created. If you set the multi instance to parallel, all will be done in parallel, and all instances will wait on the completion on the other before the whole multi-instance is left.

(note: you can tweak the ‘leaving’ condition too if you need that, by setting an expression for the completionCondition of the multi-instance)