Groovy

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.

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

Hello,

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?

Hello,

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;
import org.bonitasoft.engine.search.SearchOptionsBuilder
import org.bonitasoft.engine.search.SearchResult

email connector attachment error

Hello,

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 :

if($data.formInput.authdocumentDocumentInput){
return {
'authdocumentDocumentInput': $data.formInput.authdocumentDocumentInput
};

}else{
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?

Hello,

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?

Hello,

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;

Notifications