Apama Capital Markets Foundation 10.15 | Capital Markets Foundation | Order Management | Risk firewall | Receiving approved orders from a risk firewall | Setting accepted-cancelled-order callbacks
 
Setting accepted-cancelled-order callbacks
After a risk firewall approves cancellation of an order, it calls any accepted-cancelled-order callbacks that you have added to the order receiver that receives the approved cancellation. For example, you might want to add an accepted-cancelled-order callback that forwards approved cancellations to a particular adapter.
To add an accepted-cancelled-order callback, call com.apama.firewall.OrderReceiver.addAcceptedCancelCallback(). This action takes one argument, which is the callback to be executed. The callback itself takes one argument, which is a com.apama.oms.CancelOrder object. The action registers a callback with the risk firewall instance it is executed on. The registered callback is executed whenever the risk firewall approves cancellation of an order. You can add more than one accepted-cancelled-order callback.
The addAcceptedCancelCallback() action returns a unique integer reference Id that you can use to remove the callback at a later date if required.
To remove a previously-added accepted-cancelled-order callback, call OrderReceiver.removeAcceptedCancelCallback() and specify the integer reference Id that was returned when you added the callback. To remove all previously-added accepted-cancelled-order callbacks, call the OrderReceiver.clearAcceptedCancelCallbacks() action.