2 Replies Latest reply on Jul 24, 2007 10:57 AM by Alex Ka

    jboss seam bijection problem

    parag talekar Newbie

      jboss seam 1.2.1

      I am having trouble understanding how bijection work with jbpm. Here is a simple jpdl:

      <process-definition name="MyWorkflow">
      
       <start-state name="start">
       <transition to="decide"></transition>
       </start-state>
      
       <decision name="decide" expression="#{myManager.result}">
       <transition to="assigntask" name="assigntask"></transition>
       <transition to="end" name="end"></transition>
       </decision>
      
       <task-node name="assigntask">
       <task name="Evaluate">
       <assignment actor-id="adminuser"></assignment>
       </task>
       <transition to="end" name="cancel"></transition>
       <transition to="decide" name="retry"></transition>
       </task-node>
      
       <end-state name="end"></end-state>
      
      </process-definition>
      


      Notice that the decision task calls #{myManager.decide} which a SFSB:
      @Stateful
      @Name ("myManager")
      public class MyManagerImpl implements MyManager,
       Serializable {
      
       private static final long serialVersionUID = 1L;
      
       @Logger
       private Log LOG;
      
       @PersistenceContext (type = PersistenceContextType.EXTENDED)
       private EntityManager entityManager;
      
       @In (required = false)
       @Out (scope = BUSINESS_PROCESS, required = true)
       private Long id;
      
       @CreateProcess(definition = "MyWorkflow")
       public void begin() {
       id = new Long(10);
       }
      
       public String getResult() {
       // NPE :-(
       // why doesnt id get injected?
       int x = id.intValue();
       }
      
       @Remove
       @Destroy
       public void destroy() {
       }
      }
      


      I get a NPE in getResult() when it is called by jBPM. How come id never gets injected back?

      I set logging to TRACE on org.jboss.seam.Component and I get the "injecting dependencies of" message when begin() is called. But I DONT see the same messages when the jBPM task node executes the getResult() expression.

      Am I missing something in a config file?

      Thanks in advance.