public final class FndStateRules
extends java.lang.Object
This is a framework internal class! Backward compatibility is not guaranteed.
Constructor and Description |
---|
FndStateRules(FndEntityState.Enum state)
Create an instance for a named entity state
|
Modifier and Type | Method and Description |
---|---|
void |
add(FndAttributeRule rule)
Add a rule on an attribute
|
void |
add(FndRecordRule rule)
Add a rule on a record
|
void |
addTransition(FndEntityState.Enum toState)
Add a valid transition (target state) for the state owning the rules.
|
void |
addTransition(FndEntityState.Enum toState,
FndEntityState.Enum transition)
Add a valid transition (target state) for the state owning the rules
|
void |
applyRules(FndAbstractRecord view)
Apply all rules on a record.
|
void |
checkTransition(FndEntityState.Enum toState)
Check if a state transition is allowed according to the rules.
|
FndEntityState.Enum |
getState()
Get the state the rules applies to.
|
boolean |
isRemoveAllowed(FndAbstractRecord view)
Checks if removal of a record is allowed.
|
boolean |
isTransitionAllowed(FndEntityState.Enum event)
Check if an event is enabled in this state according to the rules.
|
public FndStateRules(FndEntityState.Enum state)
state
- entity statepublic FndEntityState.Enum getState()
public void addTransition(FndEntityState.Enum toState)
toState
- target statepublic void addTransition(FndEntityState.Enum toState, FndEntityState.Enum transition)
toState
- target statetransition
- event used to change the statepublic void checkTransition(FndEntityState.Enum toState) throws SystemException
toState
- target stateSystemException
- if the target state is not allowed (not in the transitions list)public void add(FndAttributeRule rule)
rule
- attribute rulepublic void add(FndRecordRule rule)
rule
- record rulepublic void applyRules(FndAbstractRecord view)
view
- record to apply the rules onpublic boolean isRemoveAllowed(FndAbstractRecord view)
view
- record to check the remove-allowed flag forpublic boolean isTransitionAllowed(FndEntityState.Enum event)