<?xml version="1.0" encoding="UTF-8"?> 
<process xmlns="http://drools.org/drools-5.0/process"
         xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
         xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
         type="RuleFlow" name="ruleflow" id="com.sample.ruleflow" package-name="com.sample" >

  <header>
    <imports>
      <import name="org.jbpm.persistence.session.objects.MyEntity" />
      <import name="org.jbpm.persistence.session.objects.MyVariableSerializable" />
      <import name="org.infinispan.Cache" />
      <import name="org.kie.api.runtime.EnvironmentName" />
    </imports>
    <variables>
      <variable name="x" >
        <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
      </variable>
      <variable name="y" >
        <type name="org.jbpm.process.core.datatype.impl.type.ObjectDataType" className="org.jbpm.persistence.session.objects.MyEntity" />
      </variable>
      <variable name="z" >
        <type name="org.jbpm.process.core.datatype.impl.type.ObjectDataType" className="org.jbpm.persistence.session.objects.MyVariableSerializable" />
      </variable>
      <variable name="v" >
        <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        <value>Default</value>
      </variable>
    </variables>
  </header>

  <nodes>
    <start id="1" name="Start" x="16" y="16" width="48" height="48" />
    <end id="3" name="End" x="669" y="16" width="48" height="48" />
    <composite id="4" name="CompositeNode" x="187" y="33" width="326" height="327" >
    <variables>
      <variable name="y" >
        <type name="org.jbpm.process.core.datatype.impl.type.ObjectDataType" className="org.jbpm.persistence.session.objects.MyEntity" />
      </variable>
      <variable name="z" >
        <type name="org.jbpm.process.core.datatype.impl.type.ObjectDataType" className="org.jbpm.persistence.session.objects.MyVariableSerializable" />
      </variable>
      <variable name="x" >
        <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        <value></value>
      </variable>
      <variable name="w" >
        <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        <value>New default</value>
      </variable>
    </variables>
      <nodes>
    <actionNode id="1" name="Action" x="31" y="62" >
        <action type="expression" dialect="java" >
        kcontext.setVariable("x", "new String");
        Cache cache = (Cache)kcontext.getKnowledgeRuntime().getEnvironment().get(EnvironmentName.APP_SCOPED_ENTITY_MANAGER);
        MyEntity newEntity = new MyEntity("This is a new test Entity");
        cache.put("myEntity" + kcontext.getProcessInstance().getId(), newEntity);
        kcontext.setVariable("y", newEntity);
        MyVariableSerializable newSerializable = new MyVariableSerializable("This is a new test SerializableObject");
        kcontext.setVariable("z", newSerializable);
        
        </action>
    </actionNode>
    <humanTask id="2" name="Human Task" x="122" y="61" >
      <work name="Human Task" >
        <parameter name="ActorId" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Comment" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Content" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Priority" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Skippable" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="TaskName" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
      </work>
    </humanTask>
    <actionNode id="3" name="Action" x="211" y="61" >
        <action type="expression" dialect="java" >System.out.println("v = " + v);
System.out.println("w = " + w);
System.out.println("x = " + x);
System.out.println("y = " + y);
System.out.println("z = " + z);</action>
    </actionNode>
    <composite id="7" name="CompositeNode" x="26" y="136" width="273" height="173" >
    <variables>
      <variable name="a" >
        <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        <value>Newest Default 1</value>
      </variable>
      <variable name="z" >
        <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        <value>Newest Default 2</value>
      </variable>
    </variables>
      <nodes>
    <actionNode id="1" name="Action" x="18" y="55" >
        <action type="expression" dialect="java" >System.out.println("a = " + a);
System.out.println("v = " + v);
System.out.println("w = " + w);
System.out.println("x = " + x);
System.out.println("y = " + y);
System.out.println("z = " + z);</action>
    </actionNode>
    <humanTask id="2" name="Human Task" x="140" y="40" >
      <work name="Human Task" >
        <parameter name="ActorId" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Comment" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Content" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Priority" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Skippable" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="TaskName" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
      </work>
    </humanTask>
    <actionNode id="3" name="Action" x="163" y="112" >
        <action type="expression" dialect="java" >System.out.println("a = " + a);
System.out.println("v = " + v);
System.out.println("w = " + w);
System.out.println("x = " + x);
System.out.println("y = " + y);
System.out.println("z = " + z);</action>
    </actionNode>
      </nodes>
      <connections>
    <connection from="1" to="2" />
    <connection from="2" to="3" />
      </connections>
      <in-ports>
        <in-port type="DROOLS_DEFAULT" nodeId="1" nodeInType="DROOLS_DEFAULT" />
      </in-ports>
      <out-ports>
        <out-port type="DROOLS_DEFAULT" nodeId="3" nodeOutType="DROOLS_DEFAULT" />
      </out-ports>
    </composite>
      </nodes>
      <connections>
    <connection from="1" to="2" />
    <connection from="2" to="3" />
    <connection from="3" to="7" />
      </connections>
      <in-ports>
        <in-port type="DROOLS_DEFAULT" nodeId="1" nodeInType="DROOLS_DEFAULT" />
      </in-ports>
      <out-ports>
        <out-port type="DROOLS_DEFAULT" nodeId="7" nodeOutType="DROOLS_DEFAULT" />
      </out-ports>
    </composite>
    <actionNode id="5" name="Action" x="547" y="50" width="80" height="48" >
        <action type="expression" dialect="mvel" >System.out.println("v = " + v);
System.out.println("x = " + x);
System.out.println("y = " + y);
System.out.println("z = " + z);</action>
    </actionNode>
    <humanTask id="6" name="Human Task" >
      <work name="Human Task" >
        <parameter name="ActorId" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Comment" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Content" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Priority" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="Skippable" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
        <parameter name="TaskName" >
          <type name="org.jbpm.process.core.datatype.impl.type.StringDataType" />
        </parameter>
      </work>
    </humanTask>
    <actionNode id="7" name="Action" >
        <action type="expression" dialect="mvel" >System.out.println("v = " + v);
System.out.println("x = " + x);
System.out.println("y = " + y);
System.out.println("z = " + z);</action>
    </actionNode>
  </nodes>

  <connections>
    <connection from="7" to="3" />
    <connection from="1" to="4" />
    <connection from="4" to="5" />
    <connection from="5" to="6" />
    <connection from="6" to="7" />
  </connections>

</process>
