0 Replies Latest reply on Sep 26, 2009 3:16 PM by Vasilii Lukoyanov

    Multiple Jbpm processes problem

    Vasilii Lukoyanov Newbie

      Hi.


      I don't know whether it's a bug or a feature. I'm trying to start multiple JBPM processes with parameters. The problem is that the parameters weren't not saved for the last process.


      More precisely:
      Action:


          
          @In(value = "bpmInitializer", create = true)
          private BpmInitializer _bpm;
      ...
          @End
          public String confirm() {
      
              for (GeneralPlanItem gpi: _plan.getInstance().getItems()) {
                  for (Course c: gpi.getCourseContent().getCourses()) {
                      _bpm.startCourseConfirmation(c.getId());
                  }
              }
      }




      BpmInitializer.java:



      @Name("bpmInitializer")
      @Scope(ScopeType.EVENT)
      public class BpmInitializer {
      
          @Logger
          private Log _log;
      
          public void startCourseConfirmation(Long aId) {
              _log.info("planId={0}", aId);
              Contexts.getBusinessProcessContext().set("planId", aId);
              BusinessProcess.instance().createProcess("coursePlan-confirmation");
          }
      }



      All started processes except the last one have planId variables bound to them. I checked the jbpm database, jbpmvariableinstance table and the last record have several empty columns (token, tokenvariablemap, processinstance).


      I also tried @Createprocess annotation, but behaviour was the same.
      Please, tell me how to alter BpmInitializer to make it work properly.