Discussion:
[jboss-user] [jBPM] - ProcessInstanceID not increment
Jonathan Albornoz
2013-01-04 14:30:52 UTC
Permalink
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]
roxy1987
2013-01-04 16:29:54 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: ProcessInstanceID not increment"

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

--------------------------------------------------------------
Do you get exceptions? Please post if any.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Jonathan Albornoz
2013-01-04 19:39:26 UTC
Permalink
Jonathan Albornoz [https://community.jboss.org/people/betoflint] created the discussion

"Re: ProcessInstanceID not increment"

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

--------------------------------------------------------------
Here is my exception.

04/01 16:36:11,752[main] ERROR workitem.wsht.GenericHTWorkItemHandler.executeWorkItem  - Fri Jan 04 16:36:11 CLST 2013: Error when creating task on task server for work item id 1. Error reported by task server: Task operation request timed out
java.lang.RuntimeException: Task operation request timed out
          at org.jbpm.task.service.SyncTaskServiceWrapper.addTask(SyncTaskServiceWrapper.java:118)
          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:145)
          at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70)
          at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:105)
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)
          at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:55)
          at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:51)
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)
          at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
          at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)
          at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
          at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:188)
          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:303)
          at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:168)
          at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:138)
          at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1082)
          at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)
          at cl.mop.ryc.bpm.bo.HumanTaskClient.execute(HumanTaskClient.java:49)
          at cl.mop.ryc.bpm.bo.HumanTaskClient.main(HumanTaskClient.java:33)
isConnected = true
Exception in thread "main" java.lang.RuntimeException: Timeout : unable to retrieve results
          at org.jbpm.task.service.responsehandlers.BlockingTaskSummaryResponseHandler.getResults(BlockingTaskSummaryResponseHandler.java:41)
          at cl.mop.ryc.bpm.bo.HumanTaskClient.execute(HumanTaskClient.java:56)
          at cl.mop.ryc.bpm.bo.HumanTaskClient.main(HumanTaskClient.java:33)
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-04 19:58:15 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: ProcessInstanceID not increment"

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

--------------------------------------------------------------
Looks like your task service is not running.
When you run the ant script start.demo, once the build is successful, just take a look at the directory \jbpm-installer\jboss-as-7.1.1.Final\standalone\deployments\.

Once the .Deployed files for all the war files are generated, then try to run the example you have mentioned above. And see if the error still persists. Successful deployment of war file means that your task service has started. You dont need to explicitly start up human task service.

After successful deployment, Your directory should look like this :

Loading Image... Loading Image...
The extension will keep changing before getting to .Deployed so wait for it to take its time. If for some reason, the extension changes to .Failed then you would need to figure out the reason for deployment failure.


Saludos
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-04 20:00:48 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: ProcessInstanceID not increment"

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

--------------------------------------------------------------
If everything is fine with respect to the task service then you can check the topic 
https://community.jboss.org/thread/217472 https://community.jboss.org/thread/217472
and try what is suggested there.
I would suggest you to download jbpm 5.4.Final but it has nothing to do with the issue you are facing.

--------------------------------------------------------------

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

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