10 Replies Latest reply on Mar 19, 2008 4:22 PM by Olivier Thierry

    Seam, web services and business process context

    Olivier Thierry Apprentice


      I created a Seam component as an EJB3 stateless session bean. This component has a method that puts variables in the business process context and starts the business process. The name of the business process is dynamic, so I could not use @Out or @CreateProcess annotations (maybe I am wrong about this ?). So I injected businessProcess component this way :

      @org.jboss.seam.annotations.In(create = true)
      protected org.jboss.seam.bpm.BusinessProcess businessProcess;

      Then my method works this way :

      Context context = Contexts.getBusinessProcessContext();
      context.set("demandeAbsence", demande);
      context.set("codeProcessus", processus.getCode());

      It works perfect when using this Seam component from another Seam component.

      Now I want this Seam component to be exposed as a web service. So I added the following annotations to the class :

           endpointInterface = "fr.mycompany.t4.module.commons.absences.ServiceAbsenceWSInterface",
           serviceName = "ServiceAbsenceBean")
           contextRoot = "/t4-module-commons-ws", 

      But it doesn't work. The method is called but businessProcess variable is not injected (null) and context variable is null. Anybody has an idea what I did wrong ? Is it possible to use built-in Seam components in a Seam component exposed as a web service ?

      Thanks in advance ;)