1 Reply Latest reply on Jul 17, 2007 4:45 AM by harpritt k

    Debug.seam page, the Business process context and data bindi

    harpritt k Novice

      Hi

      The following class aims starts a conversation that goes on to start a business process,

      Im trying to bind the crId String to the Business process that is created on SubmitTicket().... to test that this is happening i am using the debug.seam page while on a page within the business process.

      in the Debug.seam page.....Ive noticed that the Business Process Context is empty no reference to the String nor the business process.. is this correct?

      Many thanks

      Extra information.... the reason im bind the crID to the BP is so that i can use it later to load the related changeRequest oject from hibernate using the @Create annotation......

      
      @Stateful
      @Name("createChangeRequest")
      public class CreateChangeRequestAction implements CreateChangeRequest {
      
       //@In(required = false)
       //@Out(scope = BUSINESS_PROCESS, required = false)
       //ChangeRequest changerequest;
      
      
       @In(required = false)
       @Out(scope = BUSINESS_PROCESS, required = false)
       String crId;
      
       @In(required = false)
       GsmsMetaData gsmsMetaData;
      
       @In(required = false)
       NewGSMSData newGsmsData;
      
       @In(required = false)
       RequestState requestState;
      
       @In(required = false)
       RequestReference requestReference;
      
       @In
       Login login;
      
      
       @Begin
       public String newTicket() {
       if (changerequest.getCrAction().equals("EDIT")) {
       return "editdoc";
       }
       if (changerequest.getCrAction().equals("NEW")) {
       return "newdoc";
       }
       if (changerequest.getCrAction().equals("MOVE")) {
       return "movedoc";
       }
       if (changerequest.getCrAction().equals("DELETE")) {
       return "deletedoc";
       }
       if (changerequest.getCrAction().equals("OTHER")) {
       return "other";
       }
       //throw exception
       return "home";
       }
      
       @End
       @CreateProcess(definition = "changerequestprocess")
       public String submitTicket() {
      
      
       changerequest.setCrEditor(login.getUser().getUsername());
      
       getChangeRequestDAO().saveCr(changerequest);
      
       crId = "Dude";
       return "home";
      
       }
      
      
      
      
       @Remove
       @Destroy
       public void destroy() {
       }
      
      }
      


        • 1. Re: Debug.seam page, the Business process context and data b
          harpritt k Novice

          Update: My first query about the empty business process context within the debug page has been poo poo'd, i had to click into the conversation id to see the business process context components.... so thats all cool.

          .... .my only thing now is that the string stored in the Business Process Context does not seem to get injected before the @Create annotated method is called.... even though in the JBoss Seam book Simplicity and Power beyond Java EE its states P93

          "The class constructor is called before the component is object is created while the @Create is called after class creation. The contructor would not have access to Seam injected objects such as the EntityManager"

          
           @In(required = false)
           @Out(scope = BUSINESS_PROCESS, required = false)
           String crId
          
          ....
          
          .....
          
          
          
          
          @Create
           public void find(){
           System.out.println(crId + " the create works");
           }
          



          Cheers for any pointers