2 Replies Latest reply: May 16, 2013 5:27 AM by Neeraj Srivastava RSS

jBPM Human Task Issue

Siva NB Newbie

Hi,

 

I have been developing jBPM web application using jBPM 5.4 and with the tutorial from http://www.mastertheboss.com/jbpm5/jbpm-5-on-jboss-as-7

 

I have configured to use mssql.

 

My Bpmn is very simple from START --- >  TASK A ----> TASK B ----> STOP

 

Unfortunately, when one task is completed i get the following scenarios,

 

1. Only task is created as required but when i complete it it doesnt end.

          i hope it stops with an exception, Error when creating task on task server for work item id 170. Error reported by task server: Task operation request timed out: java.lang.RuntimeException: Task operation request timed out

 

2. More than one task is created, i'm not sure which one must be proceeded with.

 

3. No task is created, with the following error, Error when creating task on task server for work item id 170. Error reported by task server: Task operation request timed out: java.lang.RuntimeException: Task operation request timed out

 

Why does it is not working deterministicly.

 

Can anyone pls help me.

  • 1. Re: jBPM Human Task Issue
    Siva NB Newbie

    Hi

     

    i have attached my server.log file,

     

    11:20:03,497 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) ****** Creating EMF

     

     

    11:20:03,501 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) ****** Creating env

     

     

    11:20:03,505 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) ****** Reading Properties

     

     

    11:20:03,515 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) ****** config section

     

     

    11:20:04,611 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into SessionInfo (lastModificationDate, rulesByteArray, startDate, OPTLOCK) values (?, ?, ?, ?)

     

     

    11:20:04,750 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into ProcessInstanceInfo (id, lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?, ?)

     

     

    11:20:04,784 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into ProcessInstanceLog (end_date, outcome, parentProcessInstanceId, processId, processInstanceId, start_date, status) values (?, ?, ?, ?, ?, ?, ?)

     

     

    11:20:04,810 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)

     

     

    11:20:04,835 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)

     

     

    11:20:04,848 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)

     

     

    11:20:04,863 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) OnEntrying the First Task ***

     

     

    11:20:04,868 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into WorkItemInfo (creationDate, name, processInstanceId, state, OPTLOCK, workItemByteArray) values (?, ?, ?, ?, ?, ?)

     

     

    11:20:05,934 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?, startDate=?, OPTLOCK=? where id=? and OPTLOCK=?

     

     

    11:20:05,959 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: update ProcessInstanceInfo set id=?, lastModificationDate=?, lastReadDate=?, processId=?, processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where InstanceId=? and OPTLOCK=?

     

     

    11:20:05,977 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: update WorkItemInfo set creationDate=?, name=?, processInstanceId=?, state=?, OPTLOCK=?, workItemByteArray=? where workItemId=? and OPTLOCK=?

     

     

    11:20:06,030 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?, startDate=?, OPTLOCK=? where id=? and OPTLOCK=?

     

     

    11:20:47,370 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Started Process Output 31

     

     

    11:21:10,774 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Completed Process Output 31

     

     

    11:21:10,873 INFO  [stdout] (Thread-88) Hibernate: select workitemin0_.workItemId as workItemId256_0_, workitemin0_.creationDate as creation2_256_0_, workitemin0_.name as name256_0_, workitemin0_.processInstanceId as processI4_256_0_, workitemin0_.state as state256_0_, workitemin0_.OPTLOCK as OPTLOCK256_0_, workitemin0_.workItemByteArray as workItem7_256_0_ from WorkItemInfo workitemin0_ where workitemin0_.workItemId=?

     

     

    11:21:10,900 INFO  [stdout] (Thread-88) Hibernate: select processins0_.InstanceId as InstanceId254_0_, processins0_.id as id254_0_, processins0_.lastModificationDate as lastModi3_254_0_, processins0_.lastReadDate as lastRead4_254_0_, processins0_.processId as processId254_0_, processins0_.processInstanceByteArray as processI6_254_0_, processins0_.startDate as startDate254_0_, processins0_.state as state254_0_, processins0_.OPTLOCK as OPTLOCK254_0_ from ProcessInstanceInfo processins0_ where processins0_.InstanceId=?

     

     

    11:21:10,926 INFO  [stdout] (Thread-88) OnExiting the First Task ***

     

     

    11:21:10,929 INFO  [stdout] (Thread-88) Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)

     

     

    11:21:10,942 INFO  [stdout] (Thread-88) Hibernate: insert into NodeInstanceLog (log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (?, ?, ?, ?, ?, ?, ?)

     

     

    11:21:10,951 INFO  [stdout] (Thread-88) OnEntrying the Second Task ***

     

     

    11:21:10,953 INFO  [stdout] (Thread-88) Hibernate: insert into WorkItemInfo (creationDate, name, processInstanceId, state, OPTLOCK, workItemByteArray) values (?, ?, ?, ?, ?, ?)

     

     

    11:21:11,061 INFO  [stdout] (Thread-88) Hibernate: update WorkItemInfo set creationDate=?, name=?, processInstanceId=?, state=?, OPTLOCK=?, workItemByteArray=? where workItemId=? and OPTLOCK=?

     

     

    11:21:11,099 INFO  [stdout] (Thread-88) Hibernate: delete from WorkItemInfo where workItemId=? and OPTLOCK=?

     

     

    11:22:14,575 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Started Process Output 32

     

     

    11:23:18,690 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Completed Process Output 32

     

     

    11:23:18,766 INFO  [stdout] (Thread-91) Hibernate: select workitemin0_.workItemId as workItemId256_0_, workitemin0_.creationDate as creation2_256_0_, workitemin0_.name as name256_0_, workitemin0_.processInstanceId as processI4_256_0_, workitemin0_.state as state256_0_, workitemin0_.OPTLOCK as OPTLOCK256_0_, workitemin0_.workItemByteArray as workItem7_256_0_ from WorkItemInfo workitemin0_ where workitemin0_.workItemId=?

     

     

    11:23:18,787 INFO  [stdout] (Thread-91) Hibernate: select processins0_.InstanceId as InstanceId254_0_, processins0_.id as id254_0_, processins0_.lastModificationDate as lastModi3_254_0_, processins0_.lastReadDate as lastRead4_254_0_, processins0_.processId as processId254_0_, processins0_.processInstanceByteArray as processI6_254_0_, processins0_.startDate as startDate254_0_, processins0_.state as state254_0_, processins0_.OPTLOCK as OPTLOCK254_0_ from ProcessInstanceInfo processins0_ where processins0_.InstanceId=?

     

     

    11:23:18,811 INFO  [stdout] (Thread-91) Hibernate: delete from WorkItemInfo where workItemId=? and OPTLOCK=?

     

     

     

    persistence.xml:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

    <persistence version="2.0"

       xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

       xsi:schemaLocation="

            http://java.sun.com/xml/ns/persistence

            http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

        

                <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">

        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>      

     

        <mapping-file>META-INF/jbpmorm.xml</mapping-file>

        <mapping-file>META-INF/Taskorm-JPA2.xml</mapping-file>

        <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

        <class>org.drools.persistence.info.SessionInfo</class>

        <class>org.drools.persistence.info.WorkItemInfo</class>

        <class>org.drools.persistence.info.SessionInfo</class>

        <class>org.drools.persistence.info.WorkItemInfo</class>

        <class>org.jbpm.process.audit.ProcessInstanceLog</class>

        <class>org.jbpm.process.audit.NodeInstanceLog</class>

        <class>org.jbpm.process.audit.VariableInstanceLog</class>

        <class>org.jbpm.task.Attachment</class>

        <class>org.jbpm.task.Content</class>

        <class>org.jbpm.task.BooleanExpression</class>

        <class>org.jbpm.task.Comment</class>

        <class>org.jbpm.task.Deadline</class>

        <class>org.jbpm.task.Comment</class>

        <class>org.jbpm.task.Deadline</class>

        <class>org.jbpm.task.Delegation</class>

        <class>org.jbpm.task.Escalation</class>

        <class>org.jbpm.task.Group</class>

        <class>org.jbpm.task.I18NText</class>

        <class>org.jbpm.task.Notification</class>

        <class>org.jbpm.task.EmailNotification</class>

        <class>org.jbpm.task.EmailNotificationHeader</class>

        <class>org.jbpm.task.PeopleAssignments</class>

        <class>org.jbpm.task.Reassignment</class>

        <class>org.jbpm.task.Status</class>

        <class>org.jbpm.task.Task</class>

        <class>org.jbpm.task.TaskData</class>

        <class>org.jbpm.task.SubTasksStrategy</class>

        <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

        <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

        <class>org.jbpm.task.User</class>

     

     

        <properties>

           <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>

          <property name="hibernate.max_fetch_depth" value="3"/>

          <property name="hibernate.hbm2ddl.auto" value="update" />

          <property name="hibernate.show_sql" value="true" />

              <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

         

          <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->     

          <property name="hibernate.id.new_generator_mappings" value="false" />

        </properties>

     

     

      </persistence-unit>

     

       <persistence-unit name="org.jbpm.task">

        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>      

         <mapping-file>META-INF/Taskorm-JPA2.xml</mapping-file>

       

        <class>org.jbpm.task.Attachment</class>

        <class>org.jbpm.task.Content</class>

        <class>org.jbpm.task.BooleanExpression</class>

        <class>org.jbpm.task.Comment</class>

        <class>org.jbpm.task.Deadline</class>

        <class>org.jbpm.task.Comment</class>

        <class>org.jbpm.task.Deadline</class>

        <class>org.jbpm.task.Delegation</class>

        <class>org.jbpm.task.Escalation</class>

        <class>org.jbpm.task.Group</class>

        <class>org.jbpm.task.I18NText</class>

        <class>org.jbpm.task.Notification</class>

        <class>org.jbpm.task.EmailNotification</class>

        <class>org.jbpm.task.EmailNotificationHeader</class>

        <class>org.jbpm.task.PeopleAssignments</class>

        <class>org.jbpm.task.Reassignment</class>

        <class>org.jbpm.task.Status</class>

        <class>org.jbpm.task.Task</class>

        <class>org.jbpm.task.TaskData</class>

        <class>org.jbpm.task.SubTasksStrategy</class>

        <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

        <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

        <class>org.jbpm.task.User</class>

       

        <class>org.drools.persistence.info.SessionInfo</class>

        <class>org.drools.persistence.info.WorkItemInfo</class>

        <class>org.drools.persistence.info.SessionInfo</class>

        <class>org.drools.persistence.info.WorkItemInfo</class>

        <class>org.jbpm.process.audit.ProcessInstanceLog</class>

        <class>org.jbpm.process.audit.NodeInstanceLog</class>

        <class>org.jbpm.process.audit.VariableInstanceLog</class>

        <properties>

          <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>

          <property name="hibernate.max_fetch_depth" value="3"/>

          <property name="hibernate.hbm2ddl.auto" value="update" />

          <property name="hibernate.show_sql" value="true" /> 

        <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

          <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->     

          <property name="hibernate.id.new_generator_mappings" value="false" />

        </properties>

      </persistence-unit>

    </persistence>

     

    Snippet for creating a process:


    HornetQHTWorkItemHandler myhandler = new HornetQHTWorkItemHandler(ksession);

    try{

                                         StartProcess.ksession.getWorkItemManager().registerWorkItemHandler("Human Task", myhandler);

         }catch(Exception e){

              e.printStackTrace();

    }

  • 2. Re: jBPM Human Task Issue
    Neeraj Srivastava Newbie

    Try with LocalTaskService(just to check if there is not other issue). Problem is time of execution is more than default waiting time for HornetQHandler. You can use debugger and see.