2 Replies Latest reply on Feb 28, 2007 4:33 PM by ngeadah

    JBPM Context variable lifecycle

      I use the Seam annotations to launch a JBPM process and outject to the BUSINESS_PROCESS context. Everything works great but I find that the outjected variable gets "removed" from JBPM at some indeterminate later time. For example, after the process has been launched (and is in a wait-state), the following code which retrieves the task instances for the current actor and tries to retrieve the variable initially outjected:

      List<TaskInstance> tasks = context.getTaskMgmtSession().findTaskInstances(actorId);
      for (TaskInstance task : tasks)
      {
       Object variable = task.getVariable("NAME USED TO OUTJECT");
      


      returns "variable" correctly as long I this code runs shortly after the process is launched. After a little while, "variable" is null. I was able to dertmine that my variable starts off looking just fine in JBPM_VARIABLEINSTANCE, but after a while, the row representing this variable is updated WITHOUT a TOKEN_ or PROCESSINSTANCE_ (those two fields, along with a few others become null).

      Are there any explanations as to why a variable instance would get updated without an associated process instance?


        • 1. Re: JBPM Context variable lifecycle
          kukeltje

          I saw you posted this in the seam forum as well. The discussion should be done at least at one place (crossposting is not handy) and since it is (imo) more closely related to how seam is using jbpm than a jbpm core issue. I might be wrong but we should at least discuss it in one place.

          (I think btw it could be related to not saving the processinstance (e.g. because a transaction is not ended) but that is just guessing... A debug trace would be handy, but analyse it first please and do not post it completely)

          • 2. Re: JBPM Context variable lifecycle

            Right on kukeltje; sorry about the crosspost.

            Instead of using the Seam ManagedJbpmContext and outjection to the business process scope, I used the good-old JBPM API to launch my process and set context variables manually. Since then, I have not been able to reproduce.