1 Reply Latest reply on Nov 21, 2009 12:28 AM by Shervin Asgari

    Jbpm action is called infinitly

    Alexander Müller Newbie

      Hello everyone,


      I've got a problem while developing a jbpm business process that has to wait until a specified time and execute an action.
      Everything works as expected while not using outjection on a variable. If outjection is activated through the @Out annotation
      the action method gets called infinitly.


      ----- The Process ------



      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="sellingProcess">
      <start-state name="new selling">
           <transition to="wait auction"></transition>
      </start-state>
      <state name="wait auction">
              <timer name="waitAuctionTimer" duedate="1 minute" transition="interuptWaitAuction">               
                <action expression="#{sellingManager.startAuctioning}"/>                              
           </timer>
           <transition to="wait selling" name="interuptWaitAuction"/>
           <transition to="end invalid selling" name="interuptFailedWaitAuction"></transition>
      </state>
      
      <state name="wait selling">
      </state>
           
      <end-state name="end invalid selling"/>
       



      ----- The Component -----


      @Name("sellingManager")
      @AutoCreate
      public class SellingManagerBean implements SellingManager {
      //     @Out(scope=ScopeType.BUSINESS_PROCESS, required=false)
           @In(scope=ScopeType.BUSINESS_PROCESS, required=false)
           Selling selling;
           
           @Transactional
           public String startAuctioning() {
                if( selling.getEbayItemId() == null && selling.getEbayItemLink() == null ) {
                     String itemId = ebayDriver.addItem(selling);
                     selling.setEbayItemId(itemId);
                     selling.setEbayItemLink(buildEbayItemUrl(itemId, ebayDriver.getEbayModuleConfiguration().isProduction()));
                     return itemId;
                }
                return null;
           }
      }
      
      



      If @Out(scope=ScopeType.BUSINESS_PROCESS, required=false) is active, the startAuctioning method is called infinitly.


      I'm using Seam 2.2.0 GA, Jboss5 and Jbpm 3.2.6SP1


      Anyone an idea?


      Greetings,


      Alexander Müller

        • 1. Re: Jbpm action is called infinitly
          Shervin Asgari Master

          I believe there is a bug with outjection on business process scope with seam.
          We had to implement a workaround in our application for this behaviour.
          I can't remember what the bug was, or if it is applicable for your situation, but
          basically what we are doing is outjecting the value directly to the business context.


          taskInstance.getProcessInstance().getContextInstance().set("selling",selling)



          Now you can from your java or xhtml page inject and use the value either with


          @In(scope=ScopeType.BUSINESS_PROCESS)
           private Selling selling;
          //or directly from EL #{selling}



          Hope this helps.