Package org.apache.wiki.workflow
Class DecisionQueue
java.lang.Object
org.apache.wiki.workflow.DecisionQueue
- All Implemented Interfaces:
Serializable
public class DecisionQueue extends Object implements Serializable
Keeps a queue of pending Decisions that need to be acted on by named Principals.
- Since:
- 2.5
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DecisionQueue()Constructs a new DecisionQueue. -
Method Summary
Modifier and Type Method Description protected voidadd(Decision decision)Adds a Decision to the DecisionQueue; also sets the Decision's unique identifier.voiddecide(Decision decision, Outcome outcome)Attempts to complete a Decision by callingDecision.decide(Outcome).protected Decision[]decisions()Protected method that returns all pending Decisions in the queue, in order of submission.Collection<Decision>getActorDecisions(Session session)Returns a Collection representing the current Decisions that pertain to a users's Session.voidreassign(Decision decision, Principal owner)Reassigns the owner of the Decision to a new owner.protected voidremove(Decision decision)Protected method that removes a Decision from the queue.
-
Constructor Details
-
DecisionQueue
public DecisionQueue()Constructs a new DecisionQueue.
-
-
Method Details
-
add
Adds a Decision to the DecisionQueue; also sets the Decision's unique identifier.- Parameters:
decision- the Decision to add
-
decisions
Protected method that returns all pending Decisions in the queue, in order of submission. If no Decisions are pending, this method returns a zero-length array.- Returns:
- the pending decisions
-
remove
Protected method that removes a Decision from the queue.- Parameters:
decision- the decision to remove
-
getActorDecisions
Returns a Collection representing the current Decisions that pertain to a users's Session. The Decisions are obtained by iterating through the Session's Principals and selecting those Decisions whoseDecision.getActor()value match. If the session is not authenticated, this method returns an empty Collection.- Parameters:
session- the wiki session- Returns:
- the collection of Decisions, which may be empty
-
decide
Attempts to complete a Decision by callingDecision.decide(Outcome). This will cause the Step immediately following the Decision (if any) to start. If the decision completes successfully, this method also removes the completed decision from the queue.- Parameters:
decision- the Decision for which the Outcome will be suppliedoutcome- the Outcome of the Decision- Throws:
WikiException- if the succeeding Step cannot start for any reason
-
reassign
Reassigns the owner of the Decision to a new owner. Under the covers, this method callsDecision.reassign(Principal).- Parameters:
decision- the Decision to reassignowner- the new owner- Throws:
WikiException- never
-