use of org.compiere.model.X_AD_AlertProcessor in project adempiere by adempiere.
the class AlertTest method testAlertCreation.
/**
* Run
*/
public void testAlertCreation() throws Exception {
log.info("trx = " + getTrxName());
boolean resultSave = false;
//----- Old way:
MAlert alertOldWay = new MAlert(Env.getCtx(), 100, getTrxName());
log.info(alertOldWay.toString());
X_AD_AlertProcessor alertProcessorOldWay = new X_AD_AlertProcessor(Env.getCtx(), alertOldWay.getAD_AlertProcessor_ID(), getTrxName());
log.info("alertProcessorOldWay.getAD_AlertProcessor_ID = " + alertProcessorOldWay.getAD_AlertProcessor_ID());
alertOldWay.setDescription("Trifon test");
//--- Save;
resultSave = alertOldWay.save();
log.info("resultSave = " + resultSave);
System.out.println("New value of Description = " + alertOldWay.getDescription());
//----- New way:
/* I_AD_Alert alert = new MAlert(Env.getCtx(), 100, trx.getTrxName());
log.info(alert.toString());
I_AD_AlertProcessor alertProcessor = alert.getI_AD_AlertProcessor();
log.info("I_AD_AlertProcessor.getAD_AlertProcessor_ID = " + alertProcessor.getAD_AlertProcessor_ID());
log.info("alert.getAD_AlertProcessor_ID = " + alert.getAD_AlertProcessor_ID());
alert.setDescription("Trifon Description modified!");
//--- Save; PO.save(PO) must be static method!!! Two way of usage: PO.save(Object) or PO.save(PO)
//resultSave = PO.save((PO)alert);
resultSave = PO.save(alert); // Overloaded save method; For simple usage!
log.info("resultSave = " + resultSave);
System.out.println("New value of Description = " + alert.getDescription());
*/
commit();
}
Aggregations