0 Replies Latest reply on Feb 2, 2009 5:37 PM by Val Sw

    Suggestion on Events.instance().raiseAsynchronousEvent, Observer not called

    Val Sw Expert
      I am trying to invoke a function using "Events.instance().raiseAsynchronousEvent", Observer works fine for persist, update.
      I tried as per my post :
      http://www.seamframework.org/Community/BestProcessForCallingAnotherApplicationFromSeamApplication#comment60582

      BUT as per requirement, I am providing link which calls quantExperimentHome.generateAnalysisDataset(), console output ONLY prints
      "QuantExperimentHome.generateData(), ENTERED " and externalApplicationInvoker.doStuff() is not invoked.

      I am doing something wrong :(, please suggest....

      XHTML :
      -------
      <s:link id="generateData"
           value="Generate data"
           action="#{quantExperimentHome.generateData}">          
      </s:link>

      @Name("quantExperimentHome")
      public class QuantExperimentHome extends EntityHome<QuantExperiment> {

           public String generateData(){
                System.out.println("QuantExperimentHome.generateData(), ENTERED ");
                Events.instance().raiseAsynchronousEvent("generateData","arg1", "arg2");
                return "generateData";
           }
      }


      @Name("externalApplicationInvoker")
      @Scope(ScopeType.STATELESS)
      public class ExternalApplicationInvoker
      {
         @Observer("generateData")
         @Transactional
         public void doStuff(String qType, String qHjid)
         {    
                System.out.println("ExternalApplicationInvoker.doStuff(), ENTERED  TEST");// THIS IS NOT INVOKED
                //call external application
         }

         @Observer("org.jboss.seam.afterTransactionSuccess.QuantExperiment")
         public void experimentSavedOrUpdated()
         {
            //THIS WORKS FINE     
            //call external application
         }     
      }