Groovy

Groovy scripts disappear in Bonita Studio 2022.1 or later versions.

Hello,

I have a serious issue when importing any project that previously ran Groovy scripts (version 1.0.1) into the Community Studio 2022-1 version.

Once imported and verified, it indicates that all Groovy scripts have disappeared, and indeed, they are not there. Has anyone else experienced the same issue? I've been searching and searching, but I can't find a solution.

Groovy scripts disappear in Bonita Studio 2022.1 or later versions.

Hello,

I have a serious issue when importing any project that previously ran Groovy scripts (version 1.0.1) into the Community Studio 2022-1 version.

Once imported and verified, it indicates that all Groovy scripts have disappeared, and indeed, they are not there. Has anyone else experienced the same issue? I've been searching and searching, but I can't find a solution.

Custom Library Extension

Hello , is it possible to have a useful example of create custom-library for GROOVY.

https://documentation.bonitasoft.com/bonita/latest/software-extensibilit...

Get user custom information with Groovy Script

Hello everyone.

I have created 2 custom user fields to enter your document and start date . This data will be used to automate a part of the process.

I have not been able to obtain the data, the closest I was to achieving it was using this code:

List customUserInfoList = apiAccessor.getIdentityAPI().getCustomUserInfo(processInitiator.id, 0, 100);

for (var in customUserInfoList) {
logger.info("Custom Data: " + var.properties.toString())
}

LOG:

Copy document to filesystem

How can I copy a document to file system?

I tried using Groovy script:

String source = reportPDF.getUrl ()
String destination = '\\\\192.168.1.9\\Documents\\Clients\\Demo Client\\Reports\\'

File.copy (source, destination)

But .getUrl () doesn't have the full path of the document.

The idea is that once the document is validated with a human task, it is copied to the clients' folders automatically.

Is it possible to create bonita user using script task?

I tried to create a user in bonita portal using a script task.

use the following code and failed without success.

// First of all, let's log in on the engine: org.bonitasoft.engine.api.APIClient apiClient = new APIClient() apiClient.login("install", "install") // create new user, with username john and password bpm IdentityAPI identityAPI = apiClient.getIdentityAPI() final User user = identityAPI.createUser("john", "bpm") System.out.println("New user created: " + user)

Is it possible to create bonita user using script task? If possible what am I got wrong here?

How to get value of params or process variable in constrains contract?

Hi,

I need validate date depend of params defined in the flow then It's possible get value of params or process variable in constrains contract?

Thank you.

Regards!

Rayo.

Install Groovy Script to Bonita Portal

I have a groovy script (a class) which allows me to get users of specific roles. My question is, how do I install that in the Bonita Portal, because when the process gets to the sending of the email part, it throws a missingMethodException. I assumed this meant that Bonita Studio did not include the groovy script that I've made when I built the .bar file of the process.

Is there any way to get pass this aside from just putting the groovy script in the groovy editor of the email connector?

Help with dueDateCalculation() Groovy code.

I have been trying to customize the due date of a task using a groovy script.

This is my code:

long totalSLA

if (requestContract.fileType == "Audio" && requestContract.scale == "Major"){
totalSLA = 432000000L
} else if (requestContract.fileType == "Audio" && requestContract.scale == "Minor"){
totalSLA = 259200000L

}

return totalSLA

I also tried this code:

How to get User's Role using Groovy.

How do I get the user's role?

I have the user's ID. I'm not sure if there's a method which allows us to get the User's Role.

.getUserWithProfessionalDetails does not provide the User's role.

Notifications