1 2 3 Previous Next 30 Replies Latest reply on Sep 1, 2015 8:50 AM by Maulee Parikh Go to original post
      • 15. Re: jBPM straying after user task completed
        Laura delli Paoli Master

        Hi everybody!!

        Today I was trying to face this issue again, but I'm confused about how to get the human task's WorkitemManager!

         

        Can anyone help me??

        • 16. Re: jBPM straying after user task completed
          Shobhit Tyagi Master

          Are you asking how to get the workItem manager for the human task?

           

          First we get the session and create a human task workItem handler and feed the session to it.

          Next we use the session to get teh workitem manager.

           

          objTaskHandler = new HornetQHTWorkItemHandler(objKSession);

             objTaskHandler.setIpAddress(strIpAddress);

             objTaskHandler.setPort(intPort);

             WorkItemManager objWiMgr = objKSession.getWorkItemManager();


          Regards.

          1 of 1 people found this helpful
          • 18. Re: jBPM straying after user task completed
            Shobhit Tyagi Master

            Well i create a new session.

             

            JPAKnowledgeService.newStatefulKnowledgeSession(.......).

             

            But if you wanna load a previous session,

            you could use

             

            JPAKnowledgeService.loadStatefulKnowledgeSession(........) (I dont remember the exact name of the method.. i think its the same.)

             

            Regards.

            • 19. Re: jBPM straying after user task completed
              Laura delli Paoli Master

              I know I should load teh session using the sessionId, but I don't know how to get the session id....

              • 20. Re: jBPM straying after user task completed
                Shobhit Tyagi Master

                Well I dont know if there is jBPM API for that, but what you can do is to have an external source to map the process instance id and the session id. May be in a file or a db table. Both process instance id and the session id you can get when you start the process.

                 

                Regards.

                • 21. Re: jBPM straying after user task completed
                  Thomas Setiabudi Expert

                  Hi Laura delli Paoli,

                   

                  If you use persistence, you can get the Session Id from the Task table, there is a field called processSessionId that stores the sessionId.

                   

                   

                  Regards,

                  Thomas Setiabudi

                  • 22. Re: jBPM straying after user task completed
                    Laura delli Paoli Master

                    ok, thanks

                     

                    I write this lines to complete workItem (before completing task):

                     

                    KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                    knowledgeBuilder.add(ResourceFactory.newFileResource(processPath), ResourceType.BPMN2);

                    KnowledgeBase knowledgeBase = knowledgeBuilder.newKnowledgeBase();

                    StatefulKnowledgeSession ksession = JBPMHelper.loadStatefulKnowledgeSession(knowledgeBase, sessionId);

                    ksession.getWorkItemManager().completeWorkItem(workItemId, null);

                     

                    13:04:01,349 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (Thread-66) HHH000299: Could not complete schema update: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown table 'sequences' in information_schema

                      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) [mysql-connector-java-5.0.8-bin.jar:]

                      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) [mysql-connector-java-5.0.8-bin.jar:]

                      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) [mysql-connector-java-5.0.8-bin.jar:]

                      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) [mysql-connector-java-5.0.8-bin.jar:]

                      at com.mysql.jdbc.Connection.execSQL(Connection.java:3277) [mysql-connector-java-5.0.8-bin.jar:]

                      at com.mysql.jdbc.Connection.execSQL(Connection.java:3206) [mysql-connector-java-5.0.8-bin.jar:]

                      at com.mysql.jdbc.Statement.executeQuery(Statement.java:1232) [mysql-connector-java-5.0.8-bin.jar:]

                      at org.jboss.jca.adapters.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:340)

                      at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:149) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:70) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:63) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:196) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:178) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:457) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                      at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                      at org.jbpm.test.JBPMHelper.loadStatefulKnowledgeSession(JBPMHelper.java:147) [jbpm-test-5.4.0.Final.jar:5.4.0.Final]

                      at eu.discoveryreply.applicationLayer.controller.Controller.completeWorkItem(Controller.java:145) [classes:]

                      at eu.discoveryreply.applicationLayer.controller.Controller.grantProcess(Controller.java:117) [classes:]

                      at eu.discoveryreply.applicationLayer.controller.Controller.run(Controller.java:67) [classes:]

                     

                     

                    13:04:01,883 WARN  [org.hibernate.ejb.internal.EntityManagerFactoryRegistry] (Thread-66) HHH000436: Entity manager factory name (org.jbpm.persistence.jpa) is already registered.  If entity manager will be clustered or passivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'

                    13:04:01,884 INFO  [bitronix.tm.BitronixTransactionManager] (Thread-66) Bitronix Transaction Manager version 2.1.2

                    13:04:01,889 ERROR [eu.discoveryreply.applicationLayer.controller.Controller] (Thread-66) Error while starting/stopping Controller.: bitronix.tm.utils.InitializationException: initialization failed, cannot safely start the transaction manager

                      at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:79) [btm-2.1.2.jar:2.1.2]

                      at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:62) [btm-2.1.2.jar:2.1.2]

                      at org.jbpm.test.JBPMHelper.createEnvironment(JBPMHelper.java:131) [jbpm-test-5.4.0.Final.jar:5.4.0.Final]

                      at org.jbpm.test.JBPMHelper.loadStatefulKnowledgeSession(JBPMHelper.java:149) [jbpm-test-5.4.0.Final.jar:5.4.0.Final]

                      at eu.discoveryreply.applicationLayer.controller.Controller.completeWorkItem(Controller.java:145) [classes:]

                      at eu.discoveryreply.applicationLayer.controller.Controller.grantProcess(Controller.java:117) [classes:]

                      at eu.discoveryreply.applicationLayer.controller.Controller.run(Controller.java:67) [classes:]

                    Caused by: java.nio.channels.OverlappingFileLockException

                      at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255) [rt.jar:1.7.0_19]

                      at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152) [rt.jar:1.7.0_19]

                      at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1017) [rt.jar:1.7.0_19]

                      at bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:70) [btm-2.1.2.jar:2.1.2]

                      at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:151) [btm-2.1.2.jar:2.1.2]

                      at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:62) [btm-2.1.2.jar:2.1.2]

                      ... 6 more

                     

                     

                    13:04:31,934 INFO  [eu.discoveryreply.applicationLayer.controller.Controller] (Thread-66) Selected process: 123

                    13:04:31,958 INFO  [eu.discoveryreply.applicationLayer.controller.Controller] (Thread-66) Task to Run: 121

                    13:04:31,959 INFO  [eu.discoveryreply.applicationLayer.controller.Controller] (Thread-66) SessionId: 133

                    13:04:32,044 ERROR [stderr] (Thread-65) org.jbpm.task.service.PermissionDeniedException: User '[User:'john']' was unable to execution operation 'Start' on task id 121 due to a no 'current status' match

                    13:04:32,046 ERROR [stderr] (Thread-65) at org.jbpm.task.service.TaskServiceSession.evalCommand(TaskServiceSession.java:311)

                    13:04:32,050 ERROR [stderr] (Thread-65) at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:426)

                    13:04:32,054 ERROR [stderr] (Thread-65) at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:90)

                    13:04:32,055 ERROR [stderr] (Thread-65) at org.jbpm.task.service.hornetq.HornetQTaskServerHandler.messageReceived(HornetQTaskServerHandler.java:43)

                    13:04:32,059 ERROR [stderr] (Thread-65) at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:104)

                    13:04:32,060 ERROR [stderr] (Thread-65) at java.lang.Thread.run(Thread.java:722)

                    13:04:32,060 ERROR [org.jbpm.task.service.TaskServerHandler] (Thread-65) User '[User:'john']' was unable to execution operation 'Start' on task id 121 due to a no 'current status' match: org.jbpm.task.service.PermissionDeniedException: User '[User:'john']' was unable to execution operation 'Start' on task id 121 due to a no 'current status' match

                      at org.jbpm.task.service.TaskServiceSession.evalCommand(TaskServiceSession.java:311) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]

                      at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:426) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]

                      at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:90) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]

                      at org.jbpm.task.service.hornetq.HornetQTaskServerHandler.messageReceived(HornetQTaskServerHandler.java:43) [jbpm-human-task-hornetq-5.4.0.Final.jar:5.4.0.Final]

                      at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:104) [jbpm-human-task-hornetq-5.4.0.Final.jar:5.4.0.Final]

                      at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_19]

                    • 23. Re: jBPM straying after user task completed
                      Ashish T Newbie

                      Is this issues faced using the same sample initially provided by you?

                      It seems that you are using hornetq as a HT engine but it should not be a problem.

                      I  think the task is not getting claimed by user.   There are possible reasons for it.

                       

                      One of them beging you somehow creating multiple entity manager.

                       

                      Also refer link https://community.jboss.org/thread/197824

                      • 24. Re: jBPM straying after user task completed
                        Laura delli Paoli Master

                        No I don't create any entity manager there. I only create an entity manager when launching the jBPM process.

                        • 25. Re: jBPM straying after user task completed
                          Ashish T Newbie

                          We faced similar issue in our application. we were claiming the task and completing it immediately.  Here I believe by the time JBPM engine was notifying HT server about claiming the task we were issuing task complete  command to JBPM engine. That was our analysis as in real scenario user  should first  claim the task then work on it  and then complete the task.

                          • 26. Re: jBPM straying after user task completed
                            Laura delli Paoli Master

                            Im my application this problem happens only sometimes, what about your case??

                            • 27. Re: jBPM straying after user task completed
                              Laura delli Paoli Master

                              I cannot claim the task before starting it, likely because my taks is already reserved to user john...

                               

                              15:02:12,792 ERROR [stderr] (Thread-65) org.jbpm.task.service.PermissionDeniedException: User '[User:'john']' was unable to execution operation 'Claim' on task id 123 due to a no 'current status' match

                              15:02:12,793 ERROR [stderr] (Thread-65)           at org.jbpm.task.service.TaskServiceSession.evalCommand(TaskServiceSession.java:311)

                              15:02:12,793 ERROR [stderr] (Thread-65)           at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:426)

                              15:02:12,794 ERROR [stderr] (Thread-65)           at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:90)

                              15:02:12,795 ERROR [stderr] (Thread-65)           at org.jbpm.task.service.hornetq.HornetQTaskServerHandler.messageReceived(HornetQTaskServerHandler.java:43)

                              15:02:12,795 ERROR [stderr] (Thread-65)           at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:104)

                              15:02:12,796 ERROR [stderr] (Thread-65)           at java.lang.Thread.run(Thread.java:722)

                              15:02:12,796 ERROR [org.jbpm.task.service.TaskServerHandler] (Thread-65) User '[User:'john']' was unable to execution operation 'Claim' on task id 123 due to a no 'current status' match: org.jbpm.task.service.PermissionDeniedException: User '[User:'john']' was unable to execution operation 'Claim' on task id 123 due to a no 'current status' match

                                        at org.jbpm.task.service.TaskServiceSession.evalCommand(TaskServiceSession.java:311) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]

                                        at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:426) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]

                                        at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:90) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]

                                        at org.jbpm.task.service.hornetq.HornetQTaskServerHandler.messageReceived(HornetQTaskServerHandler.java:43) [jbpm-human-task-hornetq-5.4.0.Final.jar:5.4.0.Final]

                                        at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:104) [jbpm-human-task-hornetq-5.4.0.Final.jar:5.4.0.Final]

                                        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_19]

                               

                               

                              15:02:32,730 INFO  [eu.discoveryreply.applicationLayer.controller.Controller] (Thread-66) eu.discoveryreply.commons.data.MCFTask@264d5d94 > task claimed

                              15:02:32,745 INFO  [eu.discoveryreply.applicationLayer.controller.Controller] (Thread-66) Task 123 is not "InProgress" yet! It is still in Status Reserved

                              • 28. Re: jBPM straying after user task completed
                                Laura delli Paoli Master

                                UPDATE:

                                On process blocks workitem entry is not deleted from workiteminfo table

                                • 29. Re: jBPM straying after user task completed
                                  Maulee Parikh Newbie

                                  Hi,

                                   

                                  I am facing the same issue in jbpm 5.3. Workitem info is not updated and process is not able to continue. Is claiming the task and completing  it immediately can cause issue ?