<?xml version="1.0" encoding="UTF-8"?>
<process xmlns:blue="http://www.e-marson.com/bluelemon">
<descriptor>
<name>com/emarson/lemonade/examples/mobank/moaccount/TransferSucceeded</name>
<version>1.0</version>
<description>
This process is invoked when user has successfully done
the transfer.
The Bluelemon instruction generated by this process:
- updates the current balance,
- adds extra row to the history dataset,
- shows a screen informing the transfer has finished successfully.
</description>
<vendor>E-MARSON</vendor>
</descriptor>
<arguments>
<argument key="result" type="String"/>
<argument key="currentBalance" type="Integer"/>
<argument key="historyDatasetRow" type="String"/>
</arguments>
<path>
<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>
<action name="transfer result">
<type>general/bluelemon/code</type>
<definition resultTo="transferResult">
<blue:newInstance module="com/emarson/lemonade/bluelemon/midp1/Form"
toVariable="form"/>
<blue:call object="form" method="initialize">
<blue:argument type="String" value="Success"/>
</blue:call>
<blue:call object="form" method="appendString">
<blue:argument type="String" contextKey="result"/>
</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>
<action name="balance change">
<type>general/bluelemon/code</type>
<definition resultTo="balanceChange">
<blue:set node="com/emarson/lemonade/examples/mobank/moaccount/IsBalanceSet"
location="permanent">
<blue:argument type="boolean" value="true"/>
</blue:set>
<blue:set node="com/emarson/lemonade/examples/mobank/moaccount/AccountBalance"
location="permanent">
<blue:argument type="int" contextKey="currentBalance"/>
</blue:set>
</definition>
</action>
<action name="balance change">
<type>general/bluelemon/code</type>
<definition resultTo="history">
<blue:get node="com/emarson/lemonade/examples/mobank/moaccount/HistoryData"
location="permanent" toVariable="historyDataset"/>
<blue:call manager="UtilsManager" method="appendFirst"
toVariable="historyDataset">
<blue:argument type="variable" name="historyDataset"/>
<blue:argument type="byteArr" contextKey="historyDatasetRow"/>
</blue:call>
<blue:set node="com/emarson/lemonade/examples/mobank/moaccount/HistoryData"
location="permanent">
<blue:argument type="variable" name="historyDataset"/>
</blue:set>
</definition>
</action>
<finish name="done">
<return>balanceChange + history + transferResult</return>
</finish>
</path>
</process>