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

  <descriptor>
    <name>com/emarson/lemonade/examples/blueSms/_deployment/UpdateMessage</name>
    <version>1.0</version>
    <description>
      A simple procedure to show an "Update Info" message.
      One parameter is required when calling this procedure -
      a text message that will be shown on the screen.
    </description>
    <vendor>E-MARSON</vendor>
  </descriptor>
  
  <path>
  
    <!-- ASSOCIATIONS --->
    
    <!-- association to MainScreen in mobank package --->
    <action name="action for 'Back'">
      <type>general/bluelemon/code</type>
      <definition resultTo="backAction">
        <blue:call node="com/emarson/lemonade/examples/mobank/MainScreen"
                         location="@com/emarson/lemonade/examples/mobank"/>

      </definition>
    </action>
  
  
    <!-- INSTRUCTION --->
  
    <action name="before invoking the update code">
      <type>general/bluelemon/code</type>
      <definition resultTo="updatingProcedure">

        <!-- create the instance of the form --->
        <blue:newInstance module="com/emarson/lemonade/bluelemon/midp1/Form"
                          toVariable="form"/>


        <!-- initialize it --->
        <blue:call object="form" method="initialize">
          <blue:argument type="String" value="Update Info"/>
        </blue:call>

        <!-- update it - put two new lines between the two of the texts --->
        <blue:call manager="UtilsManager" method="concat" 
                   toVariable="text">

          <blue:argument type="String" value="Message from moBank:"/>
          <blue:argument type="byte" value="10"/>
          <blue:argument type="byte" value="10"/>
          <blue:argument type="variable" name="arg_1"/>
        </blue:call>
        
        <blue:call object="form" method="appendString">
          <blue:argument type="variable" name="text"/>
         </blue:call>
        
        <!-- add the command to get back to the menu --->
        <blue:call manager="UtilsManager" method="getActionCommand"
                   toVariable="command">

          <blue:argument type="String" value="Back"/>
          <blue:argument type="byte" value="ActionCommand.BACK"/>
          <blue:argument type="byte" value="0"/>
          <blue:argument type="byteArr" contextKey="backAction"/>
        </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>updatingProcedure</return>
    </finish>

  </path>

</process>