7 Replies Latest reply on Mar 18, 2008 3:32 PM by Jesse Driver

    JbpmException: couldn't delete timers for process instance

    Jesse Driver Newbie

      I have a very straightforward jBPM prototype where I am using hibernate,and tomcat abd SQL Server database.

      I get this error sometimes on the second invocation of the same ActionHandler within a graph. I'm just prototyping now. My action handler just makes an update to a text field in the database depending on the object that is passed into the aciton handler.

      I'm reading about timers and right now I am not using a timer in the prototype. I'd almost like to disable them or do something within the action handler to make sure they are not causing this exception do I can continue with the developmetn of my prototype.

      The exception comes after the third processInstance.signal() that would take the process to transition to the thrird node in the graph (counting the start node).

      The graph is below:
      public static ProcessDefinition getTaskProcessDefinition() {
      JbpmConfiguration jbpmConfiguration = null;
      ProcessDefinition processDefinition = null;

      try{
      processDefinition =
      ProcessDefinition.parseXmlString("<process-definition name='processManualTask'>"
      + " <start-state name='start'>"
      + " "
      + " </start-state>"
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " "
      + " <end-state name='End' />"
      + "</process-definition>");
      } catch(Exception e) {e.printStackTrace();
      }
      try{
      HttpSession sess = FrameworkServices.instance().getSession();
      JbpmContext jbpmContext = (JbpmContext) sess.getAttribute("jbpmctx");
      if (jbpmContext == null) {
      jbpmConfiguration = JbpmConfiguration.getInstance();
      jbpmContext = jbpmConfiguration.createJbpmContext();
      sess.setAttribute("jbpmctx", jbpmContext);
      }
      System.out.println("saving process instance");
      ProcessDefinition definition = processDefinition.createNewProcessDefinition();
      ProcessInstance processInstance = definition.createProcessInstance();
      jbpmContext.save(processInstance);
      Session session = (Session) sess.getAttribute("hibsess");
      session.flush();

      System.out.println("process instance saved!!!!");

      }catch(Exception e) {e.printStackTrace();
      }


      return processDefinition;
      }

        • 1. Re: JbpmException: couldn't delete timers for process instan
          Ronald van Kuijk Master

          please use [ c o d e ] tags (without the spaces while posting

          • 2. Re: JbpmException: couldn't delete timers for process instan
            Jesse Driver Newbie

            I will make a note to use tags in the future. It chopped all the process flow xml from my previous post.

            My main concern is that we have prototyped a flow and created the process flow definition in XML. It was a very simple flow with 4 nodes including start and end. It works fine if you call the Action Handler in the 2nd, 3rd, or 4th node. But if you try toi call the ActionHandler more than once in the flow, I get an exception onj the 2nd execution.

            My quesiton is can you call the same Action Handler more than once in the process definition/instance? If so, what kinds of clean-up do I need to be sure to do? Do I need to clean up the executionContext? Close the JbpmContext?

            The second execution seems to envcounter a lock on the token. Please explain and especially provide example code.

            Thanks in advance!

            • 3. Re: JbpmException: couldn't delete timers for process instan
              Ronald van Kuijk Master

              please.... you do not post any actionhandler code, processdefinition, how you use the engine or whatever, but expect *us* to provide some explanation or even example code. That is very hard and timeconsuming for us.

              I do not want to offend you, but look at jbpm testcases. Lots of 'examples' in there, including using actionhandlers.

              • 4. Re: JbpmException: couldn't delete timers for process instan
                Jesse Driver Newbie

                Yes, but will you please try to answer the question. You seem to regard yourself as an expert. The simple question was:

                Can you run the same action handler twice within the same process instance execution?

                This is a yes or no quesiton and involves no code samples.

                I am somewhat offended by your remarks and that you have provided no useful information, and asked for no additional information. If there is an example code showing the same action handler being called twice by the same process instance I have not encountered this yet, but would like to know if such an example exists. I have spent considerable time on the documentation. If you cannot provide anything useful please occupy yourself in other ways instead of berating users who have asked reasnable questions.

                • 5. Re: JbpmException: couldn't delete timers for process instan
                  Ronald van Kuijk Master

                  if that is the only question, then that seems totally unrelated to the topic and thus belong in a new one.

                  The yes/no what not the only thing you you asked (from my understanding) and thus not just what I anwserd.

                  Regarding you feeling offended, that is up to you. My experience is that in a lot of cases people (users) do something wrong in either the processdefinition or their actionhandlers. That is the reason I (indirectly) asked for more information *twice*. The reason I did this was to help *you* since I suspect (again from my experience as an 'expert' in this forum) that a simple yes or no would not suffice in your situation. What I could have told you (as I do in a lot of cases) was to just make a minimal unit test with embedded processdefinition and actionhandlers (as innerclasses) which demonstrates the problem. This would have been another way of formulating it, sorry that I did not do that.

                  Besides all this. I did provide useful information (in my very humble opinion) by referring to the testcases (which in our (not only mine, but the devs to) can and should be seen as part of the 'documentation'). If you had

                  I surely can occupy myself in other ways and preferably do so, but berating is high on my list. Cool btw using such a word... thankfully there is the internet to search for words hardly known to non-native English speakers.

                  be-rate
                  tr.v. be-rat-ed, be-rat-ing, be-rates
                  To rebuke or scold angrily and at length.


                  Rebuke? Hmmm... maybe (but that is in the eye of the beholder) luckily I knew that word, otherwise I had to lookup an additional word
                  Angrily? hmm... no...a little irritated... maybe
                  At length? Certainly not....

                  Hint: http://catb.org/~esr/faqs/smart-questions.html (and please do not take it as an offence)





                  • 6. Re: JbpmException: couldn't delete timers for process instan
                    Ronald van Kuijk Master

                    Oh... and my answer would have been 'yes'... would that help you in any way?

                    • 7. Re: JbpmException: couldn't delete timers for process instan
                      Jesse Driver Newbie

                      Thanks for the advice to look at the code examples in the test cases. This has been very helpful advice.