<?xml version="1.0" encoding="UTF-8"?>
<process xmlns:blue="http://www.e-marson.com/bluelemon">

  <descriptor>
    <name>${location}/deployment/Package${packagePostfix}</name>
    <version>${version}</version>
    <description>
      It generates a package containing the following nodes:
      <!-- list the nodes here --->
    </description>
    <vendor>${vendor}</vendor>
  </descriptor>

  <path>

    <!-- We need to generate the content of all the nodes we will use --->
    
    <!-- for each node being a part of the package prepare the entry based on the template below --->
    <subprocess name="name of the node 1">
      <source>${locationOfTheProcessToGenerateNode1}/${nameOfTheProcessToGenerateNode1}</source>
      <resultTo>nodeContent1</resultTo>
    </subprocess>
    
    <subprocess name="name of the node 2">
      <source>${locationOfTheProcessToGenerateNode2}/${nameOfTheProcessToGenerateNode2}</source>
      <resultTo>nodeContent2</resultTo>
    </subprocess>
    <!-- etc. --->

  <!-- We need to define two arrays... --->
    <action name="prepare the arrays with package definitions">
      <type>general/bcl</type>
      <definition>
        package = new Array(${numberOfNodesInThePackage});
        <!-- for each node being a part of the package prepare the entry based on the template below --->
        package[0] = nodeContent1;
        package[1] = nodeContent2;
        <!-- etc. --->
        packageNames = new Array(${numberOfNodesInThePackage});
        <!-- for each node being a part of the package prepare the entry based on the template below --->
        packageNames[0] = "${nameOfNode1InThePackage}";
        packageNames[1] = "${nameOfNode2InThePackage}";
        <!-- etc. --->
      </definition>
    </action>

    <action name="create the install package">
      <type>general/bluelemon/package</type>
      <definition resultTo="package" 
                  serviceName="${nameOfThePackage}"
                  valuesContextKey="package" 
                  namesContextKey="packageNames"/>

    </action>

    <subprocess name="wrap the install package">
      <source>com/emarson/lemonade/templates/ProcessCode</source>
      <arguments>
        <argument key="code">package</argument>
      </arguments>
      <resultTo>wrappedPackage</resultTo>
    </subprocess>

    <finish name="return the wrapped package">
      <return>wrappedPackage</return>
    </finish>

  </path>

</process>