1 Reply Latest reply on Nov 13, 2013 2:39 PM by Hossam Ahmed

    jBPM 5.4 Actors problem

    Ramses Hernández Newbie

      Hi, my problem is that when I assign an actor for a human task the task is registered in the database, the user exist in table organizationalentity but in table task and table peopleassignments_potowners the actor was't set, but when the user assigned is a test user (krisv, mary, etc.) everything is ok.

       

      My code is:

       

      <code>

      import java.util.HashMap;

      import java.util.List;

      import java.util.Map;

      import mx.edu.inee.demos.jbpm.comun.Connection;

      import org.drools.KnowledgeBase;

      import org.drools.runtime.StatefulKnowledgeSession;

      import org.drools.runtime.process.ProcessInstance;

      import org.jbpm.task.User;

      import org.jbpm.task.query.TaskSummary;

      import org.jbpm.task.service.TaskServiceSession;


      public class EjecutaPrueba {

       

        public static void main(String[] args){

       

        KnowledgeBase kBase = Connection.getKnowledgeBasePrueba();

       

        StatefulKnowledgeSession kSession = Connection.getStatefulKnowledgeSessionPrueba(kBase);

       

        Connection conn = new Connection();

       

        TaskServiceSession taskSession = conn.initTaskService();

       

        User user1 = new User("user1");

        User user2 = new User("user2");

        User user3 = new User("auto");

        User user4 = new User("user4");

        User user5 = new User("user5");

       

        taskSession.addUser(user1);

        taskSession.addUser(user2);

        taskSession.addUser(user3);

        taskSession.addUser(user4);

        taskSession.addUser(user5);

       

        ProcessInstance pi = kSession.startProcess("inee.Prueba");

       

        List<TaskSummary> tasks = taskSession.getTasksAssignedAsPotentialOwner("user1", "en-UK");

       

        //Mostramos el tamaño del arreglo

        System.out.println("El tamaño es: " + tasks.size());

       

        for(TaskSummary ts : tasks){

        System.out.println(ts.getId());

        System.out.println(ts.getName());

        System.out.println(ts.getProcessId());

        }

       

        }

       

      }

      </code>

       

      The bpmn has the property ActorId = krisv and it works fine but if I put ActorId = user1 the actor is not saved in peopleassignments_potowners and task.

       

      Thanks in advance.

       

      Ramses Hernández