<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
ProcessInstanceId always is 1
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/betoflint">Jonathan Albornoz</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/787407#787407">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi, i have a jboss server 7.0.2 with jbpm 5.3 and oracle 11g, the persistence work fine after two month of configuration and distinct test.</p><p>Now, i have a problem when i run my app on my web application, if i run my .bpmn (evaluation) on my console work all fine, the tables has data and id's works fine, the distinct process instance have an particular id. Here, all perfect, but i want now run the same .bpmn with de  api of jbpm from my project, but appear an error telling me the next:  </p><p>My question is how i can reserv an id for my instance in api. I must change something from my code???</p><p>Thanks and i hope that somebody can help me!!</p><p>Sorry for the english!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #0000ff;"><strong>CODE:</strong></span></p><p>Map<String, Object> params = new HashMap<String, Object>();</p><p>                    params.put("userId", "krisv");</p><p>        params.put("description", "Yearly performance evaluation");</p><p>                    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();</p><p>                    kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2);</p><p>                    KnowledgeBase kbase = kbuilder.newKnowledgeBase();</p><p>                    StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();</p><p>                    logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "test", 1000);</p><p>        hornetQHTWorkItemHandler = new HornetQHTWorkItemHandler(ksession);</p><p>        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", hornetQHTWorkItemHandler);</p><p>        taskClient = new SyncTaskServiceWrapper(new AsyncHornetQTaskClient("HumanTaskExample-testClient"));</p><p>        taskClient.connect("127.0.0.1", 5445);</p><p>        SystemEventListenerFactory.setSystemEventListener(new SystemEventListener());</p><p>        org.drools.runtime.process.ProcessInstance piId = ksession.createProcessInstance("com.sample.evaluation", params);</p><p>                    ksession.startProcessInstance(piId.getId());</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong style="color: #0000ff;">ERROR LOG:</strong></p><p>1    03/01 16:44:39,184[main] ERROR workitem.wsht.GenericHTWorkItemHandler.executeWorkItem  - Thu Jan 03 16:44:39 CLST 2013: <span style="color: #ff0000;">Error when creating task on task server for work item id 1</span>. Error reported by task server: Task operation request timed out</p><p>java.lang.RuntimeException: Task operation request timed out</p><p>          at org.jbpm.task.service.SyncTaskServiceWrapper.addTask(SyncTaskServiceWrapper.java:118)</p><p>          at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:145)</p><p>          at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70)</p><p>          at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:105)</p><p>          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)</p><p>          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)</p><p>          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)</p><p>          at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)</p><p>          at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)</p><p>          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)</p><p>          at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)</p><p>          at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:188)</p><p>          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:303)</p><p>          at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:168)</p><p>          at org.drools.common.AbstractWorkingMemory.startProcessInstance(AbstractWorkingMemory.java:1092)</p><p>          at org.drools.impl.StatefulKnowledgeSessionImpl.startProcessInstance(StatefulKnowledgeSessionImpl.java:330)</p><p>          at com.sample.testa.main(testa.java:48)</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/787407#787407">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>