[jboss-user] [jBPM] - Re: How to use Content of Human Task

Esteban Aliverti do-not-reply at jboss.com
Tue Feb 28 08:45:15 EST 2012


Esteban Aliverti [https://community.jboss.org/people/eaa] created the discussion

"Re: How to use Content of Human Task"

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

--------------------------------------------------------------
In the process definition you have to map the "Content" input from a process variable or a hardcoded value. 
The content is not present in the TaskSummary object. In your client application, you have to explicitly ask for the content: 

        public Object getTaskContentInput(TaskSummary taskSum) {
                BlockingGetTaskResponseHandler handlerT = new BlockingGetTaskResponseHandler();
                client.getTask(taskSum.getId(), handlerT);
                Task task2 = handlerT.getTask();
                TaskData taskData = task2.getTaskData();
                BlockingGetContentResponseHandler handlerC = new BlockingGetContentResponseHandler();
                client.getContent(taskData.getDocumentContentId(), handlerC);
                Content content = handlerC.getContent();
                ByteArrayInputStream bais = new ByteArrayInputStream(
                                content.getContent());
                try {
                        ObjectInputStream is = new ObjectInputStream(bais);
                        Object obj = null;


                        while ((obj = is.readObject()) != null) {
                                System.out.println("OBJECT: " + obj);
                                return obj;
                        }
                } catch (Exception e) {
                        System.err.print("There was an error reading task input...");
                        e.printStackTrace();              
                        return null;
                }
                return null;
        }


Best Regards,
--------------------------------------------------------------

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

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/20120228/954b5688/attachment-0001.html 


More information about the jboss-user mailing list