[jboss-user] [jBPM] - Re: Can a POJO be Parameter Mapped?
Gary Struthers
do-not-reply at jboss.com
Wed Aug 3 21:00:06 EDT 2011
Gary Struthers [http://community.jboss.org/people/GaryS] created the discussion
"Re: Can a POJO be Parameter Mapped?"
To view the discussion, visit: http://community.jboss.org/message/619290#619290
--------------------------------------------------------------
The reason the service task parameter worked after removing the Human Task is that the TestWorkItemHandler(s) I copied from examples completed the task with null results. Once I passed the pojo to workItemManager.completeWorkItem(...) my service task method then got the pojo. This means you have to customize your testWorkItemHandlers to complete with the result you expect.
class MyAutomaticHumanSimulatorWorkItemHandler implements WorkItemHandler {
private List<WorkItem> workItems = new ArrayList<WorkItem>();
public void executeWorkItem(WorkItem workItem, WorkItemManager workItemManager) {
workItems.add(workItem);
System.out.println("Map of Parameters = " + workItem.getParameters());
PIvars vars = (PIvars) workItem.getParameter("vars");
vars.setCanScore(true);
vars.setScore(new BigDecimal(4));
Map<String,Object>results = new HashMap();
results.put("vars", vars);
workItemManager.completeWorkItem(workItem.getId(), *results*);
System.out.println("Workitem completed " + workItem.getName());
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619290#619290]
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/20110803/33f64a53/attachment-0001.html
More information about the jboss-user
mailing list