-
1. JBPM 5 variable (Result Mapping Problem)
krisverlaenen Jan 17, 2011 8:56 PM (in response to candy_633)Here's an example:
https://github.com/krisv/jbpm/blob/master/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcess.bpmn2
Did you define your variables you are mapping your parameters to as a process variable?
And are you sure that the data that is being passed in as the result is not null?
Kris
-
2. JBPM 5 variable (Result Mapping Problem)
candy_633 Jan 19, 2011 10:55 AM (in response to krisverlaenen)Dera Kris,
Thank you so much for your reply. I guess the problem is related to my Java code. Could you please help me take a look at it? I attached my test project "HelloJBPM.zip" to the article on the first floor.
I appreciate your help so much!
I tried your example, there are some errors:
1) seems my code could not call: ServiceTaskHandler(), even I import org.jbpm.bpmn2.handler.ServiceTaskHandler;
2) my code could not identify <serviceTask; I am using <task id="_4" name="RecordHandler" tns:taskName="Handler" >, is it because of different version?
Thanks you so much!
Shanshan
-
3. JBPM 5 variable (Result Mapping Problem)
krisverlaenen Jan 25, 2011 4:51 PM (in response to candy_633)You are using a task with task name "Handler" and registering your WorkingHandler, so that will be invoked when the task needs to be executed. If you want to pass data back in as the result of the execution, you should however do so when completing your work item, for example:
Map results = new HashMap();
results.put("MyResultParam", "MyValue");
manager.completeWorkItem(workItem.getId(), results);
Your result mapping also seems to be incorrect. In this case, you should map the value of the parameter "MyResultParam" to the process variable "Result" in the result mapping: {MyResultParam=Result}
This looks like this in bpmn2 xml:
<task id="_4" name="Notification" tns:taskName="Notification" >
<ioSpecification>
.....
<dataOutput id="_4_MyResultParamOutput" name="MyResultParam" />
.....
<outputSet>
<dataOutputRefs>_4_MyResultParamOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
.....<dataOutputAssociation>
<sourceRef>_4_MyResultParamOutput</sourceRef>
<targetRef>Result</targetRef>
</dataOutputAssociation>
</task>
After that, your value should be written out in the final script task.
Kris
-
4. JBPM 5 variable (Result Mapping Problem)
candy_633 Jan 28, 2011 10:04 AM (in response to krisverlaenen)Thank you so much Kris for helping us!!!