cancel
Showing results for 
Search instead for 
Did you mean: 

Java task saving multiple entities in DB followed by user task

prash_aggarwal
Champ in-the-making
Champ in-the-making
Hi,

This is the first time I am using activiti so please pardon my ignorance.
I am using spring boot application with rest services.

I am trying to construct a BPM workflow in which a java task run as daemon and save multiple entities in Database say for eg. Employee objects  - This java task is followed by user task who has to approve that employees are genuine, I am facing few problems:

1. my employee data is saved in employee table, how do i link that employee data to a task, say i have a dashboard for each user, now say java task saved one employee in table and it gets assigned as task to group ops and then one of the user in ops claims it and want to take action on that employee data, he will in his dashboard open that employee data coming as task to him, how to link that employee data in employee table with that task id?
shall i put proc instance id in employee table , i dont have task id since its generated after the employee object so how to link employee with that task so that user when opena that task he can see the employee data and then he gives his comments and close the task.

2. The java task save multiple employee objects so they all get assigned to 1 user task with candidate group "ops" , i want each employee object to be assigned as a separate task so that an individual in a group can take action on individual objects and not as a whole.



Please guide.

3 REPLIES 3

prash_aggarwal
Champ in-the-making
Champ in-the-making
Shall i query over all required employee objects and start a new process instance for every employee object?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Prash,

ad 1)
I would store list of employees (let's say ids) in the process variable. task can access this process variable.

ad 2)
Use Multiinstance task http://activiti.org/userguide/index.html#bpmnMultiInstance

Regards
Martin

Thanks for your inputs martin.