<?xml version="1.0" encoding="UTF-8"?>
<process xmlns:blue="http://www.e-marson.com/bluelemon">
<descriptor>
<name>com/emarson/lemonade/examples/mobank/moaccount/AccountBalanceScreen</name>
<version>1.0</version>
<description>
A screen to show a current balance.
This value is stored in the permanent location, in node
'com/emarson/lemonade/examples/mobank/moaccount/AccountBalance'.
Every time a new transfer is being done this node is updated.
</description>
<vendor>E-MARSON</vendor>
</descriptor>
<path>
<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>
<action name="show the account balance screen">
<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="Account balance"/>
</blue:call>
<blue:get node="com/emarson/lemonade/examples/mobank/moaccount/IsBalanceSet"
location="permanent" toVariable="isBalanceSet"/>
<blue:get node="com/emarson/lemonade/examples/mobank/moaccount/AccountBalance"
location="permanent" toVariable="balance"/>
<blue:call manager="UtilsManager" method="=="
toVariable="isBalanceSet">
<blue:argument type="variable" name="isBalanceSet"/>
<blue:argument type="boolean" value="true"/>
</blue:call>
<blue:if isTrue="isBalanceSet">
<blue:call manager="UtilsManager" method="numberToString"
toVariable="balanceAsString">
<blue:argument type="variable" name="balance"/>
</blue:call>
<blue:call manager="UtilsManager" method="concat"
toVariable="balanceInfo">
<blue:argument type="String" value="Your current balance is: "/>
<blue:argument type="variable" name="balanceAsString"/>
<blue:argument type="String" value=" EUR."/>
</blue:call>
</blue:if>
<blue:else>
<blue:call manager="UtilsManager" method="this"
toVariable="balanceInfo">
<blue:argument type="String"
value="You haven't done any transfers yet. Your account balance is unknown."/>
</blue:call>
</blue:else>
<blue:call object="form" method="appendString">
<blue:argument type="variable" name="balanceInfo"/>
</blue:call>
<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="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>