Live update of Groovy scripts created globally


It's possible via the Studio to create global groovy scripts and use them in the processes.

Each time you create a bar from the process that uses one of these scripts, a jar "groovyscripts.jar" is generated in the bar classpath, and when you deploy the bar, this jar is then stored in the dependency table and mapped to the process through the dependencymapping table.

The question is, how to live update these scripts?

Updating the database directly is a bad practice, are there any other cleaner options?

Thanks in advance,

Groovy source in an external file


is it possible to store the source of Groovy Script ( used in Operations or Connector ) in an external file and the simply including with a reference , so that I can mantain a single file for function called in different task/process ?



Get user assigned to a task

hi all,

how can I get user assigned to a task with script groovy,

I want to get user to send an email to him, that his is assigned to a task,

i use email connector.

How can I do that with script groovy,

Thanks in advance

How do you get a java runtime environment variable

In my process I have a task with a groovy script that needs a condition based on the Java runtime environment variables.

ie. -Denvironment=production vs. -Denvironment=development

How can I access this in my Groovy script?

issue with rest-get connector when status is 204 or 404 or... (empty body)


We have a process where we are calling a web service with a GET method.

When the response is 204, or 404 and the body is empty, it breaks with an exception in the script. It seems to be in any cases when we are importing the bodyAsObject connector output in a script.

we get this stacktrace:

Issues using groovy script connector


I added a script task in my process that uses groovy script. After that, when I try to deploy the process, I get the below error in the Bonita portal and I cannot enable it.

"The Process cannot be enabled
Connector definitions must be resolved before enabling the Process."

Can someone please help.


Why does Bonita 7.0.2 stop generating the groovyscripts.jar?

I have a following problem. I have about 200 processes and some 100 groovy scripts. Because the GroovyScript editor in BonitaStudio sucks, I am editing them in a different tool. From time to time (when changing a library for example) I just find/replace in the groovy scripts and proc files. But from some unknown reason, after these changes, when I build a BAR file of a process, the classpath directory does not contain the groovyscripts.jar anymore and thus the processes fail to run.

How can I browse a JSON with Groovy ? How to use bodyAsObject ?


I have JSON data like :
"StartDate": "2018-08-30T00:00:00",
"EndDate": "2018-09-07T00:00:00"
"StartDate": "2018-06-30T00:00:00",
"EndDate": "2018-10-07T00:00:00"

I used a connector REST GET but I only got the full API so I use bodyAsString.split() to get the StartDate in a variable or the Title in an other variable.
But how can I use bodyAsObject to get the list of all StartDates and the list of all Titles ?

Thank You

Get java.io.File from attached document


How can I convert an attached document to a standard Java File type in a Groovy Script Connector?

Thanks in advance.

Setting BDM in script connector


How would one normally update the value of a BDM Business Variable within a groovy script connector?

I've tried:
myBusinessVariable.value = "";


but neither seem to work.
Unfortunately I need to update 50+ variables like this, so using Operations is going to take a while to do, especially since each variable is going to need some processing done before being set. Ideally I want to be able to do this in a single script connector.