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.

Delete line in BDM from my diagram.

Hello community,

Please anyone can help me with deleting a line in the BDM from my diagram?

In my use case, i add a line, i modified a line also, but i didn't find the way to delete something.

For example in my BDM i have a table "Student" with two columns: Name and last name. and there is 2 lines in this table: James BOND and Will SMITH. In this point i want to delete WILL SMITH (not from the browser but from my diagram).

Please anyone can help me in this point.

Thank you :)

Create a new User and Portal Profile from system task/script


I am attempting to create a new organization user form, after which a new user and portal profile is added. The user form is the instantiation form, and it contains the new user's username. For testing purposes, password is a static string. After the form is submitted, a system task is created that runs a script that generates the new user and the user's portal profile. The user part works fine, but I am unable to create the user's Portal Profile.

Here is the Bonita Engine Log error:

How to set multiple actors with specific role with groovy script?


I created a groovy script in order to get users has a specific role in a specific group.

I set the actor with groovy script

import org.bonitasoft.engine.api.IdentityAPI;
import org.bonitasoft.engine.identity.Group;
import org.bonitasoft.engine.identity.GroupCriterion;
import org.bonitasoft.engine.identity.User;

email connector attachment error


I created an email connector with attach files and it works well.

When I attach the file, it works well. However, once I didn't attach the file, it has an error.

I validate formOutput like :

return {
'authdocumentDocumentInput': $data.formInput.authdocumentDocumentInput

return {
'authdocumentDocumentInput': null

But, the error occurred when I didn't attach the file.

How to parse string to Localdate in timer event.

I created a timer connector inside Bonita bpm process. I set the end date with a groovy script. However, I cannot get the result.

There is no error, however, the timer doesn't evoke the next trigger

I would like to get the exact time like 2019-02-20 13:11:00

My code is as follows.

How can set the fixed dates as a multiple dates list in timer condition?


I am developing on a kind of scheduler process.

Manager created multiple tasks which have a due date. Whenever the due date reaches I would like to send a notification to the user and manager at the same time.

I returned the due dates into a process variable as an object, however, in the timer condition, only allowed java.util.Date type.

is it possible to set the fixed dates as multiple dates in the groovy script?

In the case of my process, how to approach the solution?

I am sorry the question is vague.

How to update composition BDM with Groovy Script?


I created composition BDM and add all contracts using by the groovy script

Once I return the BDM I need to update all contract, so, I added update groovy script, however, I got the error,

Please help me what is the error to indicate.

Thanks in advance

This is the addall operation groovy script

def testTimerList = []
//For each item collected in multiple input
boolean status = false;

Decision table

I asking about the possibility of making script lines in the decision table for making a transition or it is only a comparison test?
if yes, can I, in the groovy script, make controls on information of organisation actors (country, job,..) and also access to data in MySQL database?