Groovy

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;

Decision table

Hello,
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?

MySQL last_insert_id() error

Hello everyone.

I have a connector that insert a row in an external mysql db that works correctly. Now, I wanted to extend such connector in order to return the id of the lastly inserted row (the mysql table has a auto_incremented field) which I want to save in a variable to use it for future editing within the same process (I do that in the output operation definition part of the connector). The groovy code looks like this:

Remove item from BDM

How to remove a certain item from BDM through a script in Groovy?
I can access my BDM Logs but I can not delete them, how can I do this?

I'm getting the data from my PostgreSQL database and saving in my BDM to be able to display this data in a table in my UI Designer, that's fine, but I do not want the same information to be added twice in BDM, for that reason I created this script that checks if the information that is being fetched from my external database is no longer added in BDM

Get blob from mysql with groovy

I have a simple table with these fields:

Notifications