Runtime components : Channels components : HTML Channel : Reference : Flow processor example: dialog navigation controller : HTML flow processor definition
  
HTML flow processor definition
With the business process of Purchase Mutual Funds described as a statechart diagram, you can then define the process as a sequence of states guided by a flow processor. The following example is how you would define the flow processor as a self-defined processor in a file called FundAcquisition.xml.
<processor id="fundAcquisition" context="fundAcquisitionCtx">
<state id="initial" type="initial">
<transitions>
<transition id="initial.start" targetState="fundsCatalogOperation">
</transition>
</transitions>
</state>
<state id="fundsCatalogOperation" type="operation">
<entryActions>
<executeOperationAct id="execOperAct" operationName="fundsCatalogOperation"
linkContextTo="processor">
</executeOperationAct>
</entryActions>
<transitions>
<transition id="execOperAct.ok" targetState="fundsCatalogPage">
</transition>
<transition id="execOperAct.error" targetState="userErrorInfoPage">
</transition>
</transitions>
</state>
<state id="fundsCatalogPage" type="page" typeIdInfo="fundsCatalogPage.JSP">
<transitions>
<transition id="productSelected" targetState="productDetailsOperation">
</transition>
<transition id="cancel" targetState="finalOK">
</transition>
</transitions>
</state>
<state id="productDetailsOperation" type="operation">
<entryActions>
<executeOperationAct id="execOperAct" operationName="productDetailsOperation"
linkContextTo="processor">
</executeOperationAct>
</entryActions>
<transitions>
<transition id="execOperAct.ok" targetState="productDetailsPage">
</transition>
<transition id="execOperAct.error" targetState="fundsCatalogPage">
</transition>
</transitions>
</state>
<state id="productDetailsPage" type="page" typeIdInfo="productDetailsPage.JSP">
<transitions>
<transition id="OK" targetState="accountsListOperation">
</transition>
<transition id="cancel" targetState="fundsCatalogPage">
</transition>
</transitions>
</state>
<state id="accountsListOperation" type="operation">
<entryActions>
<executeOperationAct id="execOperAct" operationName="accountsListOperation"
linkContextTo="processor">
</executeOperationAct>
</entryActions>
<transitions>
<transition id="execOperAct.ok" targetState="fundPurchasePage">
</transition>
<transition id="execOperAct.error" targetState="userErrorInfoPage">
</transition>
</transitions>
</state>
<state id="fundPurchasePage" type="page" typeIdInfo="fundPurchasePage.JSP">
<transitions>
<transition id="OK" targetState="confirmationPage">
</transition>
<transition id="cancel" targetState="fundsCatalogPage">
</transition>
<transition id="back" targetState="productDetailsPage">
</transition>
</transitions>
</state>
<state id="confirmationPage" type="page" typeIdInfo="fundPurchaseConfirmationPage.JSP">
<transitions>
<transition id="OK" targetState="fundPurchaseOperation">
</transition>
<transition id="cancel" targetState="fundsCatalogPage">
</transition>
<transition id="back" targetState="fundPurchasePage">
</transition>
</transitions>
</state>
<state id="fundPurchaseOperation" type="operation">
<entryActions>
<executeOperationAct id="execOperAct" operationName="fundPurchaseOperation"
linkContextTo="processor">
<conditions>
</executeOperationAct>
</entryActions>
<transitions>
<transition id="execOperAct.ok" targetState="finalSummaryPage">
</transition>
<transition id="execOperAct.error" targetState="userErrorInfoPage">
</transition>
</transitions>
</state>
<state id="finalSummaryPage" type="page" typeIdInfo="fundPurchaseSummaryPage.JSP">
<transitions>
<transition id="OK" targetState="finalOK">
</transition>
</transitions>
</state>
<state id="userErrorInfoPage" type="page" typeIdInfo="userErrorInfoPage.JSP">
<transitions>
<transition id="OK" targetState="finalNoOK">
</transition>
</transitions>
</state>
<state id="finalNoOK" type="final" typeIdInfo="noOK">
</state>
<state id="finalOK" type="final" typeIdInfo="OK">
</state>
</processor>
To allow the externalizer to find the path to the fundAcquisition flow processor in the FundAcquisition.xml file, the toolkit configuration file has the following definition:
<kColl id="files">
...
<field id="processor" value="DSEPROC.XML" />
<!-- The processor definition is the entity definition file for Processors -->
<kColl id="processors"> <! The processor is self-defined in a specific path. >
<processorDef id="fundAcquisition" value="FundAcquisition.xml"
path="c:\dse\server\procs" />
...
</kColl>
</kColl>
...
<kColl id="packages">
...
<kColl id="processors">
<field id="package1" value="com.ibm.btt.samples.html">
...
</kColl>
</kColl>
...
<kColl id="tags">
...
<kColl id="processors">
<field id="processor" value="com.ibm.btt.automaton.DSEProcessor"
description="compound">
<field id="state" value="com.ibm.btt.automaton.DSEState"
description="compound">
<field id="transition" value="com.ibm.btt.automaton.DSETransitionDescriptor"
description="compound">
<!-- Actions -->
<field id="executeOperationAct" value="com.ibm.btt.automaton.ext.ExecuteOperationAct"
description="compound">
<!-- Conditions -->
<field id="checkPINCode" value="com.xxx.yyy.CheckPINCode">
...
</kColl>
</kColl>
The requester of the process (in this case, the ProcessorOperation implementation built for HTML client support) uses the externalizer to instantiate the processor using the following command:(Processor) DSEProcessorExternalizer.readObject("fundAcquisition");
Go up to
Flow processor example: dialog navigation controller