domingo, 28 de julio de 2013

Groovy SQL

import groovy.sql.Sql;

import java.sql.RowId;
import java.text.SimpleDateFormat;

//def list=[];

sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/exampleBonita","root", "root",new com.mysql.jdbc.Driver());
//sql.eachRow("SELECT * FROM `personen`",{row-> list.add(row.idNachname)});

row = sql.firstRow("select id, nombre from datos where id =" + cedulaIdentidad);
//println "Columna personid = ${row.id} y la columna nombre = ${row.nombre}"



if (row == null){
    print "No existe registros" + cedulaIdentidad;
    estudiante = false;
    }
else{
    cedulaIdentidad = row.id;
    nombre = row.nombre;

    estudiante = true;
    }

Selects dinamicos

${import groovy.sql.Sql; 
def list=[]; 
sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/exampleBonita","root", "root",new com.mysql.jdbc.Driver());
sql.eachRow("SELECT * FROM datos",{row-> list.add(row.nombre)});
list}

Script Groovy para manejo de Fechas en Bonita

Creamos una variable local tipo date, y utilizamos un conector de tipo asignacion de variable donde incluimos este script groovy


String dia = fechaPrestamoLocal.getDate();

String mes = (fechaPrestamoLocal.getMonth() + 1 );

String anio = (fechaPrestamoLocal.getYear() + 1900 );

if(java.lang.Integer.parseInt(dia) < 10 ){
    dia = "0" + dia;
    }


if(java.lang.Integer.parseInt(mes) < 10 ){
    mes = "0" + mes;
    }


return  dia + "/" + mes  + "/" + anio;

Configurar JVM en BOS-5.6.2-Tomcat

Incluir esta line en el archivo startup.sh de tomcat

#!/bin/sh

export JAVA_HOME=/opt/instadores/jdk1.6.0_31

Connecting to PostgreSQL Database Using Groovy

package com.binarynovae.gsql;
import groovy.sql.Sql;
def sql = Sql.newInstance("jdbc:postgresql://localhost:" +
       "5432/binarynovae""postgres""admin",
       "org.postgresql.Driver")

/*
 * Display All the records in table Person
 */
println "All Records:"
def query = "select * from person"
sql.eachRow query, {person->
 println person.name + " "  + person.person_id +" " +person.age
}

/*
 * Insert a record into Person table
 */
query = "insert into person (name, person_id, age) values (?,?,?)"
def name = "Ryan"
def age = 23
def id = 1289367
sql.executeInsert query, [name, id, age];

/*
 * Display the inserted value
 */
println "Inserted Record:"
query = "select * from person where name = ?"
sql.eachRow(query,[name], {person->
    println person.name + " "  + person.person_id +" " +person.age
})

/*
 * Update the inserted record values
 */
query = "update person set age=? where name=?"
name = "Ryan"
age = 30
sql.executeUpdate query, [age,name]

/*
 * Display the updated value
 */
println "Updated Record:"
query = "select * from person where name = ?"
sql.eachRow(query,[name], {person->
   println person.name + " "  + person.person_id +" " +person.age
})

/*
 * Delete the inserted value
 */
query = "delete from person where name=?"
name = "Ryan"
sql.execute query, [name]

/*
 * Checking whether the deletion is successful
 */
println "After deletion:"
query = "select count(1) from person where name = ?"
sql.eachRow(query,[name], {row->
    println row[0]
})

Integracion BonitaOpenSolution in Jboss

I follow the steps described in the document:
Includes BOS 5.5.1 and a JBoss 5.1.0 server
http://www.bonitasoft.com/products/BPM_downloads#tabs-9

1.  Copy all *.jar files from <BOS-5.5-DEPLOY>\bonita_execution_engine\bonita_client\libs and <BOS-5.5-DEPLOY>\bonita_execution_engine\engine\libs to <JBOSS_HOME>\server\default\lib
2. Copy <BOS-5.5-DEPLOY>\bonita_user_experience\without_execution_engine_without_client\bonita.war to <JBOSS_HOME>\server\default\deploy.
3. Edit the files
<JBOSS_HOME>\bonita\server\default\conf\bonita-journal.properties
<JBOSS_HOME>\bonita\server\default\conf\bonita-history.properties
I commented the Default database configuration section in both files and uncomment all POSTGRESQL section, for example:
##################################
# Default database configuration #
##################################
# IMPORTANT: do not use those settings for production!
# By default Bonita use a H2 database that will store all data in one file.
# Access to the database is done throught a datasource configured in Tomcat configuration file: conf/context.xml
# H2 Hibernate dialect
# hibernate.dialect                        org.hibernate.dialect.H2Dialect
# Using an interceptor can change the database behaviour. By default, an interceptor is defined to order the result of queries by adding null values at the end.
# bonita.hibernate.interceptor             org.ow2.bonita.env.interceptor.H2DescNullFirstInterceptor
# Table are automatically create in database
# hibernate.hbm2ddl.auto                   update
# Location of the datasource (define in Tomcat configuration file: conf/context.xml)
# hibernate.connection.datasource          java:/comp/env/bonita/default/history
# Default database connection over H2 (not using datasources)
# hibernate.connection.driver_class        org.h2.Driver
# hibernate.connection.url                 jdbc:h2:file:${BONITA_HOME}/server/default/work/databases/bonita_history.db;FILE_LOCK=NO;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE
# hibernate.connection.username            bonita
# hibernate.connection.password            bpm
hibernate.dialect                        org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class        org.postgresql.Driver
hibernate.connection.url                 jdbc:postgresql://localhost:5432/bonita_history
hibernate.connection.username            my_user
hibernate.connection.password            my_passwd
databases were previously created y my postgres server and also the username and password

4.  In <JBOSS_HOME>\external\xcmis\ext-exo-conf folder I have used exo-configuration-mysql.xml and cmis-jcr-configuration-mysql.xml in order to created two files: exo-configuration-mysql.xml
cmis-jcr-configuration-postgresql.xml and exo-configuration-postgres.xml
In exo-configuration-postgres.xml change the following:
    <component>
      <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
      <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
      <init-params>
         <value-param>
            <name>conf-path</name>
            <description>JCR configuration file</description>
            <value>/cmis-jcr-configuration-postgresql.xml</value>
         </value-param>
      </init-params>
    </component>

    <properties-param>
       <name>ref-addresses</name>
       <description>ref-addresses</description>
      <property name="driverClassName" value="org.postgresql.Driver"/>
      <property name="url" value="jdbc:postgresql://localhost:5432/xcmis"/>
      <property name="username" value="postgres"/>
      <property name="password" value="debian"/>
    </properties-param>
In cmis-jcr-configuration-postgresql.xml change the following:
    <workspace name="system">
    <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
    <properties>
      <property name="source-name" value="jdbcxcmis" />
      <property name="dialect" value="pgsql" />
      <property name="multi-db" value="false" />
      <property name="max-buffer-size" value="200k" />
      <property name="swap-directory" value="${exo.data.dir}/swap/system" />
    </properties>
    </container>
               
    <workspace name="cmis1">
      <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
        <properties>
          <property name="source-name" value="jdbcxcmis" />
          <property name="dialect" value="pgsql" />
          <property name="multi-db" value="false" />
          <property name="max-buffer-size" value="200k" />
          <property name="swap-directory" value="${exo.data.dir}/swap/cmis1" />
        </properties>
      </container>
       
5. Copy the JDBC driver to <JBOSS_HOME>\server\default\lib.
postgresql-9.1-901.jdbc4.jar
6. In the step 2.5.3 Configure logging, I  did not find <JBOSS_HOME>\conf\logging.properties , I found
/etc/java6-open-jdk/logging.properties and edit it and added the lines
org.ow2.bonita.level = INFO
org.ow2.bonita.example.level = FINE
org.ow2.bonita.runtime.event.EventDispatcherThread.level = WARNING
org.hibernate.level = WARNING
net.sf.ehcache.level = SEVERE
7. IN <JBOSS_HOME>\bin\run.conf i added the lines
BONITA_OPTS="-DBONITA_HOME=/usr/share/jbossas5/bonita -Dorg.ow2.bonita.api-type=Standard"  LOG_OPTS="-Djava.util.logging.config.file=../external/logging/logging.properties" mycwd=`pwd` CMIS_CONFIG="-Dexo.data.dir=/usr/share/jbossas5/external/xcmis/ext-exo-data -Dorg.exoplatform.container.standalone.config=/usr/share/jbossas5/external/xcmis/ext-exo-conf/exo-configuration-postgres.xml" JAVA_OPTS="$JAVA_OPTS $BONITA_OPTS $LOG_OPTS $CMIS_CONFIG -Dfile.encoding=UTF-8 -Xshare:auto -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError" export JAVA_OPTS
8. In the step 2.6 Configure JAAS authentication and communication,  I  did not find <JBOSS_HOME>\conf\logging.properties, I found the following files:
/etc/jbossas5/profiles/all/login-config.xml
/etc/jbossas5/profiles/default/login-config.xml
/etc/jbossas5/profiles/standard/login-config.xml
/etc/jbossas5/profiles/web/login-config.xml
In all files  I added the following lines:
<application-policy name="BonitaAuth">
      <authentication>
      <login-module code="org.ow2.bonita.identity.auth.BonitaIdentityLoginModule"
       flag="required"/>
      </authentication>
</application-policy>
<application-policy name="BonitaStore">
      <authentication>
      <login-module code="org.ow2.bonita.identity.auth.LocalStorageLoginModule"
       flag="required"/>
      </authentication>
</application-policy>
<application-policy name="exo-domain">
<authentication>
   <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule"
     flag="required"/>
</authentication>
</application-policy>
9. My jboss server is running and I try to open the bonita software with http://127.0.0.1:8080/bonita/, in the form I placed the credentials
username: admin
passwd: bpm
And then the error occurs:
    org.ow2.bonita.util.BonitaRuntimeException: The system property 'BONITA_HOME' is not set
    org.ow2.bonita.util.BonitaConstants.getBonitaHomeFolder(BonitaConstants.java:75)
    org.ow2.bonita.facade.APIInterceptor.invoke(APIInterceptor.java:117)
    $Proxy350.generateTemporaryToken(Unknown Source)
    org.bonitasoft.console.security.server.api.impl.CredentialsEncryptionAPIImpl.generateTemporaryToken(CredentialsEncryptionAPIImpl.java:157)
    org.bonitasoft.console.security.server.CredentialsEncryptionServlet.doPost(CredentialsEncryptionServlet.java:107)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
 
I do not know how to solve this I am new using open source technologies
please if anyone can help I'd appreciate it greatly

BOS + EJB on JBoss

Optionally, if you want to use the EJB3 API and access the engine remotely in EJB mode, use the EAR available in Bonita Open Solution.
Deploy Bonita EAR
Copy the EAR available in <BOS-5.6-DEPLOY>\bonita_execution_engine\interfaces\EJB\EJB3\bonita.ear to <JBOSS_HOME>\server\default\deploy.
Update JAAS configuration
If your client is Bonita User Experience or any Java client, configure the loginContext BonitaStore in <JBOSS_HOME>\conf\login-config.xml:
<application-policy name="BonitaStore">
 <authentication>
   <login-module code="org.ow2.bonita.identity.auth.BonitaRemoteLoginModule" flag="required"/>
   <login-module code="org.jboss.security.ClientLoginModule" flag="required">
    <module-option name="password-stacking">useFirstPass</module-option>
  </login-module>
 </authentication>
</application-policy>
You will also have to update your server variable BONITA_OPTS to use the EJB3 API:
set "BONITA_OPTS=-DBONITA_HOME=<JBOSS_HOME>\bonita -Dorg.ow2.bonita.api-type=EJB3  -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=jnp://localhost:1099"

Bonita Open Solution 5.7 Now Available

The following bugs have also been fixed in this new version:
  • 9567 Error while uploading an attachment oh 17MB
  • 8881 XCMIS : some empty directories remains after ProcessDefinition removal.
  • 9806 Studio Robustness : a corrupted .proc file prevent the Studio to work
  • 9659 Jasper/Create report wizard accepts parameters of any type but connector has a limitation at runtime : String parameters only
  • 8425 Exceptions with SVN repository that lead to inconsistency
  • 9845 Case can't be archived.
  • 9924 Validator dialog issue
  • 8492 Add a tooltip to provide the name of the submitURL parameter
  • 9799 Wrong HTML generated for (tabled) widgets in group
  • 9471 look_n_feel.zip/css/BonitaConsoleExt.css changes are ignored
  • 6377 User with no "process visibility" right on any processes can't access worklist
  • 8182 User XP look and feel with multi-line description crashes the look and feel listing
  • 9668 Missing logo after go to default theme
  • 9793 Avaliable value after update of contingencies widget displays error
  • 9823 Database connector error at at updata value
  • 9277 Step Form editor : Contingencies / Update value does not display field_Group1
  • 7092 Salesforce-Update a Salesforce object,button 'Next' is grey when all the Items are filled
  • 7469 list widget contingencies problem
  • 7382 Rule status does not change after remove the related process
  • 9526 Attachment file can not upload to user xp
  • 8449 Cannot retrieve document error when use attachment variable on process
  • 8451 Number of variable display does not consistent between BOS version and BOS-SP version
  • 8450 Attachment variable name and value displays error if they display in two pages
  • 9477 attachment file name does not match with attachment file content in overview
  • 8140 Validator still display in dropdown list after remove.
  • 9533 modify a process's Diagram name and pool's name,delete all the processes,it will has NullPointerException
  • 8349 Start a process can be clicked many times.
  • 5852 Deletion of a hierachy of group failed
  • 5853 Get an exception when trying to run an older version of the process from the Studio
  • 9788 Sometimes, studio can't find step's actor.
  • 9773 display incorrect version.
  • 9528 process can't run when using Redirect to URL on a step which is in subprocess
  • 9925 two textfield in group don't display in application page
  • 9713 Null pointer on Process version edition.
  • 9674 Multiple Injection of Bonita's CSS pages
  • 7380 Not able to use step data in a multi-instantiated step actor selector
  • 8439 New Process vs SVN is faulty
  • 9709 Run process show"The version of the forms you are trying to display is not supported...."
  • 9086 Preferences-->language-->restore default can't restore the language to English
  • 8115 UserXP / Case Start Privilege interface : Upgrading a process definition mess up the interface for privileges definition.
  • 9740 Studio installer: import workspace feature is faulty : default.properties file
  • 9766 Gate View Pageflow : Only the auto-generated form is displayed.
  • 9927 Studio crash if the admin user is changed from the user XP
  • 9842 Aften run a process,the process will be locked
  • 10024 warning when run a process after clicking "Menu bau->Process->Validate" 
  • 8692 Change the data type, data on the form are not synchronized
  • 10030 Always show error"No actor selector defined"
  • 10028 Add a form to a pool-->overview pageflow,archive this process,in administration-->overview show error
  • 9484 Move a boundary error could produce error
  • 8417 Contingency vs is Mandatory checkbox : Group or widget in a group behavior is faulty
  • 8469 The Groovy manager distorts the accents
  • 9808 the warning tip is still exist after adding actor for a line in studio
  • 8130 Exception when deleting a process with an attachment var
  • 9792 in studio preferences->eclipse->team->svn , can't enter svn connect
  • 9733 step detail privilege can't work well
  • 9827 in administration view , add a report ,then remove it , but it can't add same name again
  • 6508 change Actors--Filters' name it can not display the new name at once
  • 9479 add a Category which name end with a space
  • 9660 Not significant message for POJO unserializable data
  • 9476 The "User metadata"field should be cleared out when you try to use it for another user
  • 10025 Remove process but do not check "Delete attachments",the attachment were deleted
  • 8717 Unable to update an name of a diagram or a process with special characters
  • 8855 email connector : Cyrillic file names of emails's attached file is changed.
  • 9923 The function of Run simulation can't be used
  • 9804 use attachment variable in email connector,when add other email connector,it will has value in attachment part
  • 8863 Russian localization issue
  • 10033 in studio set generate a war , run process , it throw error
  • 9562 in subprocess event add a form , it can' t display well
  • 9667 Contingencies of Text field which in one group has been contingencies on a select will error
  • 9795 new a process to edit diagram version , it can't work well
  • 8420 Role deletion : it removes other roles association to users
  • 9465 Throw event error message : Catch event is not unique in repository
  • 9921 The process have several cases and document can't be removed when select "delete the attachment"
  • 9543 Email connector:use "existing configuration",the attachment can't be saved
  • 9655 Contingency : Select widget "Show when a contingent field has changed" has no effect
  • 9820 In the userXP of admin view,click cancel when change the privilege from no one to everyone,both two won't be selected
  • 9852 The error tips is wrong when the name of the report template is long special character
  • 9844 template error: After running the HR On-boarding process , forms were disappear
  • 9530 Up and down more than one form error
  • 8080 The tooltip is wrong when add a big attachment for a step in User-XP.
  • 9922 install one process twice,it will generate the previous attachments
  • 8501 Issue when using multiple schema with PostgreSQL
  • 9616 the application url is wrong when finish a process,login in again
  • 9818 for bonita--Add documents connector,add a row,after select create data and then cancel it,there is Create data... in the row
  • 8194 The exception occurse when use Secure WS connector
  • 7858 Studio engine log include some error about HTML parsing (Jericho)
  • 8193 NullPointerException:when use WebService - Secure WS connector

Recuperar Registros de la Base de Datos

import GeneracionError;

sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/baseEjemplo","root", "root",new com.mysql.jdbc.Driver());
try{
row = sql.firstRow("select  dsd_name  from TIPO_SIGNO );

if(row == null){
}else{
 notDireccion =  row.dsd_name;
}

}catch(Exception e){
e.printStackTrace();
GeneracionError.error(e.getMessage());
}

Map your Active Directory or LDAP groups in Bonita Open Solution 5

Issue:
You have your users and groups defined in an Active Directory or a LDAP server and you want to use them in Bonita Open Solution in order to assign tasks.
Solution:
To do that, you have to use the LDAP group resolver or the Active Directory group resolver to do a one-to-one group mapping in Bonita Open Solution.
This article explains how to do that step by step.

Prerequisite

You need to know how your directory is structured. Generally, when you create users and groups in a directory, you are invited to create one container for users and another one for groups. So the first thing you need to know is the paths to these 2 containers.
For this article I suggest the next structure (adapt this guide with your own structure):
DC=ad,DC=bonitasoft,DC=com
|
+– OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
|    |
|    +– CN=bos5test1,OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
|    +– CN=bos5test2,OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
|
+– OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
|
+– CN=rodrigue,OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
+– CN=miguel,OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
rodrigue, miguel are in bos5test1 and rodrigue is in bos5test2.

What are we going to do?

The goal here is to create 2 groups in Bonita Open Solution according to this mapping:
BOS GroupLDAP/AD Group
Group Test 1CN=bos5test1
Group Test 2CN=bos5test1

How to do that?

You have to use a group resolver which is a specific connector to create a group. In Bonita Open Solution, a group is a way to represent a list of candidates. You have to translate the group in a list of users with a group resolver. In our case, you will use either the LDAP group resolver (if you reach a LDAP server) or the ADGroupResolver group resolver (if you reach an AD server -  note that you need to install this connector from the community contributions). These 2 connectors work in the same way. So you need to configure:
  1. the server access
  2. the query to find your list of usersT
  3. To write your query you need to provide:
    • the path to where your groups are stored. In the given example: OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
    • the path to where your users are stored. In the given example: OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
    • the filter to find the group: example: CN=bos5test1
      Warning, the filter is applied on the groups not on the users.

Configuration and test of a group mapped with Active Directory: step by step

  1. Open menu Connectors > Test a Connector
  2. Select Group and click on Next
  3. Select the ADGroupResolver connector and click on Next
  4. Select configure from blank and click on Next
  5. Fill the form to connect to the Active Directory server (note the port is 389) and click on Next
  6. Fill the request with the group base path, the user base path and the filter (here CN=bos5test1)
  7. Click on Evaluate and check that your configuration is ok
  8. Save your configuration: click on save connector configuration, enter the name of your configuration and click on Finish
  9. Click on Close
  10. Create a new process, select Step1 and select Actors tab
  11. Click on Create
  12. Select the ADGroupResolver connector and click on Next
  13. Enter the name of the group in Bonita Open Solution: Group Test 1, and click on Next
  14. Select Configure connector starting from an existing configuration and select the saved configuration: Configuration for Group Test 1 and click on Next
  15. Click on Finish
  16. Select your process and select the Dependencies tab
  17. Add the ldap connector in the dependencies
We’ve successfuly configured and tested the group. You are now able to run your application and see that your task is assigned to admin (the Initiator group), rodrigue and miguel.

What have you learned?

You’ve learned how to map a Bonita Group with an AD or LDAP group

What haven’t you learned?

You haven’t learned to do an authentication against LDAP or AD server. This is not done with Bonita Open Solution but it will depend on your deployment server (Tomcat, JBoss, JOnAS, Glassfish, …). You can configure the authentication with LDAP or AD server by configuring the JAAS layer of your server. Please refer to your Application Server Documentation to know how to do that.
Your comments are welcome in order to improve this article.

Recuperar Usuarios de Bonita

package ec.users;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.security.auth.login.LoginContext;
import org.ow2.bonita.facade.IdentityAPI;
import org.ow2.bonita.facade.ManagementAPI;
import org.ow2.bonita.facade.QueryRuntimeAPI;
import org.ow2.bonita.facade.RuntimeAPI;
import org.ow2.bonita.facade.identity.Group;
import org.ow2.bonita.facade.identity.Role;
import org.ow2.bonita.facade.identity.User;
import org.ow2.bonita.facade.runtime.ActivityState;
import org.ow2.bonita.facade.uuid.ActivityInstanceUUID;
import org.ow2.bonita.facade.uuid.ProcessDefinitionUUID;
import org.ow2.bonita.facade.uuid.ProcessInstanceUUID;
import org.ow2.bonita.util.AccessorUtil;
import org.ow2.bonita.util.BonitaConstants;
import org.ow2.bonita.util.SimpleCallbackHandler;

/**
 * Method that get a simple list for users
 *
 * @author netdaemon
 *
 */
public class ObtenerUsuario {

    private static final String LOGIN = "admin";
    private static final String PSSWD = "bpm";
    private static final String jaasFile = "/home/netdaemon/BOS-SP-5.6.1-Tomcat-6.0.33/external/security/jaas-tomcat.cfg";

    public static void main(String[] args) throws Exception {

        // set system properties
        System.setProperty(BonitaConstants.API_TYPE_PROPERTY, "REST");
        System.setProperty(BonitaConstants.REST_SERVER_ADDRESS_PROPERTY,"http://localhost:9080/bonita-server-rest/");
        System.setProperty(BonitaConstants.JAAS_PROPERTY, jaasFile);

        // login
        LoginContext loginContext = new LoginContext("BonitaAuth",new SimpleCallbackHandler(LOGIN, PSSWD));
        loginContext.login();
        loginContext.logout();

        // propagate the user credentials
        loginContext = new LoginContext("BonitaStore",new SimpleCallbackHandler(LOGIN, PSSWD));
        loginContext.login();

        // get he APIs 
        final IdentityAPI identityAPI = AccessorUtil.getIdentityAPI();
     
            try {         
         
             
                    //Recuperar usuarios por role
                    Role role = identityAPI.findRoleByName("secretario");                         
                    List<User> users =  identityAPI.getAllUsersInRole(role.getUUID());                 
                    for (User usr : users) { 
                        System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
                        System.out.println("" + usr.getTitle());                    
                     
                    }             
                 

                    //Recuperar usuarios por Grupo
                    Group group = identityAPI.getGroupByUUID("e8194c31-42d6-4a3b-83b2-b1456b63d74a");                  
                    List <User> usuarios = identityAPI.getAllUsersInGroup(group.getUUID());
                    for (User usr : usuarios) { 
                        System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
                        System.out.println("" + usr.getJobTitle());                                   
                     
                    }
                 
                 
                    List <String> firmantes1 = new ArrayList<String>();
                 
                    //Recuperar lista de delegados y directores                 
                    Role role1 = identityAPI.findRoleByName("delegadoDN");                         
                    List<User> users1 =  identityAPI.getAllUsersInRole(role1.getUUID());         
                 
                    for (User usr : users1) {       
//                        System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
//                        System.out.println("" + usr.getJobTitle());
                        firmantes1.add(usr.getLastName() + " " + usr.getFirstName());                     
                    }
                    Role role2 = identityAPI.findRoleByName("directorNacional");                         
                    List<User> users2 =  identityAPI.getAllUsersInRole(role2.getUUID());         
                     
                    for (User usr : users2) {       
//                           System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
//                           System.out.println("" + usr.getJobTitle());
                           firmantes1.add(usr.getLastName() + " " + usr.getFirstName());                     
                    }                                                       
                 
                    for ( String nombre : firmantes1 ){
                        System.out.println(nombre);
                     
                    }

            } catch (Exception e) {
                e.printStackTrace();
            }finally {         
            loginContext.logout();
            }

    }
}

Select Validator

 public boolean validate(Map<String, FormFieldValue> campos, Locale locale) {
     
            boolean resultado = true;
            FormFieldValue campo1 = campos.get("select1");
            String campoSelect = (String) campo1.getValue();
 
         
            FormFieldValue campo2 = campos.get("textBox1");
            String textBox1 = (String) campo1.getValue();
         
            if (campoSelect =="Término indefinido"){
            resultado = true }
            if (campoSelect != "Término indefinido"){
                 if (textBox1 == null || textBox1=="")
                 {
                 resultado = false;
                 }
             
                 else
                 {
                 resultado = true;
                 }
            }
return resultado
   }

Dependencias jodconverter

jodconverter