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&...]