Bonita7 GroovyScript

Hoy can I change the log4j level in WildFly server?

I'm logging in a Groovy script using:

Logger logger = Logger.getLogger("org.bonitasoft");"Test log");

It works fine in development environment, but in the production server I can´t see the logs in server.log file.

I tried modifying standalone.xml and, but when I restart the server it changes again to 'WARN'.

Is it possible to do this or I should debug using the WARN level?

Thank you very much.

How to compare two business variables?

I'm selecting a record from an external PostgreSQL Database, and saving the information in my BDM, however I want the BDM records not to be duplicate, I currently have two business variables, one that gets the information from my BDM and another Which receives the records from my external database, I need to compare those variables to add in my BDM only record that are not already contained in it.

How could I do that?

I have the link to my .BOS file if you can help me, I thank you.

Failed to get information in bdm and used it in operations.


I am getting the max value of a certain column in bdm table using custom query with parameter. Then I call the query using DAO and used it in the operations once the manager have approved the task. But when i run the task it always fails. I set the petCashNo to store a new series of pet cash no. Just want to create a petcash series number

This is my custom query

SELECT MAX(p.petCashNo)
FROM PettyCashHeader p
WHERE p.branch = :branch

Return of custom query is single

This is how i call my query in operations

Script task


I'm building a process in BPM and I've sucessfully done it without script (automatic) tasks. Now, I added a script task that should run the script automatically but is not doing it. The script works, because I tested it on "evaluate" option in the script. I added the script on the "Operations" tab under "Execution" option of the Task.

How to use loggedUserId in Bonita 7.2.3?

My problem is simple. I need to get the userId of the currenty user "performing" the script activity. In the documentation says that loggedUserId is among the provided variables, but it's not in the provided variables in the groovy script editor. I'm using the Community Edition.
How can i get the id?

depends on "oPersona" is neither defined in the script nor in dependencies.

def solicitudVar = new com.eninetworks.ordenamiento.Solicitud()
solicitudVar.oSolicitante = {
def oSolicitanteVar = solicitudVar.oSolicitante == null ? new com.eninetworks.ordenamiento.oSolicitante() : solicitudVar.oSolicitante
oSolicitanteVar.oPersona = {
def oPersonaVar = oSolicitanteVar.oPersona == null ? new com.eninetworks.ordenamiento.oPersona() : oSolicitanteVar.oPersona
oPersonaVar.strNombreSolicitante = solicitudInput.oSolicitante.oPersona.strNombreSolicitante

Example of a Grrovy Script


Is there any example of how to use saved Groovy Script in the community ?
I've searched in my BPAD and Advanced trainings docs, and on but I don't really understand how to use it.

Can someone show me how to declare a static function in groovy ? Because every function I tried to make is returning NULL.

Thank you :)