Apama 10.3.1 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Order Management | Risk firewall | Configuring risk firewall instances | Overriding default error handling for risk firewalls
 
Overriding default error handling for risk firewalls
The default error handler is invoked if there is an error related to a risk firewall instance. For example, if any of the following happen:
*Registration of a rule class fails.
*Addition, modification, or removal of a rule class instance fails.
*There is an attempt to execute an action that is not available on a risk firewall that is connected to a remote risk firewall instance.
*There is an attempt to update, amend, or cancel an order for which the specified order Id is unknown.
*You try to remove an error callback and specify an incorrect error callback reference identifier.
*You try to set a parameter and specify an invalid parameter name.
The default error handler sends a message to the correlator log file at the ERROR level. To change this behavior, execute com.apama.firewall.RiskFirewall.addErrorCallback(), which adds the specified callback to the set of callbacks executed if there is an error related to that risk firewall instance.
You can execute the addErrorCallback() action multiple times on the same risk firewall instance to implement multiple error handling callbacks for that risk firewall instance. If you add one or more error callbacks to a risk firewall instance then the default error callback is not executed for that risk firewall instance. However, you can call the default error callback from your own error callback by using the RiskFirewall.defaultErrorCallback() action and providing the parameters. The default error callback will send a message to the correlator log file at the ERROR level.
The parameters of a user-defined error callback include the risk firewall instance and also a com.apama.utils.Error event. An Error event has fields for a message, a dictionary of parameters, and an error type code. The addErrorCallback() action adds the specified callback to the set of callbacks executed if there is an error in the operation of the specified risk firewall instance.
The com.apama.firewall.ErrorConstants event defines the error type codes that can apply to risk firewall instances. See the ApamaDoc for details.
When you add an error callback the return value is an integer reference ID that you can specify if you execute RiskFirewall.removeErrorCallback() to discontinue execution of that error callback. To remove all error callbacks, execute the RiskFirewall.clearErrorCallbacks() action. If you remove all previously set error callbacks then error handling behavior reverts to calling the default error callback.

Copyright © 2013-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.