New sample of GardenWorld MyValidator to work correctly with new events
This commit is contained in:
parent
ada57fd26c
commit
501eca17d5
|
@ -57,9 +57,12 @@ public class MyValidator implements ModelValidator
|
||||||
log.info(client.toString());
|
log.info(client.toString());
|
||||||
|
|
||||||
// We want to be informed when C_Order is created/changed
|
// We want to be informed when C_Order is created/changed
|
||||||
engine.addModelChange("C_Order", this);
|
engine.addModelChange(MOrder.Table_Name, this);
|
||||||
// We want to validate Order before preparing
|
// We want to validate Order before preparing
|
||||||
engine.addDocValidate("C_Order", this);
|
engine.addDocValidate(MOrder.Table_Name, this);
|
||||||
|
engine.addDocValidate(MInOut.Table_Name, this);
|
||||||
|
engine.addDocValidate(MPayment.Table_Name, this);
|
||||||
|
engine.addDocValidate(MCash.Table_Name, this);
|
||||||
} // initialize
|
} // initialize
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,10 +95,12 @@ public class MyValidator implements ModelValidator
|
||||||
*/
|
*/
|
||||||
public String docValidate (PO po, int timing)
|
public String docValidate (PO po, int timing)
|
||||||
{
|
{
|
||||||
|
log.info(po.get_TableName() + " Timing: "+timing);
|
||||||
// Ignore all after Complete events
|
// Ignore all after Complete events
|
||||||
if (timing == TIMING_AFTER_COMPLETE)
|
if (timing == TIMING_AFTER_COMPLETE)
|
||||||
return null;
|
return null;
|
||||||
// TIMING_BEFORE_PREPARE
|
|
||||||
|
if (timing == TIMING_BEFORE_PREPARE) {
|
||||||
if (po.get_TableName().equals(MOrder.Table_Name))
|
if (po.get_TableName().equals(MOrder.Table_Name))
|
||||||
{
|
{
|
||||||
/** Order Discount Example *
|
/** Order Discount Example *
|
||||||
|
@ -106,6 +111,8 @@ public class MyValidator implements ModelValidator
|
||||||
/** Order Discount Example */
|
/** Order Discount Example */
|
||||||
log.info(po.toString());
|
log.info(po.toString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
} // docValidate
|
} // docValidate
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue