Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Codeblock
package org.nuclet.company; 

import java.util.List;
import org.nuclos.api.rule.UpdateRule; 
import org.nuclos.api.context.UpdateContext; 
import org.nuclos.api.annotation.Rule; 
import org.nuclos.api.exception.BusinessException; 

/** @name        
  * @description 
  * @usage       
  * @change      
*/
@Rule(name="UpdateBestellungUpdateFinalBestellung", description="UpdateBestellungUpdateFinalBestellung")
public class UpdateBestellungUpdateFinalBestellung implements UpdateRuleUpdateFinalRule {
    public void updateupdateFinal(UpdateContext context) throws BusinessException { 
     
			    // Thisthis is the BusinessObjectbusinessObject after storing the updated data in the database
            AnfrageBestellung curBestellung = context.getBusinessObject(AnfrageBestellung.class);
        
            // Changeschanges are not recognized, because data has already been saved
            // Thethe following description will not be stored in the database
            curBestellung.setKurzbeschreibung("Bestellung wurde im Schnellverfahren abgeschlossen.");
           
			// we want to re-update all positions after the order has been updated properly
			// so we use the QueryProvider
            for (Bestellposition pos : curBestellung.getPosition()) {
                pos.setBemerkung("Position im Gesamtkontext von " + curBestellung.getNr());
                BusinessObjectProvider.update(pos);
            }
           
 }
}