This service is meant to be used to configure the desired server events which will be used to feed the
caplin.trading.workbench.TradeStateVisualiser. The alias for this service is
caplin.workbench-trade-service
.
Keep in mind that this service listens to trade creations (via the trade service) so it is recommended to configure it before any call to the create trades on the trade service has been made.
var oWorkbenchTradeService = caplin.core.ServiceRegistry.getService("caplin.workbench-trade-service");
oWorkbenchTradeService.setServerDataForTransition("RFS","OpenAck", {"TradeID": "1234567"});
oWorkbenchTradeService.setAutoServerEvents("RFS",["OpenAck", "PriceUpdate", "Execute", "ExecuteAck", "TradeConfirmation"]);
Attributes | Name and Description |
---|---|
|
caplin.trading.service.WorkbenchTradeService()
|
Attributes | Name and Description |
---|---|
|
void
addServerDataListeners( fServerDataForTransitionCallback, fAutoServerEventsCallback)
Allows the registration of server data changes listeners. |
|
void
addTradeListeners( fTradeCreatedCallback, fTradeRemovedCallback)
Allows the registration of trade creation and trade removal listeners. |
|
Map
getAutoServerEvents(String sRequestID)
Returns the server events for a given trade. |
|
Map
getServerDataForTransitions(String sRequestID)
Returns the transition server data for a given trade. |
|
caplin.trading.workbench.model.StateMachineMonitor
getStateMonitor(String sRequestID)
Returns the state monitor associated to a trade. |
|
Array
getTrades()
Returns the trades contained within the trade service. |
|
void
setAutoServerEvents(Array pServerEvents, pAutoServerTransitions)
Define which will be the events that will automatically be served. |
|
void
setServerDataForTransition(String sTransitionName, Map mData, mTransitionData)
Defines the data that is needed for the server transitions received by the |
|
void
tradeCreated( oTradeFactory, oTrade)
|
|
void
tradeRemoved( oTradeFactory, sRequestID)
|
►
caplin.trading.service.WorkbenchTradeService()
►
void
addServerDataListeners( fServerDataForTransitionCallback, fAutoServerEventsCallback)
Allows the registration of server data changes listeners. Callbacks registered will be triggered whenever there is a change on the server data.
fServerDataForTransitionCallback | ||
fAutoServerEventsCallback |
►
void
addTradeListeners( fTradeCreatedCallback, fTradeRemovedCallback)
Allows the registration of trade creation and trade removal listeners. Callbacks registered will be triggered whenever a trade gets either added or removed.
fTradeCreatedCallback | ||
fTradeRemovedCallback |
►
Map
getAutoServerEvents(String sRequestID)
Returns the server events for a given trade.
String | sRequestID | id identifying a trade. |
►
Map
getServerDataForTransitions(String sRequestID)
Returns the transition server data for a given trade.
String | sRequestID | id identifying a trade. |
►
caplin.trading.workbench.model.StateMachineMonitor
getStateMonitor(String sRequestID)
Returns the state monitor associated to a trade.
String | sRequestID | id identifying a trade. |
►
Array
getTrades()
Returns the trades contained within the trade service.
►
void
setAutoServerEvents(Array pServerEvents, pAutoServerTransitions)
Define which will be the events that will automatically be served.
Array | pServerEvents | The array of events that will be served in case no user interaction is selected. |
pAutoServerTransitions |
►
void
setServerDataForTransition(String sTransitionName, Map mData, mTransitionData)
Defines the data that is needed for the server transitions received by the caplin.trading.trademodel.TradeMessageService
when
'auto server data' switch is on. If is is off, the data will be selected by the user.
String | sTransitionName | The transition name |
Map | mData | Map with the data the transition will generate |
mTransitionData |
►
void
tradeCreated( oTradeFactory, oTrade)
oTradeFactory | ||
oTrade |
►
void
tradeRemoved( oTradeFactory, sRequestID)
oTradeFactory | ||
sRequestID |