com.apama.oms
Event OrderReceiverStateContainer


The OrderReceiverStateContainer is an event helper object that provides a simple interface to receiver orders in an application, and to publish updates on the state of those orders.

The OrderReceiverStateContainer should be used by applications that want to act as execution venues (such as simulators, internal markets, etc) or that want to act as an intermediary between the actual execution venue and the application (for example, to validate orders before they go to the adapter).

A single OrderReceiverStateContainer object must be created per-order that is being received.

The following code extract, shows a rather inane example of using the OrderReceiverStateContainer. In the extract, an action is created that will listen for NewOrders being created. When an appropriate NewOrder event has been received a new OrderReceiverStateContainer object is created, and #receiveOrder() is called to start handling the state of that order. The quantity of the order is then checked for a maximum limit, and the order is either filled or rejected accordingly.

action handleNewOrders() {
com.apama.oms.NewOrder newOrder;
on all com.apama.oms.NewOrder(serviceId="FIX", marketId="CNX"):newOrder {
com.apama.oms.OrderReceiverStateContainer recv :=
new com.apama.oms.OrderReceiverStateContainer;
recv.receiveOrder(newOrder, false);

// Test if the order received was valid
if( recv.getQty() < 1000 ) then {
// Order was valid, so acknowledge the order and fill it
recv.acknowledge( integer.getUnique() );
recv.fill( recv.getPrice(), recv.getQuantity() );
} else {
// Order was invalid, reject it
recv.reject( "Order rejected! Quantity requested was more than 1000!" );
}
}
}
There are a number of actions provided by the OrderReceiverStateContainer event object that allow you to query the current state of the order being monitored. These are split into two categories, those prefixed with "is*()" and those prefixed with "just*()". The "is*()" set of actions indicate whether or not the order is currently in that state. Whereas the "just*()" set of actions determine the order state in the most recent update only. For example, justAcknowledged() will return true immediately after the order is acknowledged, but not on any subsequent updates, whereas isAcknowledged() will always return true after the order has been acknowledged.

Note: This event helper object cannot be routed.
Since:
CMF 1.1.0
Version:
10.7
See Also:
com.apama.oms.OrderMonitorStateContainer - This event helper is used to monitor the state of orders in an application
com.apama.oms.OrderPublisherStateContainer - This event helper is used to publish/submit new orders in an application
Routes:
com.apama.oms.OrderReceiveFinished - 
com.apama.oms.OrderUpdate - 
Sends:
com.apama.oms.OrderUpdate - 

Action summary
 string_toString()

Returns a formatted string of the current order state.
 voidacknowledge(string marketOrderId)

This action acknowledges the order, which indicates that it is now in the market and eligible to be filled.
 booleancanModify()

This action indicates whether or not the order can be modified in its current state.
 booleancanReceive()

This action indicates whether the OrderReceiverStateContainer is in a state where it is able to handle a new order.
 voidcommitAmend(string reason)

This action is used to commit a previously applied amendment to an order. This means that the order will be in market with the new price and quantity.
 voidcommitCancel(string reason)

This action commits a cancel, removing the order from market. If userCancel was not called before this the cancellation is considered an external modification.
 voidconnectionDisconnected(string description)

This action can be used to reports that the receiver has lost connection to the publisher. If the order was in a modifiable state, it will set the order state to "unknown" and "externally modified", before committing a cancellation of the order.
 voidexternalAmend(float price, integer qty, dictionary<string, string> extraParams)

This action is used to an external amendment to an order (e.g. from the exchange side). This must be committed later using #commitAmend() for the amendment to take effect.
 voidfill(float price, integer qty)

This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. If the order has been fully filled, then the orders "final" flag is enabled.
 voidfillAndCommitCancel(float price, integer qty, string reason)

This action partially fills an order at the price and quantity specified, and commits a cancellation of the remaining quantity. This can be used to report the last fill on a market order.
 voidfillWithCounterparty(float price, integer qty, string counterparty)

This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher reporting the counterparty.
 voidfillWithOptionalFinalise(float price, integer qty, boolean setFinalIfQtyRemaining0)

This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. The orders "final" flag is optionally enabled when the order has been fully filled.
 floatgetAvgPrice()

Returns the average price of execution so far.
 stringgetBookId()

Returns the Book Id.
 stringgetBrokerId()

Returns the Broker Id.
 floatgetCash()

Returns the total money executed so far.
 stringgetDeskId()

Returns the desk Id.
 stringgetExchangeId()

Returns the exchange Id.
 dictionary<string, string>getExtraParams()

Returns the current order extraParams.
 stringgetFirewallServiceId()

Returns the service ID to use with the firewall.
 stringgetFirewallTargetServiceId()

Returns the target service associated with the firewall.
 floatgetIssueTime()

Returns time at which the order was issued.
 integergetLargestExposedQuantity()

Returns largest exposed quantity.
 floatgetLastCommissionPaid()

Returns the commission paid on last trade.
 stringgetLastCounterPartyId()

Returns the counterparty for last trade.
 floatgetLastPriceExecuted()

Returns price of the last trade.
 integergetLastQtyExecuted()

Returns the most recent trade quantity.
 floatgetLastTradeTime()

Returns the time of last trade.
 stringgetLastTradeType()

Returns the type of last trade.
 stringgetMarketId()

Returns the Market Id.
 stringgetMarketOrderId()

Returns the market order ID.
 stringgetOptionalExtraParams(string param)

This action gets the provided parameter from the set of optional extra parameters.
 stringgetOrderId()

Returns the order ID.
 stringgetOriginatorServiceInstance()

Returns the service instance of the originator.
 stringgetOriginatorServiceName()

Returns the service name of the originator.
 stringgetOriginatorServiceType()

Returns the service type of the originator.
 stringgetOwnerId()

Returns the Owner Id.
 dictionary<string, string>getPreviousExtraParams()

Returns extraParams before the most recent change.
 integergetPreviousLargestExposedQuantity()

Returns previous largest exposed quantity (before the most recent update).
 floatgetPreviousPrice()

Returns order price before the most recent change.
 integergetPreviousQtyExecuted()

Returns quantity executed before the most recent change.
 integergetPreviousQtyRemaining()

Returns quantity remaining before the most recent change.
 integergetPreviousQuantity()

Returns order total quantity before the most recent change.
 dictionary<string, string>getPreviousUserSetExtraParams()

Returns user's extraParams before the most recent change; blank if extraParams have been unchanged.
 floatgetPreviousUserSetPrice()

Returns user set price before the most recent amend was applied.
 integergetPreviousUserSetQuantity()

Returns user set quantity before the most recent amend was applied.
 floatgetPrice()

Returns the order price.
 integergetQtyExecuted()

Returns the quantity executed so far.
 integergetQtyRemaining()

Returns the remaining order quantity.
 integergetQuantity()

Returns the order quantity.
 integergetRecvId()

Returns the unique identifier of this instance of the OrderReceiverStateContainer.
 dictionary<string, string>getRejectedExtraParams()

Returns the most recent rejected extraParams.
 floatgetRejectedPrice()

Returns the most recent rejected price.
 integergetRejectedQuantity()

Returns the most recent rejected quantity.
 stringgetReservationId()

Returns the Reservation Id.
 stringgetServiceId()

Returns the service ID for the order.
 stringgetSide()

Returns the order side (BUY/SELL).
 stringgetStatus()

Returns the most recent order status message.
 com.apama.oms.NewOrdergetSubmittedNewOrder()

Returns the submitted NewOrder.
 stringgetSymbol()

Returns the order symbol.
 stringgetType()

Returns the order type (e.g. LIMIT, MARKET, IOC, etc).
 dictionary<string, string>getUserSetExtraParams()

Returns any extra parameters that the User has set.
 floatgetUserSetPrice()

Returns the current user set price (should equal current price unless there is a pending amend).
 integergetUserSetQuantity()

Returns the current user set quantity (should equal current quantity unless there is a pending amend).
 booleanhasOptionalExtraParam(string param)

This action checks whether or not the provided parameter exists in the set of optional extra parameters.
 booleanisAcknowledged()

Returns whether or not the order has been acknowledged by the market.
 booleanisAmending()

Returns whether or not an amend request is currently pending.
 booleanisBuy()

Returns whether or not this is a buy-side order.
 booleanisCancelled()

Returns whether or not the order has been cancelled.
 booleanisCancelling()

Returns whether or not a cancel request is currently pending.
 booleanisExternallyModified()

Returns whether or not the order has been modified by the market.
 booleanisFinal()

Returns whether or not the order is in a final state.
 booleanisInMarket()

Returns whether or not the order is in market.
 booleanisLargestExposedQuantityModified()

Returns whether or not the largest exposed quantity has been changed.
 booleanisModifiable()

Returns whether or not the order can be modified.
 booleanisOrderChangeRejected()

Returns whether or not the requested change (amend/cancel) was rejected.
 booleanisSell()

Returns whether or not this is a sell-side order.
 booleanisSent()

Returns whether or not the order has been sent to the market.
 booleanisUnknownState()

Returns whether or not the order is in an unknown state.
 booleanisUsingReservation()

Returns whether or not Reservation is being used.
 booleanisViaFirewall()

Returns whether or not the firewall is being used.
 booleanisVisible()

Returns whether or not the order is currently visible.
 booleanjustAcknowledged()

Returns whether or not the order has just been acknowledged.
 booleanjustAmendApplied()

Returns whether or not the most recent operation was an amend being applied.
 booleanjustAmendCommitted()

Returns whether or not the most recent change was an amend being committed.
 booleanjustAmendRejected()

Returns whether or not an amend has just been rejected.
 booleanjustCancelApplied()

Returns whether or not a cancel has just been requested.
 booleanjustCancelCommitted()

Returns whether or not a cancel has just been committed.
 booleanjustCancelRejected()

Returns whether or not a request to cancel the order has just been rejected.
 booleanjustExecuted()

Returns whether or not the last update was a trade.
 booleanjustFinal()

Returns whether or not the order has just become final.
 booleanjustNew()

Returns whether or not the order has just been placed.
 booleanjustRejected()

Returns whether or not the order has just been rejected by the firewall.
 booleanjustSoftRejected()

Returns whether or not the order has just been soft-rejected.
 voidreceiveOrder(com.apama.oms.NewOrder order, boolean logInfoAsDebug)

This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes.
 voidreceiveOrderAndSetUpdateFlag(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates)

This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
 voidreceiveOrderAndSetUpdateFlagWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, boolean notStoreExtraParams)

This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
 voidreceiveOrderParallel(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, context outputContext)

This action is used to initialise an instance of the OrderReceiverStateContainer in a separate context and also allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
 voidreceiveOrderWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean notStoreExtraParams)

This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes.
 voidreject(string reason)

This action rejects the order with the reason provided.
 voidrejectAmend(string reason)

This action is used to reject a users requested amendment.
 voidrejectCancel(string reason)

This action should be called to rejects a user's cancel request.
 voidrouteState()

This action is used to send a new update to the orders publisher, unless the order has not been acknowledged or is not already in a final state.
 voidsendUpdate(com.apama.oms.OrderUpdate updateTemplate)

This action causes an orders state to be updated based on the OrderUpdate provided, and the updated order state is then send to the orders publisher.
 voidsetExternallyModified(boolean externallyModified)

This action sets the externallyModified flag, which indicates whether or not the order has been modified externally by the market.
 voidsetExtraParams(dictionary<string, string> extraParams)

This action sets the extraParams for the order if it is in a modifiable state.
 voidsetModifiable(boolean modifiable)

This action sets the modifiable flag, which indicates whether or not the order can be modified in its current state.
 voidsetStateUnknown(boolean stateUnknown, string reason)

This action sets the order state to "unknown" or removes it from unknown state.
 voidsetStatusMessage(string message)

This action is used to override the status message on any action that may generate an OrderUpdate event. This will only take effect for the next order update that is sent, subsequent updates will not use this message.
 voidsetVisible(boolean isVisible)

This action sets the isVisible flag, which indicates whether or not the order is visible in the market or not. Non-visible orders may include those that are not yet acknowledged or dark pool orders.
 voiduserAmend(com.apama.oms.AmendOrder update)

This action is used to acknowledge that a users request to amend an order has been received. This must be committed later using #commitAmend() for the amendment to take effect.
 voiduserCancel(com.apama.oms.CancelOrder co)

This action is used to acknowledge that a users request to cancel an order has been received. This must be committed later using #commitCancel() for the cancel to take effect.
 
Action detail

_toString

string _toString()
Returns a formatted string of the current order state.
Returns:
Returns a formatted string of the current order state

acknowledge

void acknowledge(string marketOrderId)
This action acknowledges the order, which indicates that it is now in the market and eligible to be filled.
Parameters:
marketOrderId - The markets reference to the order, which may be different to the senders OrderId

canModify

boolean canModify()
This action indicates whether or not the order can be modified in its current state.
Returns:
Returns true if the order is modifiable, false otherwise

canReceive

boolean canReceive()
This action indicates whether the OrderReceiverStateContainer is in a state where it is able to handle a new order.

For example, this action will return false if the OrderReceiverStateContainer is already handling an order that has been sent to the market.
Returns:
Returns true if the OrderReceiverStateContainer can handle an order, false otherwise

commitAmend

void commitAmend(string reason)
This action is used to commit a previously applied amendment to an order. This means that the order will be in market with the new price and quantity.
Parameters:
reason - A string containing the reason/information for the amendment
See Also:
com.apama.oms.OrderReceiverStateContainer#userAmend() - This action is used for amendments from a User.
com.apama.oms.OrderReceiverStateContainer#externalAmend() - This action is used for amendments from an external source
com.apama.oms.OrderReceiverStateContainer#rejectAmend() - This action rejects an AmendOrder request.

commitCancel

void commitCancel(string reason)
This action commits a cancel, removing the order from market. If userCancel was not called before this the cancellation is considered an external modification.
Parameters:
reason - A string containing the reason that the order was cancelled.
See Also:
com.apama.oms.OrderReceiverStateContainer#userCancel() - This action is called to acknowledge a CancelOrder request from a user.

connectionDisconnected

void connectionDisconnected(string description)
This action can be used to reports that the receiver has lost connection to the publisher. If the order was in a modifiable state, it will set the order state to "unknown" and "externally modified", before committing a cancellation of the order.
Parameters:
description - A string containing a description/reason for the connection failure

externalAmend

void externalAmend(float price, integer qty, dictionary<string, string> extraParams)
This action is used to an external amendment to an order (e.g. from the exchange side). This must be committed later using #commitAmend() for the amendment to take effect.
Parameters:
price - The new order price. If no changes are required, the current order price must be used
qty - The new order quantity. If no changes are required, the current order quantity must be used
extraParams - The new extraParams for the amendment.
See Also:
com.apama.oms.OrderReceiverStateContainer#commitAmend() - This action commits the amendment to the order
com.apama.oms.OrderReceiverStateContainer#userAmend() - This action is used for amendments from a User.
com.apama.oms.OrderReceiverStateContainer#rejectAmend() - This action rejects an AmendOrder request.

fill

void fill(float price, integer qty)
This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. If the order has been fully filled, then the orders "final" flag is enabled.
Parameters:
price - The trade price
qty - The quantity executed for this fill
See Also:
com.apama.oms.OrderReceiverStateContainer#fillWithOptionalFinalise() - This action fills an order in the same way, but optionally sets the orders "final" flag.

fillAndCommitCancel

void fillAndCommitCancel(float price, integer qty, string reason)
This action partially fills an order at the price and quantity specified, and commits a cancellation of the remaining quantity. This can be used to report the last fill on a market order.
Parameters:
price - The trade price
qty - The quantity executed for this fill
reason - A string containing the reason that the order was cancelled.
See Also:
com.apama.oms.OrderReceiverStateContainer#fill() - This action fills an order

fillWithCounterparty

void fillWithCounterparty(float price, integer qty, string counterparty)
This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher reporting the counterparty.
Parameters:
price - The trade price
qty - The quantity executed for this fill
counterparty - The counterparty executed for this fill
See Also:
com.apama.oms.OrderReceiverStateContainer#fillWithOptionalFinalise() - This action fills an order in the same way, but optionally sets the orders "final" flag.

fillWithOptionalFinalise

void fillWithOptionalFinalise(float price, integer qty, boolean setFinalIfQtyRemaining0)
This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. The orders "final" flag is optionally enabled when the order has been fully filled.
Parameters:
price - The trade price
qty - The quantity executed for this fill
setFinalIfQtyRemaining0 - If true, when the order is fully filled the "final" flag is enabled. Otherwise the "final" flag is unchanged.
See Also:
com.apama.oms.OrderReceiverStateContainer#fill() - This action fills an order in the same way, but always sets the orders "final" flag.

getAvgPrice

float getAvgPrice()
Returns the average price of execution so far.
Returns:
Returns the average price of execution so far, false otherwise

getBookId

string getBookId()
Returns the Book Id.
Returns:
Returns the Book Id

getBrokerId

string getBrokerId()
Returns the Broker Id.
Returns:
Returns the Broker Id

getCash

float getCash()
Returns the total money executed so far.
Returns:
Returns the total money executed so far

getDeskId

string getDeskId()
Returns the desk Id.
Returns:
Returns the desk Id

getExchangeId

string getExchangeId()
Returns the exchange Id.
Returns:
Returns the exchange Id

getExtraParams

dictionary<string, string> getExtraParams()
Returns the current order extraParams.
Returns:
Returns the current order extraParams

getFirewallServiceId

string getFirewallServiceId()
Returns the service ID to use with the firewall.
Returns:
Returns the service ID to use with the firewall

getFirewallTargetServiceId

string getFirewallTargetServiceId()
Returns the target service associated with the firewall.
Returns:
Returns the target service associated with the firewall

getIssueTime

float getIssueTime()
Returns time at which the order was issued.
Returns:
Returns time at which the order was issued

getLargestExposedQuantity

integer getLargestExposedQuantity()
Returns largest exposed quantity.
Returns:
Returns largest exposed quantity

getLastCommissionPaid

float getLastCommissionPaid()
Returns the commission paid on last trade.
Returns:
Returns the commission paid on last trade

getLastCounterPartyId

string getLastCounterPartyId()
Returns the counterparty for last trade.
Returns:
Returns the counterparty for last trade

getLastPriceExecuted

float getLastPriceExecuted()
Returns price of the last trade.
Returns:
Returns price of the last trade

getLastQtyExecuted

integer getLastQtyExecuted()
Returns the most recent trade quantity.
Returns:
Returns the most recent trade quantity

getLastTradeTime

float getLastTradeTime()
Returns the time of last trade.
Returns:
Returns the time of last trade

getLastTradeType

string getLastTradeType()
Returns the type of last trade.
Returns:
Returns the type of last trade

getMarketId

string getMarketId()
Returns the Market Id.
Returns:
Returns the Market Id

getMarketOrderId

string getMarketOrderId()
Returns the market order ID.
Returns:
Returns the market order ID

getOptionalExtraParams

string getOptionalExtraParams(string param)
This action gets the provided parameter from the set of optional extra parameters.
Parameters:
param - The extraParams key to look for
Returns:
Returns the value of the optional extraparam provided, or an empty string if the parameter was not found
See Also:
com.apama.oms.OrderReceiverStateContainer#hasOptionalExtraParam() - This action checks whether or not parameter provided exists in the set of optional extraparams

getOrderId

string getOrderId()
Returns the order ID.
Returns:
Returns the order ID

getOriginatorServiceInstance

string getOriginatorServiceInstance()
Returns the service instance of the originator.
Returns:
Returns the service instance of the originator

getOriginatorServiceName

string getOriginatorServiceName()
Returns the service name of the originator.
Returns:
Returns the service name of the originator

getOriginatorServiceType

string getOriginatorServiceType()
Returns the service type of the originator.
Returns:
Returns the service type of the originator

getOwnerId

string getOwnerId()
Returns the Owner Id.
Returns:
Returns the Owner Id

getPreviousExtraParams

dictionary<string, string> getPreviousExtraParams()
Returns extraParams before the most recent change.
Returns:
Returns extraParams before the most recent change

getPreviousLargestExposedQuantity

integer getPreviousLargestExposedQuantity()
Returns previous largest exposed quantity (before the most recent update).
Returns:
Returns previous largest exposed quantity (before the most recent update)

getPreviousPrice

float getPreviousPrice()
Returns order price before the most recent change.
Returns:
Returns order price before the most recent change

getPreviousQtyExecuted

integer getPreviousQtyExecuted()
Returns quantity executed before the most recent change.
Returns:
Returns quantity executed before the most recent change

getPreviousQtyRemaining

integer getPreviousQtyRemaining()
Returns quantity remaining before the most recent change.
Returns:
Returns quantity remaining before the most recent change

getPreviousQuantity

integer getPreviousQuantity()
Returns order total quantity before the most recent change.
Returns:
Returns order total quantity before the most recent change

getPreviousUserSetExtraParams

dictionary<string, string> getPreviousUserSetExtraParams()
Returns user's extraParams before the most recent change; blank if extraParams have been unchanged.
Returns:
Returns user's extraParams before the most recent change; blank if extraParams have been unchanged.

getPreviousUserSetPrice

float getPreviousUserSetPrice()
Returns user set price before the most recent amend was applied.
Returns:
Returns user set price before the most recent amend was applied

getPreviousUserSetQuantity

integer getPreviousUserSetQuantity()
Returns user set quantity before the most recent amend was applied.
Returns:
Returns user set quantity before the most recent amend was applied

getPrice

float getPrice()
Returns the order price.
Returns:
Returns the order price

getQtyExecuted

integer getQtyExecuted()
Returns the quantity executed so far.
Returns:
Returns the quantity executed so far

getQtyRemaining

integer getQtyRemaining()
Returns the remaining order quantity.
Returns:
Returns the remaining order quantity

getQuantity

integer getQuantity()
Returns the order quantity.
Returns:
Returns the order quantity

getRecvId

integer getRecvId()
Returns the unique identifier of this instance of the OrderReceiverStateContainer.
Returns:
Returns the unique identifier of this instance of the OrderReceiverStateContainer

getRejectedExtraParams

dictionary<string, string> getRejectedExtraParams()
Returns the most recent rejected extraParams.
Returns:
Returns the most recent rejected extraParams

getRejectedPrice

float getRejectedPrice()
Returns the most recent rejected price.
Returns:
Returns the most recent rejected price

getRejectedQuantity

integer getRejectedQuantity()
Returns the most recent rejected quantity.
Returns:
Returns the most recent rejected quantity

getReservationId

string getReservationId()
Returns the Reservation Id.
Returns:
Returns the Reservation Id

getServiceId

string getServiceId()
Returns the service ID for the order.
Returns:
Returns the service ID for the order

getSide

string getSide()
Returns the order side (BUY/SELL).
Returns:
Returns the order side (BUY/SELL)

getStatus

string getStatus()
Returns the most recent order status message.
Returns:
Returns the most recent order status message

getSubmittedNewOrder

com.apama.oms.NewOrder getSubmittedNewOrder()
Returns the submitted NewOrder.
Returns:
Returns the submitted NewOrder

getSymbol

string getSymbol()
Returns the order symbol.
Returns:
Returns the order symbol

getType

string getType()
Returns the order type (e.g. LIMIT, MARKET, IOC, etc).
Returns:
Returns the order type (e.g. LIMIT, MARKET, IOC, etc)

getUserSetExtraParams

dictionary<string, string> getUserSetExtraParams()
Returns any extra parameters that the User has set.
Returns:
Returns any extra parameters that the User has set

getUserSetPrice

float getUserSetPrice()
Returns the current user set price (should equal current price unless there is a pending amend).
Returns:
Returns the current user set price

getUserSetQuantity

integer getUserSetQuantity()
Returns the current user set quantity (should equal current quantity unless there is a pending amend).
Returns:
Returns the current user set quantity

hasOptionalExtraParam

boolean hasOptionalExtraParam(string param)
This action checks whether or not the provided parameter exists in the set of optional extra parameters.
Parameters:
param - The extraParams key to look for
Returns:
Returns true if the parameter exists, false otherwise
See Also:
com.apama.oms.OrderReceiverStateContainer#getOptionalExtraParams() - This action returns the value of the optional extra parameter provided

isAcknowledged

boolean isAcknowledged()
Returns whether or not the order has been acknowledged by the market.
Returns:
Returns true if the order has been acknowledged by the market, false otherwise

isAmending

boolean isAmending()
Returns whether or not an amend request is currently pending.
Returns:
Returns true if an amend request is currently pending, false otherwise

isBuy

boolean isBuy()
Returns whether or not this is a buy-side order.
Returns:
Returns true if this is a buy-side order, false otherwise

isCancelled

boolean isCancelled()
Returns whether or not the order has been cancelled.
Returns:
Returns true if the order has been cancelled, false otherwise

isCancelling

boolean isCancelling()
Returns whether or not a cancel request is currently pending.
Returns:
Returns true if a cancel request is currently pending, false otherwise

isExternallyModified

boolean isExternallyModified()
Returns whether or not the order has been modified by the market.
Returns:
Returns true if the order has been modified by the market, false otherwise

isFinal

boolean isFinal()
Returns whether or not the order is in a final state.
Returns:
Returns true if the order is in a final state, false otherwise

isInMarket

boolean isInMarket()
Returns whether or not the order is in market.
Returns:
Returns true if the order is in market, false otherwise

isLargestExposedQuantityModified

boolean isLargestExposedQuantityModified()
Returns whether or not the largest exposed quantity has been changed.
Returns:
Returns true if the largest exposed quantity has been changed, false otherwise

isModifiable

boolean isModifiable()
Returns whether or not the order can be modified.
Returns:
Returns true if the order can be modified, false otherwise

isOrderChangeRejected

boolean isOrderChangeRejected()
Returns whether or not the requested change (amend/cancel) was rejected.
Returns:
Returns true if the requested change (amend/cancel) was rejected, false otherwise

isSell

boolean isSell()
Returns whether or not this is a sell-side order.
Returns:
Returns true if this is a sell-side order, false otherwise

isSent

boolean isSent()
Returns whether or not the order has been sent to the market.
Returns:
Returns true if the order has been sent to the market, false otherwise

isUnknownState

boolean isUnknownState()
Returns whether or not the order is in an unknown state.
Returns:
Returns true if the order is in an unknown state, false otherwise

isUsingReservation

boolean isUsingReservation()
Returns whether or not Reservation is being used.
Returns:
Returns true if Reservation is being used

isViaFirewall

boolean isViaFirewall()
Returns whether or not the firewall is being used.
Returns:
Returns true if the firewall is being used, false otherwise

isVisible

boolean isVisible()
Returns whether or not the order is currently visible.
Returns:
Returns true if the order is currently visible, false otherwise

justAcknowledged

boolean justAcknowledged()
Returns whether or not the order has just been acknowledged.
Returns:
Returns true if the order has just been acknowledged, false otherwise

justAmendApplied

boolean justAmendApplied()
Returns whether or not the most recent operation was an amend being applied.
Returns:
Returns true if the most recent operation was an amend being applied, false otherwise

justAmendCommitted

boolean justAmendCommitted()
Returns whether or not the most recent change was an amend being committed.
Returns:
Returns true if the most recent change was an amend being committed, false otherwise

justAmendRejected

boolean justAmendRejected()
Returns whether or not an amend has just been rejected.
Returns:
Returns true if an amend has just been rejected, false otherwise

justCancelApplied

boolean justCancelApplied()
Returns whether or not a cancel has just been requested.
Returns:
Returns true if a cancel has just been requested, false otherwise

justCancelCommitted

boolean justCancelCommitted()
Returns whether or not a cancel has just been committed.
Returns:
Returns true if a cancel has just been committed, false otherwise

justCancelRejected

boolean justCancelRejected()
Returns whether or not a request to cancel the order has just been rejected.
Returns:
Returns true if a request to cancel the order has just been rejected, false otherwise

justExecuted

boolean justExecuted()
Returns whether or not the last update was a trade.
Returns:
Returns true if the last update was a trade, false otherwise

justFinal

boolean justFinal()
Returns whether or not the order has just become final.
Returns:
Returns true if the order has just become final, false otherwise

justNew

boolean justNew()
Returns whether or not the order has just been placed.
Returns:
Returns true if the order has just been placed, false otherwise

justRejected

boolean justRejected()
Returns whether or not the order has just been rejected by the firewall.
Returns:
Returns true if the order has just been rejected by the firewall, false otherwise

justSoftRejected

boolean justSoftRejected()
Returns whether or not the order has just been soft-rejected.
Returns:
Returns true if the order has just been soft-rejected, false otherwise

receiveOrder

void receiveOrder(com.apama.oms.NewOrder order, boolean logInfoAsDebug)
This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes.
Parameters:
order - The com.apama.oms.NewOrder to be handled
logInfoAsDebug - Allows INFO-level logging to be suppressed to DEBUG output
See Also:
com.apama.oms.OrderReceiverStateContainer#receiveOrderAndSetUpdateFlag() - This action is also used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes

receiveOrderAndSetUpdateFlag

void receiveOrderAndSetUpdateFlag(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates)
This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
Parameters:
order - The com.apama.oms.NewOrder to be handled
logInfoAsDebug - Allows INFO-level logging to be suppressed to DEBUG output
produceUpdates - If false, order updates are not sent when the order changes.
See Also:
com.apama.oms.OrderReceiverStateContainer#receiveOrder() - This action is also used to initialise an instance of the OrderReceiverStateContainer, but always sends OrderUpdates when the state of the order changes

receiveOrderAndSetUpdateFlagWithOutExtraParams

void receiveOrderAndSetUpdateFlagWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, boolean notStoreExtraParams)
This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.

It also allows the caller to choose whether the extraParams are to be cached.
Parameters:
order - The com.apama.oms.NewOrder to be handled
logInfoAsDebug - Allows INFO-level logging to be suppressed to DEBUG output
produceUpdates - If false, order updates are not sent when the order changes.
notStoreExtraParams - If true, extraParams are not cached.
See Also:
com.apama.oms.OrderReceiverStateContainer#receiveOrderWithOutExtraParams() - This action is also used to initialise an instance of the OrderReceiverStateContainer, but always sends OrderUpdates when the state of the order changes. The extraParams are not cached locally.
com.apama.oms.OrderReceiverStateContainer#receiveOrderAndSetUpdateFlag() - This action is also used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes. The extraParams are also cached.

receiveOrderParallel

void receiveOrderParallel(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, context outputContext)
This action is used to initialise an instance of the OrderReceiverStateContainer in a separate context and also allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
Parameters:
order - The com.apama.oms.NewOrder to be handled
logInfoAsDebug - Allows INFO-level logging to be suppressed to DEBUG output
produceUpdates - If false, order updates are not sent when the order changes.
outputContext - The context to which the output events are to be sent.
See Also:
com.apama.oms.OrderReceiverStateContainer#receiveOrderWithOutExtraParams() - This action is also used to initialise an instance of the OrderReceiverStateContainer, but always sends OrderUpdates when the state of the order changes. The extraParams are not cached locally.
com.apama.oms.OrderReceiverStateContainer#receiveOrderAndSetUpdateFlag() - This action is also used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes. The extraParams are also cached.

receiveOrderWithOutExtraParams

void receiveOrderWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean notStoreExtraParams)
This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes.

It also allows the caller to choose whether the extraParams are to be cached locally.
Parameters:
order - The com.apama.oms.NewOrder to be handled
logInfoAsDebug - Allows INFO-level logging to be suppressed to DEBUG output
notStoreExtraParams - If true, extraParams are not cached.
See Also:
com.apama.oms.OrderReceiverStateContainer#receiveOrder() - This action is also used to initialise an instance of the OrderReceiverStateContainer, but always sends OrderUpdates when the state of the order changes

reject

void reject(string reason)
This action rejects the order with the reason provided.
Parameters:
reason - A string containing the reason that the order was rejected.
See Also:
com.apama.oms.OrderReceiverStateContainer#commitCancel() - This action cancels an order, removing the order from market.

rejectAmend

void rejectAmend(string reason)
This action is used to reject a users requested amendment.
Parameters:
reason - A string containing the reason for rejecting the amendment
See Also:
com.apama.oms.OrderReceiverStateContainer#userAmend() - This action is used for amendments from a User.
com.apama.oms.OrderReceiverStateContainer#externalAmend() - This action is used for amendments from an external source
com.apama.oms.OrderReceiverStateContainer#rejectAmend() - This action rejects an AmendOrder request.

rejectCancel

void rejectCancel(string reason)
This action should be called to rejects a user's cancel request.
Parameters:
reason - A string containing the reason that the Cancel was rejected
See Also:
com.apama.oms.OrderReceiverStateContainer#userCancel() - This action is called to acknowledge a CancelOrder request from a user.

routeState

void routeState()
This action is used to send a new update to the orders publisher, unless the order has not been acknowledged or is not already in a final state.

This can be useful to ensure that the order is in a consistent state after a number of changes have been made.

sendUpdate

void sendUpdate(com.apama.oms.OrderUpdate updateTemplate)
This action causes an orders state to be updated based on the OrderUpdate provided, and the updated order state is then send to the orders publisher.
Parameters:
updateTemplate - The OrderUpdate event whose state should be to be applied to the current order
See Also:
com.apama.oms.OrderUpdate - The order update event

setExternallyModified

void setExternallyModified(boolean externallyModified)
This action sets the externallyModified flag, which indicates whether or not the order has been modified externally by the market.
Parameters:
externallyModified - Set to true if the order has been modified externally by the market, false otherwise

setExtraParams

void setExtraParams(dictionary<string, string> extraParams)
This action sets the extraParams for the order if it is in a modifiable state.
Parameters:
extraParams - A dictionary of the new extra params

setModifiable

void setModifiable(boolean modifiable)
This action sets the modifiable flag, which indicates whether or not the order can be modified in its current state.
Parameters:
modifiable - Set to true if the order can be modified, false otherwise

setStateUnknown

void setStateUnknown(boolean stateUnknown, string reason)
This action sets the order state to "unknown" or removes it from unknown state.
Parameters:
stateUnknown - A boolean indicating whether to set the order to an "unknown" state or not
reason - A string containing the reason for the state change

setStatusMessage

void setStatusMessage(string message)
This action is used to override the status message on any action that may generate an OrderUpdate event. This will only take effect for the next order update that is sent, subsequent updates will not use this message.
Parameters:
message - A string containing the new status message. An empty string indicates that the status should not be overridden

setVisible

void setVisible(boolean isVisible)
This action sets the isVisible flag, which indicates whether or not the order is visible in the market or not. Non-visible orders may include those that are not yet acknowledged or dark pool orders.
Parameters:
isVisible - Set to true if the order is visible, false otherwise

userAmend

void userAmend(com.apama.oms.AmendOrder update)
This action is used to acknowledge that a users request to amend an order has been received. This must be committed later using #commitAmend() for the amendment to take effect.
Parameters:
update - The AmendOrder event to be applied
See Also:
com.apama.oms.OrderReceiverStateContainer#commitAmend() - This action commits the amendment to the order
com.apama.oms.OrderReceiverStateContainer#externalAmend() - This action is used for amendments from an external source
com.apama.oms.OrderReceiverStateContainer#rejectAmend() - This action rejects an AmendOrder request.

userCancel

void userCancel(com.apama.oms.CancelOrder co)
This action is used to acknowledge that a users request to cancel an order has been received. This must be committed later using #commitCancel() for the cancel to take effect.
Parameters:
co - The com.apama.oms.CancelOrder event specifying the order to cancel
See Also:
com.apama.oms.OrderReceiverStateContainer#commitCancel() - This action cancels an order, removing the order from market.
com.apama.oms.OrderReceiverStateContainer#rejectCancel() - This action rejects a CancelOrder request.