IBM® WebSphere® Multichannel Bank Transformation
Toolkit provides
ECA tooling to enable a functional developer to handle JavaScript events visually. A technical
developer might need to expose the functions or events of a customized
widget so that the widget can be used in the ECA tool.
Adding functions for a widget
To add functions
to a widget, a technical developer must register them in the
widget definition
.xml file. The functions can
then be used in the ECA tool and be invoked according to ECA rules.
Below is a sample function definition:
<function name="setBalance" showInAction="true" showInExpression="true" returnType="Number" description="return balance of account" />
Adding events for a widget
To add events
for a widget, a technical developer must register the events
in the widget definition
.xml file. The events
can then be used in the ECA tool and be triggered according to ECA
rules. Below is a sample event definition:
<event name="onClick" description="event when button is clicked" />
Monitor ECA Execution
WebSphere Multichannel Bank Transformation
Toolkit provides
ECA execution monitoring so that ECA rule execution tracing messages
can be displayed at runtime in a browser console. Because of performance
considerations, ECA monitoring is disabled by default. If you want
to print rule execution traces during development, enable ECA monitoring
by adding the following line into the template file that is used to
generate a JSP file from the XUI file.
var BTT_ECA_MONITOR = new com.ibm.btt.event.ConsoleMonitor();
By
default, WebSphere Multichannel Bank Transformation
Toolkit enables
ECA monitoring in the template_debug.jsp template.
Developers can choose this template when generating a Dojo page to
enable WebSphere Multichannel Bank Transformation
Toolkit ECA
monitoring.
Figure 1 is a sample
output of ECA monitoring in a browser console.
Figure 1. Sample
ECA monitoring output.
Customizing default monitoring
Infrastructure
developers can customize
WebSphere Multichannel Bank Transformation
Toolkit default
ECA rule monitoring. To customize default ECA monitoring, technical
developers must write JavaScript code
to extend the
com.ibm.btt.event.BaseMonitor class
and implement the following methods:
- The monitorStartRule : function( event, rule) method
is invoked when begin to execute a rule.
- The monitorEndRule : function( event, rule) method
is invoked when complete executing a rule.
- The monitorCondition : function (event, rule, result) method
is invoked when complete a condition evaluation.
- The monitorCallFunctionAction: function(id, functionName,
args, result) method is invoked when complete calling a function.
- The monitorGetPropertyAction: function (id, property,
value) method is invoked when complete retrieving a property
from a widget.
- The monitorSetPropertyAction: function (id, property,
value) method is invoked when complete setting a property
to a widget.