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

  <descriptor>
    <name>com/emarson/lemonade/examples/mobank/moaccount/_deployment/Installer</name>
    <version>1.0</version>
    <description>
      The result Bluelemon instruction does the following:
       - installs the moAccount package,
       - sets a STARTUP_INSTRUCTION to call the MainScreen node,
       - calls the MainScreen node.
    </description>
    <vendor>E-MARSON</vendor>
  </descriptor>

  <path>

    <!-- ASSOCIATIONS --->
    
    <!-- association to MainScreen --->
    <action name="go to the main screen">
      <type>general/bluelemon/code</type>
      <definition resultTo="goToMainScreen">
        <blue:call node="com/emarson/lemonade/examples/mobank/moaccount/MainScreen"
                         location="@com/emarson/lemonade/examples/mobank/moaccount"/>

      </definition>
    </action>

 
    <!-- PACKAGES INSTALLATION ---> 
    
    <subprocess name="moaccount">
      <source>com/emarson/lemonade/examples/mobank/moaccount/_deployment/Package</source>
      <resultTo>package</resultTo>
    </subprocess> 
    
    
    <!-- 'PERMANENT' AND 'SESSION' UPDATES ---> 
    
    <!-- update the STARTUP_INSTRUCTION node --->
    <action name="update startup instruction">
      <type>general/bluelemon/code</type>
      <definition resultTo="startupUpdate">

        <blue:set node="STARTUP_INSTRUCTION" location="permanent">
          <blue:argument type="byteArr" contextKey="goToMainScreen"/>
        </blue:set>

      </definition>
    </action>
    
    
    <!-- POST-INSTALL INSTRUCTION ---> 
    
    <!-- go to main screen will be called as a post-install instruction --->
    
    

    <!-- return the result --->
    <finish name="return the wrapped package">
      <return>package + startupUpdate + goToMainScreen</return>
    </finish> 

  </path>

</process>