AnsweredAssumed Answered

Not able to get task form propery values in TaskListner

Question asked by bhupendra1 on Sep 16, 2012
Latest reply on Sep 18, 2012 by bhupendra1
Hi,

I am using Activiti 5.10 version. I have user task defined with form.
I want to capture the task from values in my task listner associated with this task, so that i can save those values in database.
I am using below code to get the task form property values.
(User is providing inputs to the fields in task and then on completion of task , task listener is invoked.)
This is returning correct names of the task form properties but it is returning the values as null. Please suggest. Thanks!

   public void notify(DelegateTask task) {
      ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

            FormService formservice=processEngine.getFormService();
   
         System.out.println("Task Id : " + task.getId());
      System.out.println("Process def Id : " + task.getProcessDefinitionId());
   
      
      TaskFormData   taskFormdata  =formservice.getTaskFormData(task.getId());
      List<FormProperty> formList= taskFormdata.getFormProperties();
      for(int i=0;i<formList.size();i++){
         
         System.out.println( "Name: "  + formList.get(i).getName() +" Value is " + formList.get(i).getValue());
      }
      
   }

Outcomes