<?xml version="1.0" encoding="UTF-8"?>
<process xmlns:blue="http://www.e-marson.com/bluelemon">
<descriptor>
<name>com/emarson/lemonade/examples/mobank/moaccount/HistoryScreen</name>
<version>1.0</version>
<description>
History screen.
A user is shown an implicit list with all the dates any transfer
has been done. Selecting any element from this list results in
showing a text message with the transfer data.
A dataset of the following structure:
+ date of the transfer: String,
+ ammount of money transferred: int,
+ target account: String.
is kept in the permanent memory in the node
'com/emarson/lemonade/examples/mobank/moaccount/HistoryData'.
Every time a new transfer is being done a new row is being
added to the top of this dataset.
</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>
<subprocess name="action for 'Select'">
<source>com/emarson/lemonade/examples/mobank/moaccount/HistoryDetailsScreen</source>
<resultTo>showHistoryForDate</resultTo>
</subprocess>
<action name="list with all the dates a transfer has been done">
<type>general/bluelemon/code</type>
<definition resultTo="screen">
<blue:get node="com/emarson/lemonade/examples/mobank/moaccount/HistoryData"
location="permanent" toVariable="historyDataset"/>
<blue:call manager="UtilsManager" method="this"
toVariable="historyDatasetDescriptor">
<blue:argument type="dataset">
<blue:descriptor>
<blue:field type="byte"/>
<blue:field type="byte"/>
<blue:field type="byte"/>
</blue:descriptor>
<blue:row>
<blue:field value="STRING_TYPE"/>
<blue:field value="INT_TYPE"/>
<blue:field value="STRING_TYPE"/>
</blue:row>
</blue:argument>
</blue:call>
<blue:call manager="UtilsManager" method="getColumn"
toVariable="datasetWithDates">
<blue:argument type="variable" name="historyDataset"/>
<blue:argument type="variable" name="historyDatasetDescriptor"/>
<blue:argument type="byte" value="0"/>
</blue:call>
<blue:call manager="UtilsManager" method="getRowsNumber"
toVariable="rowsNumber">
<blue:argument type="variable" name="historyDataset"/>
<blue:argument type="variable" name="historyDatasetDescriptor"/>
</blue:call>
<blue:call manager="UtilsManager" method="=="
toVariable="zeroRows">
<blue:argument type="variable" name="rowsNumber"/>
<blue:argument type="byte" value="0"/>
</blue:call>
<blue:if isTrue="zeroRows">
<blue:newInstance module="com/emarson/lemonade/bluelemon/midp1/Form"
toVariable="screen"/>
<blue:call object="screen" method="initialize">
<blue:argument type="String" value="History"/>
</blue:call>
<blue:call object="screen" method="appendString">
<blue:argument type="String" value="No history so far."/>
</blue:call>
</blue:if>
<blue:else>
<blue:newInstance module="com/emarson/lemonade/bluelemon/midp1/ChoiceFactory"
toVariable="choiceFactory"/>
<blue:call object="choiceFactory" method="createList"
toVariable="screen">
<blue:argument type="byte" value="List.IMPLICIT"/>
</blue:call>
<blue:call object="screen" method="initialize">
<blue:argument type="String" value="History"/>
<blue:argument type="variable" name="datasetWithDates"/>
<blue:argument type="byteArr" contextKey="showHistoryForDate"/>
</blue:call>
</blue:else>
<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="screen" method="addCommand">
<blue:argument type="variable" name="command"/>
</blue:call>
<blue:call manager="GeneralManager" method="setCurrent">
<blue:argument type="variable" name="screen"/>
</blue:call>
</definition>
</action>
<finish name="done">
<return>screen</return>
</finish>
</path>
</process>