State - A Java enumeration.public class RoleTransitionSystem<State extends java.lang.Enum<State>> extends TableConditionalTransitionSystem<State>
Declares a conditional transition system where a distinct condition can be attached to each transition, with additional methods to allow a transition to, or deny it from, users in a given role.
| Modifier and Type | Field and Description |
|---|---|
protected IlrSession |
session
The session used to check the role membership.
|
conditions, initialStateConditionsexplicitInitialStates, initialStates, possibleTransitionsstateClass| Constructor and Description |
|---|
RoleTransitionSystem(java.lang.Class<State> stateClass,
IlrSession session)
Constructs a transition system for the states in the
State enumeration passed as a parameter to this class. |
| Modifier and Type | Method and Description |
|---|---|
TransitionCondition<State> |
allowTransition(State s1,
State s2,
java.lang.String role)
Adds a condition to the specified transition to allow the transition if the current user is in the provided role.
|
TransitionCondition<State> |
denyTransition(State s1,
State s2,
java.lang.String role)
Adds a condition to the specified transition to forbid the transition if the current user is in the provided role.
|
getCondition, hasCondition, setConditioncheckCondition, computeInitialStates, conditionChanged, getCondition, getNextStates, impossibleTransitionCause, isPossibleTransitionaddInitialStates, addNextStates, dirtyInitialStates, getInitialStates, isInitialState, transitionExistscountNextStates, countPreviousStates, getAccessibleStates, getAccessibleStates, getFinalStates, getPreviousStates, getSelfAccessibleStates, isAccessible, isAccessible, isFinalStateprotected IlrSession session
public RoleTransitionSystem(java.lang.Class<State> stateClass, IlrSession session)
Constructs a transition system for the states in the State enumeration passed as a parameter to this class.
Since type information is not available at run-time for Java generic classes, the reflective Class object for the state enumeration
has to be provided to the constructor.
stateClass - The reflective object for the state enumeration.session - The session used to check the role membership.public TransitionCondition<State> allowTransition(State s1, State s2, java.lang.String role)
Adds a condition to the specified transition to allow the transition if the current user is in the provided role. Previously attached conditions remain in effect when the current user is not in the provided role.
If the provided role is null, the transition is allowed to all users.
Note: The transition must exist in the table of transition (see TableTransitionSystem.addNextStates(State, State...)) for this method to have an effect.
java.lang.NullPointerException - if s2 is null.s1 - The start state of the transition, or null for transitions to s2 as an initial state.s2 - Then end state of the transition. Cannot be null.role - The name of a role. Passing null will allow the transition to all users.public TransitionCondition<State> denyTransition(State s1, State s2, java.lang.String role)
Adds a condition to the specified transition to forbid the transition if the current user is in the provided role. Previously attached conditions remain in effect when the current user is not in the provided role.
If the provided role is null, the transition is denied from all users.
Note: The transition must exist in the table of transition (see TableTransitionSystem.addNextStates(State, State...)) for this method to have an effect.
java.lang.NullPointerException - if s2 is null.s1 - The start state of the transition, or null for transitions to s2 as an initial state.s2 - Then end state of the transition. Cannot be null.role - The name of a role. Passing null will deny the transition from all users.© Copyright IBM Corp. 1987, 2017