0 Replies Latest reply on Aug 21, 2006 8:46 AM by mlsreekanth

    How to set a variable to a taskInstance

    mlsreekanth Newbie

      Hello all,

      I a trying to set a variable to a taskInstance where that variable is declared as required in the taskcontroller of the process.

      When i created this variable as Outjected and BUSINESS_PROCESS scoped, it is not being updated by an assignment rather than the initialization.

      But when i use the TaskInstance instance and set variable , it is being set.

      I am pasting the twi implementations, please help me

      //OUTJECTION

      Decision Variable has setters and getters where these being set from a Form

      @Out(scope=ScopeType.BUSINESS_PROCESS,value="decision",required=true)
      String decision="Accepted";

      @EndTask(transition="ReviewCompleted")
      public String approve() {
      System.out.println(" It is Decided to " + decision);
      return "registrationslist";
      }

      //USING DIRECT TASK INSTANCE
      Decision Variable has setters and getters where these being set from a Form

      String decision="Accepted";


      @EndTask(transition="ReviewCompleted")
      public String approve() {
      System.out.println(" It is Decided to " + decision);
      taskInstance.setVariable("decision", decision);
      taskInstance.addComment("Comment is added in reviewcompleted transion");

      return "registrationslist";
      }