Groovy

How to Get UserId of selected user in form .

I create one form with select field , and add initial value is list of user in that select field .

UserCriterion Error When I try to fetch/return list of users

in Select field , i write one groovy script to fetch initial value : list of available users

How to Create Document in PDF with forms All content

I create one from with all employee detail now i want to add action on submit button .

when it clicked : document is generated of all detail and email to the employee email id

Pl can i know how to achieve it . how to generate document .

Thanks kandarp

How to Add Action on button

i create on form and on text field 'cmnt'

I want to add a comment with a data from a form field 'cmnt' , I can add an action to the form and write the next groovy code:

apiAccessor.getProcessAPI().addComment(rootProcessInstanceId, field_TextField1);

for that i done following . now in submit's button's > general tab > action > add action now there is two field

---- takes value of ----- now exactly where i have to write code ?

i tried by ---- takes value of -Code = give error Variable -- takes value of -- Code = give error

Field validator error

Hello ! I have 2 password fields on my form: password and passwordConfirm And for the 2-nd field i use a Groovy expression validator with this params : return password.equals(field_passwordConfirm) (password is a text variable that takes value of field_password) .Independently the values of fields are equals or not bonita gives me my validators error text . How can i solve it?

Please Provide code for get taskname , taskid , current Case id using Bonitasoft api

hello ,

i create one process at i want to mail Admin after task completed following details

**logged User ID logged User Name Name of task Case ID Task ID **

i found user detail by getIdentityAPI() but how to find this processes terms .

pl provide specific code or API name

thanks advance for the help

how to connect and write on db using groovy connector

i create one connector (groovy)

and use following code

import groovy.sql.Sql; import java.sql.Driver;

import groovy.sql.Sql sql = Sql.newInstance("jdbc:oracle:thin:@200.200.1.224:1583:DNLCLONE", "apps", "spider123", "oracle.jdbc.pool.OracleDataSource") sql.execute( """INSERT INTO XX_HOTEL (NAME,ADDRESS) VALUES(?, ?)""", [test,test])

Changer le format de la date en script groovy

Voici mon code :

String.format(" Bonjour, vous avez une demande d'achat faite le %s par %s %s à analyser. ",date_demande, prenom_demandeur, nom_demandeur);

J'aimerais que le format date soit de type "31/12/2014"

BigDecimal Problem

Hi Community!

I'm trying to use some groovy code to do an update according to a list. Well, I'm having some bad time, probably because my code have something wrong.

import groovy.sql.Sql

def lista = []

Sql sql = BonitaSql.newInstance("jdbc:oracle:thin:@MYIPADRESS:orcl1", "NAME", "PASS",new oracle.jdbc.OracleDriver())
sql.eachRow "SELECT CD_USUARI FROM VULTIMOLOG WHERE DAT < (sysdate - 20)", {lista +=it.CD_USUARI}
sql.close()

Notifications