b***@hotmail.com
2006-10-28 20:42:59 UTC
Hi,guys. I have a problem when I try to custmize the return command.
I have created a wrapper command and put required commandcontex and propertie to call ReturnItemAdd command. After command excuted, there is no exception throwed out, and I can get the rma Id and rmaItem Id. However, I cannot find those id in database. So weird!
Belows is the sample code, please help!
if(orderItemId != null)
property.put("orderItemId_" + j, orderItemId);
else
property.put("catEntryId_" + j, catentryId);
property.put("quantity_" + j, returnQuantity);
if(raId==null)
property.put("RMAId", "**");
else property.put("RMAId",raId);
property.put("reason_" + j, defaultReturnReason);
property.put("forUserId", oAB.getMemberId());
property.put("outRMAName","RMAId");
property.put("URL", "");
ReturnItemAddCmd returnItemAdd = (ReturnItemAddCmd)CommandFactory.createCommand(ReturnItemAddCmd.NAME, getCommandContext().getStoreId());
if(returnItemAdd == null)
{
ECTrace.trace(25L, getClass().getName(), "executeReturnItemAdd", "No ReturnItemAddCmd instance");
throw new ECApplicationException(ECMessage._ERR_CMD_CMD_NOT_FOUND, getClass().getName(), "executeReturnItemAdd");
} else
{
tempCmdContext.setLanguage("-1");
tempCmdContext.setStoreId(new Integer(storeentId));
tempCmdContext.setRequestProperties(property);
returnItemAdd.setCommandContext(tempCmdContext);
returnItemAdd.setRequestProperties(property);
// ECTrace.trace(25L, getClass().getName(), "executeReturnItemAdd", "ReturnItemAddCmd request property: " + traceFormat(property));
returnItemAdd.execute();
raId=returnItemAdd.getResponseProperties().get("RMAId").toString();
I have created a wrapper command and put required commandcontex and propertie to call ReturnItemAdd command. After command excuted, there is no exception throwed out, and I can get the rma Id and rmaItem Id. However, I cannot find those id in database. So weird!
Belows is the sample code, please help!
if(orderItemId != null)
property.put("orderItemId_" + j, orderItemId);
else
property.put("catEntryId_" + j, catentryId);
property.put("quantity_" + j, returnQuantity);
if(raId==null)
property.put("RMAId", "**");
else property.put("RMAId",raId);
property.put("reason_" + j, defaultReturnReason);
property.put("forUserId", oAB.getMemberId());
property.put("outRMAName","RMAId");
property.put("URL", "");
ReturnItemAddCmd returnItemAdd = (ReturnItemAddCmd)CommandFactory.createCommand(ReturnItemAddCmd.NAME, getCommandContext().getStoreId());
if(returnItemAdd == null)
{
ECTrace.trace(25L, getClass().getName(), "executeReturnItemAdd", "No ReturnItemAddCmd instance");
throw new ECApplicationException(ECMessage._ERR_CMD_CMD_NOT_FOUND, getClass().getName(), "executeReturnItemAdd");
} else
{
tempCmdContext.setLanguage("-1");
tempCmdContext.setStoreId(new Integer(storeentId));
tempCmdContext.setRequestProperties(property);
returnItemAdd.setCommandContext(tempCmdContext);
returnItemAdd.setRequestProperties(property);
// ECTrace.trace(25L, getClass().getName(), "executeReturnItemAdd", "ReturnItemAddCmd request property: " + traceFormat(property));
returnItemAdd.execute();
raId=returnItemAdd.getResponseProperties().get("RMAId").toString();