0 Replies Latest reply on Jan 7, 2013 6:34 AM by nsharm28

    How to get content of task with Reserved and Completed state in JBPM5.4

    nsharm28

      Hi,

       

      Currently I am reteriving the task content using following methods

       

       

      -Following method reterives content of task which are in 'Completed' status

       

      public Object getContent(long taskId)

          {

       

                    Task task = taskService.getTask(taskId);

                          TaskData taskData = task.getTaskData();

                          Content content =taskService.getContent(taskData.getDocumentContentId());

                    ByteArrayInputStream bais = new ByteArrayInputStream(content.getContent());

                          ObjectInputStream ois;

                          Object taskinfo = null;

                          try {

                              ois = new ObjectInputStream(bais);

                              taskinfo = ois.readObject();

                          } catch (Exception e) {

                              e.printStackTrace();

                          }

                                    return taskinfo;   

                    }

       

      -Following method reterives content of task which are in 'Reserved' status

       

      public Object getContentNew(long taskId) {

               Task task= taskService.getTask(taskId);

               Object  input=null;

                    long contentId = task.getTaskData().getDocumentContentId();

              if (contentId != -1) {

                        Content content   = taskService.getContent(contentId);

                        input = ContentMarshallerHelper.unmarshall(content.getContent(), null);

              }

              System.out.println(input);

              return input;

          }

       

       

      Is there any single method or way to reterive the content of task for both Completed and Reserved status??