You need to use both mappings <div>IN Mappings (Parameter Mapping in the IDE): this will copy your process variables to the work item scope </div><div>and OUT Mappings (Result Mappings): this will copy the information created or modified by the work item (in this case a human task) to the process scope.</div>
<div><br></div><div>Greetings!<br><br><div class="gmail_quote">2010/11/15 matus <span dir="ltr"><<a href="mailto:matus.majchrak@gmail.com">matus.majchrak@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<div><br></div><div>I recently run into some problems when trying to create a simple holiday request process. </div><div>I defined process variables but I struggle to understand how to access them in Human Task. </div>
<div>
In my User Task ,,holiday approval" I have this as a description: #{employee} requested holiday for #{length} days </div><div>I set both variables when I start the process and the result looks as expected, for example ,,John requested holiday fo 14 days.</div>
<div>But lets say I want a manager approving the holiday request to add his response as a variable. How do I do that?</div><div>I tried to use the Result mapping with someting like this: response=response but I get an error saying ,,There is no ID/IDREF binding for IDREF '_2_response'.</div>
<div>Also if I manage to get this running, how do I set this variable in a client app?[using WS_HT] </div><div>I am sorry if I am asking realy basic things, but I realy need some advice.</div><div>Bellow is the process definition.</div>
<div>Thanks a lot, matus</div><div><br></div><div><br></div><div><div><?xml version="1.0" encoding="UTF-8"?> </div><div><definitions id="Definition"</div><div> targetNamespace="<a href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a>"</div>
<div> typeLanguage="<a href="http://www.java.com/javaTypes" target="_blank">http://www.java.com/javaTypes</a>"</div><div> expressionLanguage="<a href="http://www.mvel.org/2.0" target="_blank">http://www.mvel.org/2.0</a>"</div>
<div> xmlns="<a href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a>"</div><div> xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"</div>
<div> xs:schemaLocation="<a href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a> BPMN20.xsd"</div><div> xmlns:bpmndi="<a href="http://www.omg.org/spec/BPMN/20100524/DI" target="_blank">http://www.omg.org/spec/BPMN/20100524/DI</a>"</div>
<div> xmlns:dc="<a href="http://www.omg.org/spec/DD/20100524/DC" target="_blank">http://www.omg.org/spec/DD/20100524/DC</a>"</div><div> xmlns:di="<a href="http://www.omg.org/spec/DD/20100524/DI" target="_blank">http://www.omg.org/spec/DD/20100524/DI</a>"</div>
<div> xmlns:tns="<a href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a>"></div><div><br></div><div> <itemDefinition id="_employeeItem" structureRef="String" /></div>
<div> <itemDefinition id="_lengthItem" structureRef="String" /></div><div> <itemDefinition id="_managersItem" structureRef="String" /></div><div> <itemDefinition id="_responseItem" structureRef="String" /></div>
<div><br></div><div> <process processType="Private" isExecutable="true" id="com.sample.test" name="test process" tns:packageName="defaultPackage" ></div><div><br></div>
<div> <!-- process variables --></div><div> <property id="employee" itemSubjectRef="_employeeItem"/></div><div> <property id="length" itemSubjectRef="_lengthItem"/></div>
<div> <property id="managers" itemSubjectRef="_managersItem"/></div><div> <property id="response" itemSubjectRef="_responseItem"/></div><div><br></div><div> <!-- nodes --></div>
<div> <startEvent id="_1" name="StartProcess" /></div><div> <userTask id="_2" name="Holiday approval" ></div><div> <ioSpecification></div><div> <dataInput id="_2_CommentInput" name="Comment" /></div>
<div> <dataInput id="_2_SkippableInput" name="Skippable" /></div><div> <dataInput id="_2_ContentInput" name="Content" /></div><div> <dataInput id="_2_TaskNameInput" name="TaskName" /></div>
<div> <dataInput id="_2_PriorityInput" name="Priority" /></div><div> <dataOutput id="_2_responseOutput" name="response" /></div><div> <inputSet></div>
<div> <dataInputRefs>_2_CommentInput</dataInputRefs></div><div> <dataInputRefs>_2_SkippableInput</dataInputRefs></div><div> <dataInputRefs>_2_ContentInput</dataInputRefs></div>
<div> <dataInputRefs>_2_TaskNameInput</dataInputRefs></div><div> <dataInputRefs>_2_PriorityInput</dataInputRefs></div><div> </inputSet></div><div> <outputSet></div>
<div> <dataOutputRefs>_2_responseOutput</dataOutputRefs></div><div> </outputSet></div><div> </ioSpecification></div><div> <dataInputAssociation></div><div> <targetRef>_2_CommentInput</targetRef></div>
<div> <assignment></div><div> <from xs:type="tFormalExpression">#{employee} requested holiday for #{length} days </from></div><div> <to xs:type="tFormalExpression">_2_CommentInput</to></div>
<div> </assignment></div><div> </dataInputAssociation></div><div> <dataInputAssociation></div><div> <targetRef>_2_SkippableInput</targetRef></div><div> <assignment></div>
<div> <from xs:type="tFormalExpression">false</from></div><div> <to xs:type="tFormalExpression">_2_SkippableInput</to></div><div> </assignment></div>
<div> </dataInputAssociation></div><div> <dataInputAssociation></div><div> <targetRef>_2_ContentInput</targetRef></div><div> <assignment></div><div> <from xs:type="tFormalExpression"></from></div>
<div> <to xs:type="tFormalExpression">_2_ContentInput</to></div><div> </assignment></div><div> </dataInputAssociation></div><div> <dataInputAssociation></div>
<div> <targetRef>_2_TaskNameInput</targetRef></div><div> <assignment></div><div> <from xs:type="tFormalExpression">Holiday Approval</from></div><div> <to xs:type="tFormalExpression">_2_TaskNameInput</to></div>
<div> </assignment></div><div> </dataInputAssociation></div><div> <dataInputAssociation></div><div> <targetRef>_2_PriorityInput</targetRef></div><div> <assignment></div>
<div> <from xs:type="tFormalExpression"></from></div><div> <to xs:type="tFormalExpression">_2_PriorityInput</to></div><div> </assignment></div><div>
</dataInputAssociation></div><div> <dataOutputAssociation></div><div> <sourceRef>_2_response</sourceRef></div><div> <targetRef>_2_response</targetRef></div><div>
</dataOutputAssociation></div><div> <potentialOwner></div><div> <resourceAssignmentExpression></div><div> <formalExpression>#{managers}</formalExpression></div><div>
</resourceAssignmentExpression></div><div> </potentialOwner></div><div> </userTask></div><div> <endEvent id="_3" name="End" ></div><div> <terminateEventDefinition/></div>
<div> </endEvent></div><div><br></div><div> <!-- connections --></div><div> <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" /></div><div> <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" /></div>
<div><br></div><div> </process></div><div><br></div><div> <bpmndi:BPMNDiagram></div><div> <bpmndi:BPMNPlane bpmnElement="com.sample.test" ></div><div> <bpmndi:BPMNShape bpmnElement="_1" ></div>
<div> <dc:Bounds x="16" y="16" width="48" height="48" /></div><div> </bpmndi:BPMNShape></div><div> <bpmndi:BPMNShape bpmnElement="_2" ></div>
<div> <dc:Bounds x="96" y="16" width="100" height="48" /></div><div> </bpmndi:BPMNShape></div><div> <bpmndi:BPMNShape bpmnElement="_3" ></div>
<div> <dc:Bounds x="340" y="16" width="48" height="48" /></div><div> </bpmndi:BPMNShape></div><div> <bpmndi:BPMNEdge bpmnElement="_1-_2" ></div>
<div> <di:waypoint x="40" y="40" /></div><div> <di:waypoint x="146" y="40" /></div><div> </bpmndi:BPMNEdge></div><div> <bpmndi:BPMNEdge bpmnElement="_2-_3" ></div>
<div> <di:waypoint x="146" y="40" /></div><div> <di:waypoint x="364" y="40" /></div><div> </bpmndi:BPMNEdge></div><div> </bpmndi:BPMNPlane></div>
<div> </bpmndi:BPMNDiagram></div><div><br></div><div></definitions></div></div><div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a> <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br>
- Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> <br> - Salatino "Salaboy" Mauricio -<br>
</div>