How to store Business Data Object into Database (groovy/java)

1
0
-1

For example I have business data object Cup.

I can define it on Groovy script easily.

def new_cup = new Cup();
new_cup.name = "Tiny Cup";
new_cup.description = "Nice tiny cup";
new_cup.ownerId = 5;

But how I can store it into database programmatically now?

Comments

Submitted by Dibyajit.Roy on Tue, 04/12/2022 - 20:42

Hello

You need to create a Business varialble of the Table that you want to work with.

Either , you can write the above script in the Initialize section of the Business variable.
Or
In a Human Task or Service Task ->go to Operation -> Add -> map business Variable on left side and add your script on the right hand side.

You must create a Business variable first and all database transaction must happen through operation section on Task

Regards

Submitted by bpsa on Wed, 04/13/2022 - 08:42

Thank you for response.

Sadly your answer does not show how to add data programmatically.

I'm interested how to add data programmatically. not via Forms, etc.

1 answer

1
+1
-1
This one is the BEST answer!

Hi,

Business data write operations can only occurs using tasks operations or default value expressions.

HTH
Romain

Notifications