6 Replies Latest reply on Dec 18, 2012 8:01 PM by thomas.setiabudi

    jbpm 5.3 after restart server not be created next task

    franco80

      Hello

       

      always after restart server not be created next task, workiteminfo (with "Human task") is empty for processinstanceid, variableinstancelog were not added after completing the task too.

      But if the server is not restarted the process works correctly mean task is created and all others.

       

      additional info: I don't use the console, this is my application. Mistake occurs during complete task, new task isn't created when I stop jboss server after start task (Ready, InProgress).
      I'm using jpa. I have two servlets which are starts when server start (but session - StatefulKnowledgeSession always is creating new).

       

      What could be the reason ?

       

      the same situation is with timers, after restart server all timers are 'dead'

       

      regards

        • 1. Re: jbpm 5.3 after restart server not be created next task
          thomas.setiabudi

          Hi Franco80,

           

          I think your problem may be similar with this issue here

          https://issues.jboss.org/browse/JBPM-3673

           

          The problem is, after you restart the server, there is no component listening to the task completed event broadcasted by Human Task Service.

           

           

          Regards,

          Thomas Setiabudi

          1 of 1 people found this helpful
          • 2. Re: jbpm 5.3 after restart server not be created next task
            franco80

            Does it mean that there is a solution or not ? I ask
            because in link https://issues.jboss.org/browse/JBPM-3673 solution will be in jbpm 6, but I found https://community.jboss.org/message/583571

            and there Mauricio Salatino wrote "If your server goes down, you only need to recreate the session and register all the workItemhandlers, globals and the human task handler (special type of workitem) in order to your process continue working."

             

            Recreating session, ok, I have now one global session, but how to register all the workItemHandlers ? some examples ?

             

            regards

            • 3. Re: jbpm 5.3 after restart server not be created next task
              thomas.setiabudi

              Hi Franco80,

               

              Not sure how this will work on your environment, but for me, since I use jbpm-console to start my processes this is what I do as a workaround:

               

              After a server restart, make sure that the first thing that I do is start or execute a new process instance where the process will create a human task after it is created. Usually I execute the Evaluation process sample. After that the Human Task WorkItemHandler will be ready to listen to any task completed events emitted by human task service.

               

               

              Regards,

              Thomas Setiabudi

              • 4. Re: jbpm 5.3 after restart server not be created next task
                franco80

                Hi Thomas

                 

                I think I have a little different situation:  but I'll try your way.

                 


                The first time process is created and task is started and completed (in one method), and now, for example: stop the server, the server starts again, the next task started, and the next step task  is complete. Now I don't have next task, workiteminfo was deleted in last operation (complete).

                 

                I have servlet with init work item handler for new session (question or new session or load always one session, is the difference? or maybe without this servlet and register workitemhandler when process is starting  as you write if I understand ...) :

                 

                 

                UserTransaction ut = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");

                ut.begin();

                 

                StatefulKnowledgeSession session = JbpmAPIUtil.getExistingSession(37);

                JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(session);

                CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(session);

                taskHandler.connect();

                session.getWorkItemManager().registerWorkItemHandler(HUMAN_TASK_NAME,taskHandler);

                 

                ut.commit();

                logger.dispose();

                 

                ... by the way how to register all the workItemhandlers, globals and the human task handler in order to process continue working ?

                 

                regards

                • 5. Re: jbpm 5.3 after restart server not be created next task
                  franco80

                  solution is in https://community.jboss.org/thread/205435?decorator=print&displayFullThread=true

                   

                  "When I changed in date fields mapping from DATE to TIMESTAMP, all process instances are executed properly after server restart."

                   

                  now it works properly

                   

                  regards

                  • 6. Re: jbpm 5.3 after restart server not be created next task
                    thomas.setiabudi

                    Great to hear that it is solved

                     

                    I just realized that you use jBPM5.3,

                    I checked the jBPM5.4 and it seems that this DATE to TIMESTAMP fix has been applied to the default jBPM5.4

                     

                     

                    Regards,

                    Thomas Setiabudi