<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.omg.org/bpmn20" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:bpsim="http://www.bpsim.org/schemas/1.0" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" id="_3C768HexEeO2N-bMgUwjgw" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.omg.org/bpmn20" typeLanguage="http://www.java.com/javaTypes">

  <bpmn2:itemDefinition id="_myObjectItem" structureRef="org.kie.tests.MyType" />
  <bpmn2:itemDefinition id="_textContentItem" structureRef="String"/>

  <bpmn2:signal id="MySignal" name="MySignal"/>
  <bpmn2:itemDefinition id="__2_outMyObjectOutputItem" structureRef="org.kie.tests.MyType" />

  <bpmn2:process id="org.test.kjar.HumanTaskWithOwnType" drools:packageName="org.jbpm" drools:version="1.0" name="HumanTaskWithOwnType" isExecutable="true">

    <bpmn2:property id="myObject" itemSubjectRef="_myObjectItem"/>
    <bpmn2:property id="textContent" itemSubjectRef="_textContentItem"/>

    <bpmn2:startEvent id="_1" drools:bgcolor="#9acd32" drools:selectable="true" name="" />
    <bpmn2:sequenceFlow id="_1-_2" drools:bgcolor="#000000" drools:selectable="true" sourceRef="_1" targetRef="_2"/>

    <bpmn2:userTask id="_2" drools:selectable="true" drools:scriptFormat="http://www.java.com/java" name="My Object Task">
      <bpmn2:ioSpecification id="_3C768XexEeO2N-bMgUwjgw">
        <bpmn2:dataInput id="_2_TaskNameInput" name="TaskName"/>
        <bpmn2:dataOutput id="_2_outMyObjectOutput" drools:dtype="org.kie.tests.MyType" itemSubjectRef="__2_outMyObjectOutputItem" name="outMyObject"/>
        <bpmn2:inputSet id="_3C7683exEeO2N-bMgUwjgw"/>
        <bpmn2:outputSet id="_3C768nexEeO2N-bMgUwjgw">
          <bpmn2:dataOutputRefs>_2_outMyObjectOutput</bpmn2:dataOutputRefs>
        </bpmn2:outputSet>
      </bpmn2:ioSpecification>
      <bpmn2:dataInputAssociation id="_3C769HexEeO2N-bMgUwjgw">
        <bpmn2:targetRef>_2_TaskNameInput</bpmn2:targetRef>
        <bpmn2:assignment id="_3C769XexEeO2N-bMgUwjgw">
          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="_3C769nexEeO2N-bMgUwjgw">MyObjectTask</bpmn2:from>
          <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_3C7693exEeO2N-bMgUwjgw">_2_TaskNameInput</bpmn2:to>
        </bpmn2:assignment>
      </bpmn2:dataInputAssociation>
      <bpmn2:dataOutputAssociation id="_3C76-HexEeO2N-bMgUwjgw">
        <bpmn2:sourceRef>_2_outMyObjectOutput</bpmn2:sourceRef>
        <bpmn2:targetRef>myObject</bpmn2:targetRef>
      </bpmn2:dataOutputAssociation>
      <bpmn2:potentialOwner id="_3C76-XexEeO2N-bMgUwjgw">
        <bpmn2:resourceAssignmentExpression id="_3C76-nexEeO2N-bMgUwjgw">
          <bpmn2:formalExpression id="_3C76-3exEeO2N-bMgUwjgw">john</bpmn2:formalExpression>
        </bpmn2:resourceAssignmentExpression>
      </bpmn2:potentialOwner>
    </bpmn2:userTask>
    <bpmn2:sequenceFlow id="_2-_3" drools:bgcolor="#000000" drools:selectable="true" sourceRef="_2" targetRef="_3"/>

    <bpmn2:scriptTask id="_3" drools:selectable="true" name="Assign content" scriptFormat="http://www.java.com/java">
      <bpmn2:script><![CDATA[if (myObject == null) {
  System.out.println("myObject is null");
} else {
  System.out.println(myObject.getText());
  kcontext.setVariable("textContent", myObject.getText());
}]]></bpmn2:script>
    </bpmn2:scriptTask>
    <bpmn2:sequenceFlow id="_3-_4" drools:bgcolor="#000000" drools:selectable="true" sourceRef="_3" targetRef="_4"/>

    <bpmn2:intermediateCatchEvent id="_4" drools:bgcolor="#f5deb3" drools:selectable="true" drools:bordercolor="#a0522d" drools:boundaryca="false" name="">
      <bpmn2:signalEventDefinition id="_3C76_HexEeO2N-bMgUwjgw" signalRef="MySignal"/>
    </bpmn2:intermediateCatchEvent>
    <bpmn2:sequenceFlow id="_4-_5" drools:bgcolor="#000000" drools:selectable="true" sourceRef="_4" targetRef="_5"/>

    <bpmn2:endEvent id="_5" drools:bgcolor="#ff6347" drools:selectable="true" name="">
    </bpmn2:endEvent>
  </bpmn2:process>
  
</bpmn2:definitions>
