Versionen im Vergleich

Schlüssel

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

...

Codeblock
languagejava
titleZu deaktivierende Regel
public class MyUpdateRule implements UpdateRule, StateChangeFinalRule {

	//definition of thread local variable
    public static final ThreadLocal<Boolean> ACTIVE = new ThreadLocal<Boolean>() {
        protected Boolean initialValue() {return Boolean.TRUE;};
    };

    public void update(UpdateContext context) throws BusinessException { 
		//check if rule is active or not (in the running thread)
        if (ACTIVE.get()) {
            MyBusinessObject mbo = context.getBusinessObject(MyBusinessObject.class);
			...
        }
    }
}

...