Download Reference Manual

Transcript
318
* Each action defined should be registered with following static block.
* Ex:- If new action is created with the name "approveOrder", it should
* be registered with this class in static block using putAction("approveOrder")
*/
static {
putAction("getAllOpenOrders");
putAction("createNewOrder");
putAction("updateOrder");
putAction("deleteOrder");
}
/**
* This is method is used invoke the particular action based
* on the parameter action.
* Ex:- If parameter action comes with value "updateOrder" from flex UI then
* "updateOrder" method will be invoked in this method.
*/
public Object invoke(String action, java.util.Map args) throws Exception {
Object response = "";
if ("getAllOpenOrders".equals(action))
response = getAllOpenOrders(args);
else if ("createNewOrder".equals(action))
response = createNewOrder(args);
else if ("updateOrder".equals(action))
response = updateOrder(args);
else if ("deleteOrder".equals(action))
response = deleteOrder(args);
return response;
}
/**
* Retrieves all open orders and build the usable XML, one of the
response xml form is
* <Orders>
*
<Order>
*
<id></id>
*
<date></date>
*
</Order>
*
<Order>
*
...
*
</Order>
*
.....
* </Orders>
* @param args
* @return
* @throws Exception
Copyright, InSync Software, Inc.
iApp User Guide
Confidential