4 Replies Latest reply on Jan 16, 2008 12:49 PM by kukeltje

    Signal Error

    mattowens

      Could anyone please explain why this code throws the following exception: "closed JbpmContext in different order then they were created... check your try-finally's around JbpmContexts blocks".

      Code:

      public JbpmProcessInstance(JbpmProcessDefinition processDef, bpmProcessInstanceVar var)
      {
      beginSessionTransaction();
      try
      {
      ProcessDefinition processDefinition = jbpmContext.getGraphSession().loadProcessDefinition(processDef.getId());

      // create a new process instance to run
      processInstance = new ProcessInstance (processDefinition);

      if(var!=null)
      addProcessInstanceVar(var);

      processInstance.signal();
      }
      catch (Exception e)
      {
      log.error(e.getMessage());
      throw new JBPMException(e.getMessage(),e);
      }
      finally
      {
      commitAndCloseSession();
      }
      }

      The error is thrown on the signal() line. I have tried to find a reason for this for a number of days and as a result of not being able to am now loooking at other workflow solutions. could someeone please point me in the direction of an explaination so i can continue using JBPM?

      Thanks

        • 1. Re: Signal Error
          scitmon

          JBPM signalling doesn't work. I tried to decorate JBPM objects into more manageable strcture but the context kept going out of skope or reporting invalid creatiun states. I think this will going to be fixed in the next release.

          • 2. Re: Signal Error
            kukeltje

            @scitmon: why do you come to this conclusion?

            • 3. Re: Signal Error
              scitmon

               

              "kukeltje" wrote:
              @scitmon: why do you come to this conclusion?



              because i have tried many different ways to get JBPM working and signalling always causes error with the following text "closed JbpmContext in different order then they were created... check your try-finally's around JbpmContexts blocks". The CVS tests don't seem to work either. There is no help files they explain how to do this.

              • 4. Re: Signal Error
                kukeltje

                CVS tests don't work? You mean the jbpm unit tests? They work for me and I only have had this error when things were not programmed correctly or the transaction configuration was not ok. So jBPM signalling *does* work.

                We need a more specific and isolated example, including transaction config, hibernate config jbpm config, good code etc... to be able to help. Just a statement like 'jbpm signalling does not work' does not help, including 'tried many different ways'. I've used it in two different ways and did not get this error....