exception handling processIt on CopyOrder.java

This commit is contained in:
Edwin Ang 2012-04-09 15:04:56 +07:00
parent 4f5cefbff2
commit d14c3fd4c2
1 changed files with 11 additions and 2 deletions

View File

@ -94,10 +94,19 @@ public class CopyOrder extends SvrProcess
{
MOrder original = new MOrder (getCtx(), p_C_Order_ID, get_TrxName());
original.setDocAction(MOrder.DOCACTION_Complete);
original.processIt(MOrder.DOCACTION_Complete);
if (!original.processIt(MOrder.DOCACTION_Complete)) {
log.warning("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg());
throw new IllegalStateException("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg());
}
original.saveEx();
original.setDocAction(MOrder.DOCACTION_Close);
original.processIt(MOrder.DOCACTION_Close);
if (!original.processIt(MOrder.DOCACTION_Close)) {
log.warning("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg());
throw new IllegalStateException("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg());
}
original.saveEx();
}
//