0 Replies Latest reply on Nov 24, 2010 5:45 AM by Sergei Degtyarev

    Seam 2.2.0.GA: Bijection and BusinessProcess Interceptors

    Sergei Degtyarev Newbie

      Hello!
      i have some problem with jbmp process in seam.
      Main process definition:



      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition xmlns="urn:jbpm.org:jpdl-3.2"
           name="simple">
           
           <start-state name="start">
                <transition name="to task" to="some task" />
           </start-state>
           
           <task-node name="some task">
                <task name="HumanTask">
                     <assignment actor-id="#{creator}"></assignment>
                </task>
                <transition to="Some subprocess"></transition>
           </task-node>
      
           <process-state name="Some subprocess">
                <sub-process name="subprocess" binding="late"/>
                <variable access="read,write" name="neededVariable"
                     mapped-name="variable"></variable>
                <transition to="end" name="to_end">
                     <action></action>
                </transition>
           </process-state>
           <end-state name="end"></end-state>
      </process-definition>
      




      Sub process definition:




      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="subprocess">
      
      
           <start-state name="start">
                <transition to="Human task"></transition>
                <event type="node-leave">
                     <script>System.out.println(executionContext.getVariable("variable"));</script>
                </event>
           </start-state>
      
           <task-node name="Human task">
                <task name="subHumanTask"></task>
                <transition to="end"></transition>
           </task-node>
      
           <end-state name="end"></end-state>
      </process-definition>



      In task-node 'some task' we need to create and set into process a variable, which is needed for subprocess.


      In java code it looks like this:




      @Out(required = false, scope = ScopeType.BUSINESS_PROCESS, value = "neededVariable")
      private String someString;
      
      @EndTask
      public void endHumanTask(){
        someString = "some value for SubProcess";
      }



      There is a problem.





      • 1. BijectionIntercepter fills up BisinessProcessContext




      • 2. BusinessProcess executes endTask, and process goes to executions (neededVariable doesn't exists in jBpm process, only in BisinessProcessContext)




      • 3. After that interceptor flushes a variable from BisinessProcessContext to jBpm ContextInstance of current process



      Is it common seam behaviour when seam works with subProcess/nonhuman task?