Add/Insert new data on selected human task

1
0
-1

I have a process flow that needs to save its findings and user notes to the business model (under human task object/symbol). Particularly, it is more on an insert records approach. If i create a contract between the business variable and task input then set action to Instantiate, instead of inserting a new record, it overwrites the existing data. How can i able to do this? I have 3 human task and expecting to have 3 records in the BDM or database.

Comments

Submitted by Dibyajit.Roy on Tue, 05/16/2023 - 18:17

Hello
Dont use Operation to map between Database column and contract value.
Rather use only 1 Operation. On the left side , select your BDM Object. In the center dont select any Java Method.
On the right side, use a groovy script.
in the groovy script use this -----
Create a new BDM object using the import com.company.model.TableName

datavar = new com.company.model.TableName;

datavar.column1 = contract1
datavar.column2 = contract2

Return datavar

Hence everytime a human task is executed, it would insert a new row in database

Submitted by chris_dev on Wed, 05/17/2023 - 03:16

I see. I should use "Takes value of" since this is the default operation between bdm and inputs. BTW im using bonita community edition.

Submitted by Dibyajit.Roy on Wed, 05/17/2023 - 09:06

The above process should work for Both Licensed and community version.
Let me know if its working for you .

regards

Submitted by chris_dev on Fri, 05/19/2023 - 09:21

Update on this issue. It fails on the current project that i'm working on but when i create a test project, it works perfectly both on process instantiation inputs and task inputs. Maybe i have done wrong or routine. Again thanks for the help

No answers yet.
Notifications