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

  <descriptor>
    <name>com/emarson/lemonade/examples/mobank/moaccount/TransferFailed</name>
    <version>1.0</version>
    <description>
      This process is invoked when the transfer failed.
    </description>
    <vendor>E-MARSON</vendor>
  </descriptor>

  <arguments>
    <argument key="errorMessage" type="String"/>
  </arguments>

  <path>
  
    <!-- ASSOCIATIONS --->
    
    <!-- association to MainScreen --->
    <action name="action for 'Back'">
      <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>


    <!-- INSTRUCTION --->
    
    <action name="error message">
      <type>general/bluelemon/code</type>
      <definition resultTo="screen">

        <blue:newInstance module="com/emarson/lemonade/bluelemon/midp1/Form"
                          toVariable="form"/>


        <blue:call object="form" method="initialize">
          <blue:argument type="String" value="Transfer failed"/>
        </blue:call>

        <blue:call object="form" method="appendString">
          <blue:argument type="String" contextKey="errorMessage"/>
        </blue:call>
        
        <blue:call manager="UtilsManager" method="getActionCommand"
                   toVariable="command">

          <blue:argument type="byte" value="ActionCommand.BACK"/>
          <blue:argument type="byte" value="2"/>
          <blue:argument type="byte" value="0"/>
          <blue:argument type="byteArr" contextKey="goToMainScreen"/>
        </blue:call>

        <blue:call object="form" method="addCommand">
          <blue:argument type="variable" name="command"/>
        </blue:call>

        <blue:call manager="GeneralManager" method="setCurrent">
          <blue:argument type="variable" name="form"/>
        </blue:call>

      </definition>
    </action>

    <finish name="done">
      <return>screen</return>
    </finish>

  </path>

</process>