<?xml version="1.0" encoding="UTF-8"?>
<process xmlns:blue="http://www.e-marson.com/bluelemon">
<descriptor>
<name>com/emarson/lemonade/examples/mobank/Update</name>
<version>1.0</version>
<description>
Calls the network process checking for any updates.
</description>
<vendor>E-MARSON</vendor>
</descriptor>
<path>
<action name="action on 'Cancel'">
<type>general/bluelemon/code</type>
<definition resultTo="actionForCancel">
<blue:call node="com/emarson/lemonade/examples/mobank/MainScreen"
location="@com/emarson/lemonade/examples/mobank"/>
</definition>
</action>
<action name="read data, verify and continue">
<type>general/bluelemon/code</type>
<definition resultTo="actionForUpdate">
<blue:get node="com/emarson/lemonade/examples/mobank/UserId"
location="permanent" toVariable="userId"/>
<blue:get node="com/emarson/lemonade/examples/mobank/UpdateNo"
location="permanent" toVariable="updateNo"/>
<blue:call node="com/emarson/lemonade/examples/mobank/InitializeDownloading"
location="@com/emarson/lemonade/examples/mobank">
<blue:argument type="String" value="Updating"/>
<blue:argument type="String"
value="Contacting moBank for any updates..."/>
<blue:argument type="String" value="Cancel"/>
<blue:argument type="byteArr" contextKey="actionForCancel"/>
</blue:call>
<blue:try>
<blue:call node="com/emarson/lemonade/examples/mobank/Update"
location="network">
<blue:argument type="variable" name="userId"/>
<blue:argument type="variable" name="updateNo"/>
</blue:call>
</blue:try>
<blue:catch exception="com/emarson/midp/IOException">
<blue:call node="com/emarson/lemonade/examples/mobank/MainScreen"
location="@com/emarson/lemonade/examples/mobank"/>
<blue:newInstance module="com/emarson/lemonade/bluelemon/midp1/Alert"
toVariable="alert"/>
<blue:call object="alert" method="initialize">
<blue:argument type="String" value="Networking Problem"/>
<blue:argument type="String"
value="Can't connect to the Internet."/>
<blue:argument type="byte" value="AlertType.WARNING"/>
<blue:argument type="short" value="Alert.FOREVER"/>
</blue:call>
<blue:call manager="GeneralManager" method="setCurrent">
<blue:argument type="variable" name="alert"/>
</blue:call>
</blue:catch>
<blue:call node="com/emarson/lemonade/examples/mobank/FinalizeDownloading"
location="@com/emarson/lemonade/examples/mobank"/>
</definition>
</action>
<finish name="done">
<return>actionForUpdate</return>
</finish>
</path>
</process>