| java.lang.Object com.ecyrd.jspwiki.workflow.WorkflowManager
WorkflowManager | public class WorkflowManager implements WikiEventListener(Code) | |
Monitor class that tracks running Workflows. The WorkflowManager also keeps
track of the names of users or groups expected to approve particular
Workflows.
author: Andrew Jaquith |
Constructor Summary | |
public | WorkflowManager() Constructs a new WorkflowManager, with an empty workflow cache. |
PROPERTY_APPROVER_PREFIX | final protected static String PROPERTY_APPROVER_PREFIX(Code) | | The prefix to use for looking up jspwiki.properties approval roles.
|
WorkflowManager | public WorkflowManager()(Code) | | Constructs a new WorkflowManager, with an empty workflow cache. New
Workflows are automatically assigned unique identifiers, starting with 1.
|
add | protected synchronized void add(Workflow workflow)(Code) | | Protected helper method that adds a newly created Workflow to the cache,
and sets its workflowManager and Id
properties if not set.
Parameters: workflow - the workflow to add |
getApprover | public Principal getApprover(String messageKey) throws WikiException(Code) | | Looks up and resolves the actor who approves a Decision for a particular
Workflow, based on the Workflow's message key. If not found, or if
Principal is Unresolved, throws WikiException. This particular
implementation always returns the GroupPrincipal Admin
Parameters: messageKey - the Decision's message key the actor who approves Decisions throws: WikiException - if the message key was not found, or thePrincipal value corresponding to the key could not be resolved |
getCompletedWorkflows | public List getCompletedWorkflows()(Code) | | Returns a collection of finished workflows; that is, those that have aborted or completed.
the finished workflows |
getDecisionQueue | public DecisionQueue getDecisionQueue()(Code) | | Returns the DecisionQueue associated with this WorkflowManager
the decision queue |
getEngine | protected WikiEngine getEngine()(Code) | | Protected helper method that returns the associated WikiEngine
the wiki engine |
getOwnerWorkflows | public Collection getOwnerWorkflows(WikiSession session)(Code) | | Returns the current workflows a wiki session owns. These are workflows whose
Workflow.getOwner method returns a Principal also possessed by the
wiki session (see
com.ecyrd.jspwiki.WikiSession.getPrincipals ). If the
wiki session is not authenticated, this method returns an empty Collection.
Parameters: session - the wiki session the collection workflows the wiki session owns, which may be empty |
getWorkflows | public Collection getWorkflows()(Code) | | Returns a collection of the currently active workflows.
the current workflows |
initialize | public void initialize(WikiEngine engine, Properties props)(Code) | | Initializes the WorkflowManager using a specfied WikiEngine and
properties. Any properties that begin with
WorkflowManager.PROPERTY_APPROVER_PREFIX will be assumed to be
Decisions that require approval. For a given property key, everything
after the prefix denotes the Decision's message key. The property
value indicates the Principal (Role, GroupPrincipal, WikiPrincipal) that
must approve the Decision. For example, if the property key/value pair
is jspwiki.approver.workflow.saveWikiPage=Admin ,
the Decision's message key is workflow.saveWikiPage .
The Principal Admin will be resolved via
com.ecyrd.jspwiki.auth.AuthorizationManager.resolvePrincipal(String) .
Parameters: engine - the wiki engine to associate with this WorkflowManager Parameters: props - the wiki engine's properties |
remove | protected synchronized void remove(Workflow workflow)(Code) | | Protected helper method that removes a specified Workflow from the cache,
and moves it to the workflow history list. This method defensively
checks to see if the workflow has not yet been removed.
Parameters: workflow - the workflow to remove |
requiresApproval | public boolean requiresApproval(String messageKey)(Code) | | Returns true if a workflow matching a particular key
contains an approval step.
Parameters: messageKey - the name of the workflow; corresponds to the value returned byWorkflow.getMessageKey. the result |
start | public void start(Workflow workflow) throws WikiException(Code) | | Adds a new workflow to the set of workflows and starts it. The new
workflow is automatically assigned a unique ID. If another workflow with
the same ID already exists, this method throws a WikIException.
Parameters: workflow - the workflow to start throws: WikiException - if a workflow the automatically assignedID already exist; this should not happen normally |
|
|