com.jaxfront.core.rule
Class GlobalRule

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

public class GlobalRule
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

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
static java.lang.String UNDEFINED_EVENT
           
 
Constructor Summary
GlobalRule(java.lang.String id, Type source, java.lang.String executionMode)
           
 
Method Summary
 void apply(Type eventSource)
          Applies ECA behaviour for the given sourceType
 void apply(Type eventSource, boolean isRunningAsServer)
          Applies ECA behaviour for the given sourceType.
 java.lang.Object clone(Type newSource)
           
 java.util.List getActions()
          Returns the actions for this rule.
 ConditionExpression getCondition()
          Returns the defined condition for this rule.
 java.lang.String getExecutionMode()
           
 java.lang.String getId()
           
 Type getSource()
          Returns the source of this E-C-A rule.
 void release()
          Release all allocated resources for this rule.
 void setCondition(ConditionExpression condition)
          Sets the condition of this rule.
 void setSource(Type type)
           
 java.lang.String toString()
          Returns a short description of the sourceType, eventType and all registered Conditions and Events
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNDEFINED_EVENT

public static final java.lang.String UNDEFINED_EVENT
See Also:
Constant Field Values
Constructor Detail

GlobalRule

public GlobalRule(java.lang.String id,
                  Type source,
                  java.lang.String executionMode)
Method Detail

apply

public void apply(Type eventSource)
Applies ECA behaviour for the given sourceType


apply

public void apply(Type eventSource,
                  boolean isRunningAsServer)
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)

Parameters:
isRunningAsServer - defines if this rule should be applied in server mode

getActions

public java.util.List getActions()
Returns the actions for this rule.


getCondition

public ConditionExpression getCondition()
Returns the defined condition for this rule.


getSource

public Type getSource()
Returns the source of this E-C-A rule.


release

public void release()
Release all allocated resources for this rule.


setCondition

public void setCondition(ConditionExpression condition)
Sets the condition of this rule.

Parameters:
condition - condition for this rule

toString

public java.lang.String toString()
Returns a short description of the sourceType, eventType and all registered Conditions and Events

Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone(Type newSource)

setSource

public void setSource(Type type)

getExecutionMode

public java.lang.String getExecutionMode()

getId

public java.lang.String getId()