[jboss-user] [jBPM] - How to get content of task with Reserved and Completed state in JBPM5.4

neeraj sharma do-not-reply at jboss.com
Mon Jan 7 06:35:10 EST 2013


neeraj sharma [https://community.jboss.org/people/nsharm28] created the discussion

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

To view the discussion, visit: https://community.jboss.org/message/788725#788725

--------------------------------------------------------------
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??
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/788725#788725]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130107/d796e65e/attachment-0001.html 


More information about the jboss-user mailing list