Order Change State Messages

The following trade model and set of messages describe the fields and values required to successfully change the state of an existing order, using the FX Professional Motif. For each of the messages below, [c] denotes that the message is sent by the client, [s] denotes that the message is sent by the server.

Architecture

For the front-end client, the trade model library handles the processing of these messages. Streamlinkis used to send messages to the back end. For Change Active State there are two messages that the client can send:

  • the first is the message containing the order and the new state that it should change to.

  • the second message is tailored for a very specific scenario. When a change state is requested, the server normally takes a few seconds to confirm whether or not this was successful, sometimes however the time taken to process the request can take a much longer amount of time, in these cases the client must wait the entire duration of the timeout before being able to submit another order change, or generally - interact with the blotter. The second message allows the client to send a message which will cancel the timeout, from which point onwards the client can resume normal interaction with the front end again, but will need to monitor the progress of the change state via the orders blotter.

For the back-end adapters, the FXIntegrationAPI consumes the client messages. The requests for Change Active State are handled by an adapter that instantiates the FXOrdersAdapter object and registers an OrderChangeActiveStateListener (See the FX Integration API documentation for more information on Adapters). The state change is handled by the FX Integration API using the ChangeState object. The object contains the Responders and Events required to transition the trade model to the final state.

Trade Model State Diagram

orderChangeStateTradeModel

Blue arrows denote client messages and timeout messages, green arrows denote messages sent by the server.

ChangeState Message [c]

Field Name Description Example

RequestID

The client generated ID

112314243333

MsgType

The transition that the client wants to make in the state model

ChangeState

OrderID

The order ID of the order that is supposed to be activated/deactivated

1374143013248_2

NewState

The new state that we would like the order to switch to

Active, Inactive

ParentID

[optional] If order has a parent order, this is the ID of the parent order.

1374143013248

CancelWait Message [c]

This is the message that the client sends in order to cancel the default timeout period for waiting for a response from the server about the progress of the state change.

Field Name Value Example

RequestID

The request ID of the original ChangeState message

112314243333

MsgType

The transition that the client wants to make in the state model

CancelWait

ChangeStateAck Message [s]

This is the message the server sends in order to acknowledge that the Change State message has been received by the back-end adapters.

Field Name Value Example

RequestID

The request ID of the original ChangeState message

112314243333

MsgType

The transition that the server wants to make in the state model

ChangeStateAck

ChangeStateReject Message [s]

This is the message the server sends which confirms that the change state request has been rejected by the back-end trading system.

Field Name Value Example

RequestID

The request ID of the original ChangeState message

112314243333

MsgType

The transition that the server wants to make in the state model

ChangeStateReject

ChangeStateConfirm Message [s]

This is the message the server sends which confirms that the change state request has been successfully executed in the back-end trading system.

Field Name Value Example

RequestID

The request ID of the original ChangeState message

112314243333

MsgType

The transition that the server wants to make in the state model

ChangeStateConfirm

ChangeStatePending Message [s]

This is the message the server sends which tells the client that the change state request could not be confirmed now, but will be later as it is either being held, or processed in the back-end trading system.

Field Name Value Example

RequestID

The request ID of the original ChangeState message

112314243333

MsgType

The transition that the server wants to make in the state model

ChangeStatePending