Thursday, November 13, 2014

OverRide OOB outbound order XML to write to a table !!

If we need OverRide OOB outbound order XML process to write to a table, please find the below steps:

1. Create an EJB for a custom table XOrderTransfer table.
2. Override wc-component-client.xml as mentioned below
3. Override class as mentioned below.
4. In WC adminconsole, set up a broadcast job for the command "RaiseECEvent"

OverRide XML:
C:\IBM\WCDE_ENT70\workspace\WC\xml\config\com.ibm.commerce.order.external-ext\wc-component-client.xml

<_config:DevelopmentClientConfiguration xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-component-client.xsd">
<_config:invocationservice>

<_config:invocationbinding
bindingImpl="com.custom.commerce.foundation.internal.client.services.invocation.impl.CustomJCAInvocationBindingImpl">
</_config:invocationbinding>

<_config:action name="ProcessOrder" asynchronous="false">
</_config:action>

</_config:invocationservice>
</_config:DevelopmentClientConfiguration>


public class CustomJCAInvocationBindingImpl extends JCAInvocationBindingImpl implements InvocationBinding {

public InvocationServiceObject invoke(Action action, InvocationServiceObject requestDataObject) throws InvocationServiceException {
final String methodName = "invoke";
LOGGER.entering(CLASSNAME, methodName);
String inputXML = new String(requestDataObject.getXML());
//get the orderId from the request data object
ProcessOrderType processOrderType = (ProcessOrderType) requestDataObject.getDataObject();
OrderType currentOrder = (OrderType)processOrderType.getDataArea().getOrder().get(0);
String orderId = currentOrder.getOrderIdentifier().getUniqueID();
Long orderIdLong = new Long(orderId);

//persist the order XML in the XORDERTransfer table.
XOrderTransferAccessBean orderTransferAB = new XOrderTransferAccessBean(orderIdLong, inputXML);
orderTransferAB.setInsertedTime(TimestampHelper.now());
orderTransferAB.setProcessedFlag('0');
orderTransferAB.commitCopyHelper();

//invoke super class's implementation for actual message transfer
InvocationServiceObject invocationServiceObject = super.invoke(action, requestDataObject);

LOGGER.exiting(CLASSNAME, methodName);
return invocationServiceObject;
}

5 comments:

  1. The standard span of these credits is only fourteen days and such advances are taken to meet costs till the following payday. These sorts of advances are commonly include little sums running from £500 to about £1000. Payday credits are otherwise called loan and the financing cost is on the higher side.

    ReplyDelete
  2. In addition, this advance office is generally served under the classification of unsecured advance, where the borrower appreciates the opportunity of no security accommodation.

    ReplyDelete
  3. To the extent the reimbursement is concerned, the borrower require just present a post dated check to the moneylender at the season of credit endorsement.

    ReplyDelete
  4. When it comes time to pay your duties, you require that cash now, since Uncle Sam isn't the sort to take pardons.

    ReplyDelete
  5. Looking for a dependable source is a sorry bother with this credit design as the significant hazard factor is on the moneylender's side.

    ReplyDelete