JBoss Community

Re: JBPM 5 variable (Result Mapping Problem)

created by Kris Verlaenen in jBPM - View the full discussion

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

Reply to this message by going to Community

Start a new discussion in jBPM at Community