-
1. Re: Result Mapping for ServiceTask in CustomWorkItemEditor
melc Feb 2, 2012 8:10 AM (in response to sebb)Hi,
If i understood correctly, you can return results from your custom work item by passing your parameters to the
completeWorkItem(WorkItem workItem, WorkItemManager manager, Map<String, Object> results) method of WorkItemManager object
i.e.
Map<String, Object> results;
results.put("result", resultObject); results.put("error",errorObject);
manager.completeWorkItem(workItem.getId(), results);
or even better from the StatefulKnowledgeSession object via
ksession.getWorkItemManager().completeWorkItem(....) .
Then you can assign the result mapping i.e from editors.
-
2. Re: Result Mapping for ServiceTask in CustomWorkItemEditor
sebb Feb 2, 2012 8:59 AM (in response to melc)Thanks for your reply.
Yes, that is the way how you do it at "runtime". But I was searching for a solution at design time:
Usually you have to edit the property "Result Mapping" in the eclipse plugin in order to use the result (that you have passed with the completeWorkItem method) in the process as a variable. I was thinking of a shortcut that can be done inside the custom dialog of the serviceTask.
-
3. Re: Result Mapping for ServiceTask in CustomWorkItemEditor
melc Feb 2, 2012 10:24 AM (in response to sebb)One way of doing it could be by seting variables of the StatefulKnowledgeSession. The StatefulKnowledgeSession could be passed to the constructor of your work item handler.
-
4. Re: Result Mapping for ServiceTask in CustomWorkItemEditor
sebb Feb 2, 2012 10:52 AM (in response to melc)You are on the wrong way, but thanks for your contribution Just to clear it up:
I am talking about a custom work item Editor not about a Handler.
Its something like this:
public class MyWorkItemEditor extends EditBeanDialog<Work> implements WorkEditor{
public MyWorkItemEditor(Shell parentShell){
super(parentShell, "Title of my editor");
}
protected Control createDialogArea(Composite parent) {
//create my gui stuff
}
etc.So I am talking about the GUI Dialog that pops up when clicking on a Service Task in the eclipse jbpm plugin =)