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

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

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

      </definition>
    </action>


    <!-- PACKAGES INSTALLATION ---> 

    <subprocess name="mobank">
      <source>com/emarson/lemonade/examples/mobank/_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="goToAuthenticationScreen"/>
        </blue:set>

      </definition>
    </action>


    <!-- POST-INSTALL INSTRUCTION ---> 
    
    <!-- 
      goToAuthenticationScreen will be called as 
      a post-install instruction 
    --->


    <finish name="return the result">
      <return>package + startupUpdate + goToAuthenticationScreen</return>
    </finish> 

  </path>

</process>