3 Replies Latest reply on Oct 7, 2007 4:35 AM by Johannes Stelzer

    Business process injection doesn't work in a Seam component

    Olivier Thierry Apprentice

      Hi,

      I have a problem using JBpm with Seam.
      I modeled a process with nodes and binded actions to these nodes. But the injection of business process variables or processInstance in Seam component does not work when running these actions. I don't have the problem if the token did not go through a task-node before (ie a business process with no human action). I guess it deals with a context problem, but I can't understand what the problem exactly is.

      For example, I modeled my node this way :

      <node name="Acceptation">
       <transition to="End" />
       <action expression="#{demandeAbsenceAction.demandeAcceptee}" />
      </node>


      I have a first Seam component (conversation scope) which creates the process instance this way :

      @org.jboss.seam.annotations.bpm.CreateProcess(definition = "validationDemandeAbsence")
      @org.jboss.seam.annotations.End
      public void valider()
      {}


      It also outjects idDemandeAbsence variable in the business process :

      @org.jboss.seam.annotations.Out(required = false, scope = org.jboss.seam.ScopeType.BUSINESS_PROCESS)
      protected java.lang.Long idDemandeAbsence;


      I had a look in the JBPM tables and this outjection works well.

      I have another Seam component (conversation scope too) which contains methods binded to JPDL nodes. It injects processInstance and idDemandeAbsence variables this way :

      @org.jboss.seam.annotations.In(create = true)
      protected org.jbpm.graph.exe.ProcessInstance processInstance;
      
      @org.jboss.seam.annotations.In(value = "idDemandeAbsence", scope = org.jboss.seam.ScopeType.BUSINESS_PROCESS)
      protected java.lang.Long idDemandeAbsence;


      And of course it declares the action method binded to JPDL node (no annotation on this method, should there be some ?) :

      public void demandeAcceptee()
      {}


      But idDemandeAbsence and processInstance variables are alway null. Do I use JBpm and Seam the right way ? I work on this problem for several days, so any help will be greatly appreciated ;)