Can we read and write or use process variable inside studio ?

1
0
-1

I'm implementing Leave App Process.
I have 3 human tasks Leave Application, Manager Approval/Reject and Leave Notification task.
In Leave Application user will fill leave application details like Type of Leave, No of Days & Reason.
In Manager Approval/Reject manager will see the same info and can Approve or Reject the leave
But now I want to use Exclusive gateway.
By which By default flow will go to - Manager Approval/Reject Task and a conditional flow will go to Leave Notification task
Condition is - if(typeOfLeave = "Sick Leave" || numberOfDays <=2)
then go on path to Leave Notification task.

Currently I'm storing leave application details in one process variable(sending as JSON).
Im able to access individual values from that process variable on UI form but I need some solution so that I can give condition to the conditional path for Exclusive Gateway using the process variable's (JSON) one of the value.

1 answer

1
0
-1

I really advise against storing the JSON as a text process variable. I rather recommend to use a business variable that is a structured data type with a nice integration with Bonita forms and contracts.

You can refer to vacation management example to find how to create a full vacation management application using BDM feature of Bonita.

Still if you want to continue with your current approach, you should be able to access your process variable in a Groovy script configured for the condition definition. The script can parse the JSON, access the data you want to use and do the test. Maybe you can you share (using Google Drive, Dropbox...) your project has a .bos file?

Notifications