[jboss-user] [jBPM] - Re: Java code accessing task variables

Chris Melas do-not-reply at jboss.com
Wed May 4 05:45:21 EDT 2011


Chris Melas [http://community.jboss.org/people/melc] created the discussion

"Re: Java code accessing task variables"

To view the discussion, visit: http://community.jboss.org/message/603371#603371

--------------------------------------------------------------
If i'm not mistaken when using a task any variables i.e. comming from parammeter mapping, or even entry actions etc should be placed in content then the content is accessed like below,
long contentId = task.getTaskData().*getDocumentContentId*(); 
                if (contentId != -1) { 
                        BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler(); 
            client.getContent(contentId, getContentResponseHandler); 
            Content content = getContentResponseHandler.getContent(); 

all other arguments of task are access from the methods of TaskData , i.e. task.getTaskData().getComments(); etc

Otherwise a custom workitem has method getParameter for the custom arguments specified for this workitem.But again the variables from parameter mapping and entry actions will have to be placed to the specific argument of that workitem.


Please correct me if there is a better approach....
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[http://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/20110504/bdcf3ad3/attachment-0001.html 


More information about the jboss-user mailing list