Package org.apache.wiki.workflow
Interface WorkflowManager
- All Superinterfaces:
EventListener
,Initializable
,WikiEventListener
- All Known Implementing Classes:
DefaultWorkflowManager
Monitor class that tracks running Workflows. The WorkflowManager also keeps track of the names of users or groups expected to approve particular Workflows.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The prefix to use for looking upjspwiki.properties
approval roles.static final String
The name of the key from jspwiki.properties which defines who shall approve the workflow of creating a user profile.static final String
The workflow attribute which stores the user profile.static final String
The message key for storing the Decision text for saving a user profile.static final String
Fact name for storing the preferences' email.static final String
Fact name for storing the preferences' full name.static final String
Fact name for storing the preferences' login name.static final String
Fact name for storing a the submitter name.static final String
The name of the key from jspwiki.properties which defines who shall approve the workflow of storing a wikipage.static final String
The message key for storing the Decision text for saving a page.static final String
Fact name for storing the current text.static final String
Fact name for storing a diff text.static final String
Fact name for storing whether the user is authenticated or not.static final String
Fact name for storing the page name.static final String
Fact name for storing the proposed (edited) text.static final String
The message key for rejecting the decision to save the page. -
Method Summary
Modifier and TypeMethodDescriptiongetApprover
(String messageKey) Looks up and resolves the actor who approves a Decision for a particular Workflow, based on the Workflow's message key.Returns a collection of finished workflows; that is, those that have aborted or completed.Returns the DecisionQueue associated with this WorkflowManagergetOwnerWorkflows
(Session session) Returns the current workflows a wiki session owns.Returns a collection of the currently active workflows.Returns a map of the currently active workflows.boolean
requiresApproval
(String messageKey) Returnstrue
if a workflow matching a particular key contains an approval step.Methods inherited from interface org.apache.wiki.api.engine.Initializable
initialize
Methods inherited from interface org.apache.wiki.event.WikiEventListener
actionPerformed
-
Field Details
-
WF_WP_SAVE_APPROVER
The name of the key from jspwiki.properties which defines who shall approve the workflow of storing a wikipage. Value is "workflow.saveWikiPage"- See Also:
-
WF_WP_SAVE_DECISION_MESSAGE_KEY
The message key for storing the Decision text for saving a page. Value is "decision.saveWikiPage".- See Also:
-
WF_WP_SAVE_REJECT_MESSAGE_KEY
The message key for rejecting the decision to save the page. Value is "notification.saveWikiPage.reject".- See Also:
-
WF_WP_SAVE_FACT_PAGE_NAME
Fact name for storing the page name. Value is "fact.pageName".- See Also:
-
WF_WP_SAVE_FACT_DIFF_TEXT
Fact name for storing a diff text. Value is "fact.diffText".- See Also:
-
WF_WP_SAVE_FACT_CURRENT_TEXT
Fact name for storing the current text. Value is "fact.currentText".- See Also:
-
WF_WP_SAVE_FACT_PROPOSED_TEXT
Fact name for storing the proposed (edited) text. Value is "fact.proposedText".- See Also:
-
WF_WP_SAVE_FACT_IS_AUTHENTICATED
Fact name for storing whether the user is authenticated or not. Value is "fact.isAuthenticated".- See Also:
-
WF_UP_CREATE_SAVE_ATTR_SAVED_PROFILE
The workflow attribute which stores the user profile.- See Also:
-
WF_UP_CREATE_SAVE_APPROVER
The name of the key from jspwiki.properties which defines who shall approve the workflow of creating a user profile. Value is "workflow.createUserProfile"- See Also:
-
WF_UP_CREATE_SAVE_DECISION_MESSAGE_KEY
The message key for storing the Decision text for saving a user profile. Value is "decision.createUserProfile".- See Also:
-
WF_UP_CREATE_SAVE_FACT_SUBMITTER
Fact name for storing a the submitter name. Value is "fact.submitter".- See Also:
-
WF_UP_CREATE_SAVE_FACT_PREFS_LOGIN_NAME
Fact name for storing the preferences' login name. Value is "prefs.loginname".- See Also:
-
WF_UP_CREATE_SAVE_FACT_PREFS_FULL_NAME
Fact name for storing the preferences' full name. Value is "prefs.fullname".- See Also:
-
WF_UP_CREATE_SAVE_FACT_PREFS_EMAIL
Fact name for storing the preferences' email. Value is "prefs.email".- See Also:
-
PROPERTY_APPROVER_PREFIX
The prefix to use for looking upjspwiki.properties
approval roles.- See Also:
-
-
Method Details
-
getWorkflows
Returns a collection of the currently active workflows.- Returns:
- the current workflows
-
getWorkflowsAsMap
Returns a map of the currently active workflows.- Returns:
- the current workflows as workflowId -> workflow tuples
-
getCompletedWorkflows
Returns a collection of finished workflows; that is, those that have aborted or completed.- Returns:
- the finished workflows
-
requiresApproval
Returnstrue
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()
.- Returns:
- the result
-
getApprover
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 GroupPrincipalAdmin
- Parameters:
messageKey
- the Decision's message key- Returns:
- the actor who approves Decisions
- Throws:
WikiException
- if the message key was not found, or the Principal value corresponding to the key could not be resolved
-
getDecisionQueue
Returns the DecisionQueue associated with this WorkflowManager- Returns:
- the decision queue
-
getOwnerWorkflows
Returns the current workflows a wiki session owns. These are workflows whoseWorkflow.getOwner()
method returns a Principal also possessed by the wiki session (seeSession.getPrincipals()
). If the wiki session is not authenticated, this method returns an empty Collection.- Parameters:
session
- the wiki session- Returns:
- the collection workflows the wiki session owns, which may be empty
-