To allow AM to parallelly work on step1 and step1.1, you will have to start it with the parallel gateway
instead of using a parallel gateway after step1.
As a gateway cannot be used straight away after the start event, you will have to add a Dummy task
which will be assigned to any user. The user will have to start the case with the Dummy task and then continue with the parallel working to step1 and step 1.1
You can either assign any of your Dynaforms in the Dummy task or leave it empty if you want.
After closing the parallel gateway you can proceed to step2 and then end the process.
The process flow for the main process can be something like:
We cannot create tasks in a process dynamically
. For the tasks in the subprocess step1.1, you can have the following process flow:
In this, task1 is assigned to AM, second in assigned to TP and the last task will only be created whenever required.
In the evaluation gateway, you can apply a condition to check whether task 3 is required to be created or the process can end.
The subprocess needs to be of the Synchronous type using which you can pass the USER_LOGGED value through Variables IN from the main process to the subprocess so as to assign the first task of the subprocess to the same AM as the one who has initiated the case.
You can refer the Synchronous type subprocess from the given link: http://wiki.processmaker.com/3.0/Sub-Processes
Assignment for task 1 and task 3 can be done through the Value Based Assignment rule.
Assignment rules can be referred from the following link: http://wiki.processmaker.com/3.0/Tasks#Assignment_Rules
For the Summary log
, you can create an Output Document
. Create a trigger which fetches the data from the database tables like,
DEL_INIT_DATE as Date, DEL_THREAD_STATUS as Status from APP_DELEGATION table
APP_NUMBER as Case from APPLICATION table etc.
Fetch the data from tables and store it in a grid in the trigger and place the trigger before the output document
The grid can be directly used in the Output Document as the Summary log.
Hope this helps