Bonita groovy scripts class-loading

I am using Bonita Studio 7.0.2 and have the following problem. I successfully deploy over 400 processes. Some of the processes are using groovy scripts. As I've observed these are compiled and placed into a file called groovyscripts.jar under the process deployment directory. Sometimes we cannot release a new version of the process and want to replace only a single groovy script. I have created a small bash script which replaces the one particular groovy script in every groovyscript.jar file where it is located through the java jar utility. The workflow is like:

  1. stop the server
  2. run the script to replace the groovy script
  3. run the server

However, when I execute again some process action I cannot see the changed behavior (tested also with just adding of a log output). Are these scripts cached somewhere? Or loaded from a different location? As far as I know, the classes should be loaded new after the JVM restarts. Thx.

I guess that you update the jar file located in for example: tomcat/server/temp/bonita_engine_14870@debamo3/platform/classloaders/local/PROCESS/7781335893667017515/23c77/ folder

But actually this file is a temporary file created based on data stored in Bonita Engine database.

If you run the following query:

SELECT * FROM PUBLIC.DEPENDENCY WHERE FILENAME = 'groovyscripts.jar'

you should find the content of the jar file in the "VALUE_" column. So you might want to try to update the data there and make sure you removed temporary data from the file system.

Note that this procedure is a workaround and it is not a designed feature of Bonita so I cannot guaranty that it will actually worked nor that it will be stable over new versions of Bonita.

Perfect. I knew that Bonita must have stored the content somewhere else. Thank you very much. This way it works like a charm. As far as I understood the link between the process and the dependency is the name, i.e. the format "<PROCESS_DEFINITION_ID>_groovyscripts.jar" so no foreign keys, but rather a convention. Can this table be overwritten at some point (other than the (re)deployment of a process) ?

Association between the process definition information (stored in PROCESS_DEFINITION table) and the Groovy script jar file (stored in DEPENDENCY table) is stored in DEPENDENCYMAPPING table. DEPENDENCYMAPPING as a ARTIFACTID column that store the process definition id as defined in PROCESSID column in PROCESS_DEFINITION table and a foreign key on the DEPENDENCY table in DEPENDENCYID column.

You cannot overwrite an existing process definition (with a specific version). You actually undeploy it and deploy it again. Or you can deploy a new version of a process definition. In both case the newly deployed process as a new process definition id and so the previous definition of the dependencies is not modified.