com.jaxfront.core.rule
Class SimpleRuleImpl

java.lang.Object
  extended by com.jaxfront.core.rule.RuleImpl
      extended by com.jaxfront.core.rule.SimpleRuleImpl
All Implemented Interfaces:
Rule, java.io.Serializable, java.lang.Cloneable

public class SimpleRuleImpl
extends RuleImpl

The Rule class extends the xml schema definition for more interactive behaviour! This is necessary because of the limitations of the XML Schema Specifiation. The rule class is implementation of the ECA (Event - Condition - Action) paradigma known from active database theory. Rules can only be definied in the xui specification.A rule will allways triggered by an event. Following events are possible: saveDocument -> fired calling serialization() on the Document class initialisation -> fired on initial document load or if a new Element will be added to the Document propertyChange -> fired on valueChanges A rule gets evaluated after the occurance of an event. If all conditions (in this version the relation between conditions are always a boolean AND) are evaluated as true, all defined actions get performed.

Version:
1.60
See Also:
Condition, AbstractAction, Serialized Form

Field Summary
 
Fields inherited from interface com.jaxfront.core.rule.Rule
ABOUT_TO_PERSIST, CHANGE, CHANGE_AND_INITIALIZATION, COPYCONTENT, DOM_DELETED, DOM_INITIALIZED, LIST_ITEM_DESELECTED, LIST_ITEM_SELECTED, NONE, ONCREATE, PASTECONTENT, PERSISTENT, PROPERTYCHANGE, SAVEDOCUMENT, STRUCTURE_CHANGE, STRUCTURE_CHANGE_ADD, STRUCTURE_CHANGE_REMOVE, VISUALIZED
 
Constructor Summary
SimpleRuleImpl(long type, Type source)
          A Rule needs sourceType to be checked against with and a type which specifies the event type.
SimpleRuleImpl(long type, Type source, java.lang.String scope)
          A Rule needs sourceType to be checked against with and a type which specifies the event type.
SimpleRuleImpl(long type, Type source, java.lang.String scope, boolean doesConcernNoneSerializableSource)
          A Rule needs sourceType to be checked against with and a type which specifies the event type.
SimpleRuleImpl(long type, Type source, java.lang.String executionMode, java.lang.String scope, boolean doesConcernNoneSerializableSource, boolean doesConcernOnlyVisible)
          A Rule needs sourceType to be checked against with and a type which specifies the event type.
SimpleRuleImpl(java.lang.String id, long type, Type source, java.lang.String executionMode, java.lang.String scope, boolean doesConcernNoneSerializableSource, boolean doesConcernOnlyVisible)
           
 
Method Summary
 void apply(Type eventSource, java.lang.Object event, boolean isRunningAsServer)
          Applies ECA behaviour for the given sourceType.
 boolean doesConcern(Type sourceType)
          Indicates if the passing type does concern this rule.
static Rule initializeRule(int counter, Type ruleDefinition)
           
 
Methods inherited from class com.jaxfront.core.rule.RuleImpl
apply, apply, clone, getActions, getCondition, getExecutionMode, getId, getPriority, getRuleType, getScope, getSource, getType, isAboutToPersistRule, isChangeAndInitializationRule, isChangeRule, isCopyContentRule, isDomDeletedRule, isDomInitialized, isListItemDeselectedRule, isListItemSelectedRule, isOnCreationRule, isPasteContentRule, isPersistentRule, isPropertyChangeRule, isReleased, isSaveDocumentRule, isStructureChangeAddRule, isStructureChangeRemoveRule, isStructureChangeRule, isVisualizerInitializationRule, release, setCondition, setPriority, setSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleRuleImpl

public SimpleRuleImpl(long type,
                      Type source)
A Rule needs sourceType to be checked against with and a type which specifies the event type. The event type is necessary for the EventMulticaster to know if a Rule has to be fired or not.

Parameters:
String - type type of event saveDocument -> fired calling serialization() on the Document class initialisation -> fired on initial document load or if a new Element will be added to the Document propertyChange -> fired on valueChanges
source - source base for the ECA behaviour

SimpleRuleImpl

public SimpleRuleImpl(long type,
                      Type source,
                      java.lang.String scope)
A Rule needs sourceType to be checked against with and a type which specifies the event type. The event type is necessary for the EventMulticaster to know if a Rule has to be fired or not.

Parameters:
type - type of event save -> fired calling serialization() on the Document class initialisation -> fired on initial document load or if a new Element will be added to the Document propertyChange -> fired on valueChanges
source - source base for the ECA behaviour
scope - defines the scope of this rule in case of an occured event

SimpleRuleImpl

public SimpleRuleImpl(long type,
                      Type source,
                      java.lang.String scope,
                      boolean doesConcernNoneSerializableSource)
A Rule needs sourceType to be checked against with and a type which specifies the event type. The event type is necessary for the EventMulticaster to know if a Rule has to be fired or not.

Parameters:
type - type of event save -> fired calling serialization() on the Document class initialisation -> fired on initial document load or if a new Element will be added to the Document propertyChange -> fired on valueChanges
source - source base for the ECA behaviour
scope - defines the scope of this rule in case of an occured event
doesConcernNoneSerializableSource - apply the rule if the source is not serializable

SimpleRuleImpl

public SimpleRuleImpl(long type,
                      Type source,
                      java.lang.String executionMode,
                      java.lang.String scope,
                      boolean doesConcernNoneSerializableSource,
                      boolean doesConcernOnlyVisible)
A Rule needs sourceType to be checked against with and a type which specifies the event type. The event type is necessary for the EventMulticaster to know if a Rule has to be fired or not.

Parameters:
type - type of event save -> fired calling serialization() on the Document class initialisation -> fired on initial document load or if a new Element will be added to the Document propertyChange -> fired on valueChanges
source - source base for the ECA behaviour
executionMode - place where the rule needs to be executed (client,server or both)
scope - defines the scope of this rule in case of an occured event
doesConcernNoneSerializableSource - apply the rule if the source is not serializable

SimpleRuleImpl

public SimpleRuleImpl(java.lang.String id,
                      long type,
                      Type source,
                      java.lang.String executionMode,
                      java.lang.String scope,
                      boolean doesConcernNoneSerializableSource,
                      boolean doesConcernOnlyVisible)
Method Detail

apply

public void apply(Type eventSource,
                  java.lang.Object event,
                  boolean isRunningAsServer)
Description copied from interface: Rule
Applies ECA behaviour for the given sourceType. In some circumstances its necessary to apply the rule as temporary (e.g. if a component is displayed as dialog and not committed yet)

Specified by:
apply in interface Rule
Overrides:
apply in class RuleImpl
event - TODO
isRunningAsServer - defines if this rule should be applied in server mode

initializeRule

public static Rule initializeRule(int counter,
                                  Type ruleDefinition)

doesConcern

public boolean doesConcern(Type sourceType)
Description copied from interface: Rule
Indicates if the passing type does concern this rule.

Specified by:
doesConcern in interface Rule
Overrides:
doesConcern in class RuleImpl
Parameters:
sourceType - source of an occured change