[jboss-user] [jBPM] - ProcessInstanceID not increment

Jonathan Albornoz do-not-reply at jboss.com
Fri Jan 4 09:30:52 EST 2013


Jonathan Albornoz [https://community.jboss.org/people/betoflint] created the discussion

"ProcessInstanceID not increment"

To view the discussion, visit: https://community.jboss.org/message/787609#787609

--------------------------------------------------------------
Dear, I have the following problem:
I have jbpm 5.3 on jboss 7.0.2 with oracle, when I run the console process works perfectly, the id processInstanceId incorrect and also increase every time I run the process instance.
The problem is that I need to do it now from the jbpm API creates the process in the task table with the correct ID, but the processInstanceId always 1. Is there any way to be increasing every time you generate a new instance to differentiate them so?
Thnks!

Estimados, tengo el siguiente problema:
Tengo jbpm 5.3 sobre jboss 7.0.2 con oracle, cuando corro por consola los procesos funcionan perfectamente, los id son correctos y los processInstanceId tambien se incrementan cada vez que ejecuto la instancia de proceso.
El problema es que necesito hacerlo ahora desde la api de jbpm, se crea el proceso en la tabla task con el id correcto, pero el processInstanceId siempre es 1. ¿Hay alguna forma de ir incrementando cada vez que genere una nueva instancia para asi poder diferenciarlos?
Muchas gracias!

El codigo asociado que estoy usando como ejemplo es el siguiente:
The code:

public void hola() {
// TODO Auto-generated method stub
                              //declaracion de variables
                              KnowledgeRuntimeLogger logger;
                              HornetQHTWorkItemHandler hornetQHTWorkItemHandler;
                              TaskService taskClient;
                              //StatefulKnowledgeSession ksession;
                              //carga la base de conocimientos
                              KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
                              kbuilder.add(ResourceFactory.newClassPathResource("resources/HumanTask.bpmn"), ResourceType.BPMN2);
                              KnowledgeBase kbase = kbuilder.newKnowledgeBase();
                              //Se define el kasession que podra acceder a mis procesos definidos anteriormente
                              StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

                              logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "test", 1000);

                              //hornetQHTWorkItemHandler = new HornetQHTWorkItemHandler(ksession);
                              CommandBasedHornetQWSHumanTaskHandler taskHandler = new CommandBasedHornetQWSHumanTaskHandler(ksession);

                              ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);

                              taskClient = new SyncTaskServiceWrapper(new AsyncHornetQTaskClient("HumanTaskExample-testClient"));
                  taskClient.connect("127.0.0.1", 5445);
                  SystemEventListenerFactory.setSystemEventListener(new SystemEventListener());
                  //ingreso los parametros
                  Map<String, Object> params = new HashMap<String, Object>();
                              params.put("userId", "krisv");
                  params.put("description", "Yearly performance evaluation");
         //creo la instancia
         ksession.startProcess("com.sample.humantask", params);
         //cerrar las conexiones
                  try {
                                        taskClient.disconnect();
                                        taskHandler.dispose();
                              } catch (Exception e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                              }
                              ksession.dispose();
                              logger.close();
  }
 private static class SystemEventListener implements org.drools.SystemEventListener {
                         public void debug(String arg0) {
                         }
                         public void debug(String arg0, Object arg1) {
                         }
                         public void exception(Throwable arg0) {
                         }
                         public void exception(String arg0, Throwable arg1) {
                         }
                         public void info(String arg0) {
                         }
                         public void info(String arg0, Object arg1) {
                         }
                         public void warning(String arg0) {
                         }
                         public void warning(String arg0, Object arg1) {
                         }
                              }
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787609#787609]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130104/68e2e022/attachment-0001.html 


More information about the jboss-user mailing list