Package org.apache.wiki.workflow

# Interface WorkflowManager

All Superinterfaces:
  `EventListener`, `Initializable`, `WikiEventListener`

All Known Implementing Classes:
  `DefaultWorkflowManager`

public interface WorkflowManager extends WikiEventListener, Initializable

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

Fields
Modifier and Type
Field
Description
`static final String`
`PROPERTY_APPROVER_PREFIX`
The prefix to use for looking up `jspwiki.properties` approval roles.
`static final String`
`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.
`static final String`
`WF_UP_CREATE_SAVE_ATTR_SAVED_PROFILE`
The workflow attribute which stores the user profile.
`static final String`
`WF_UP_CREATE_SAVE_DECISION_MESSAGE_KEY`
The message key for storing the Decision text for saving a user profile.
`static final String`
`WF_UP_CREATE_SAVE_FACT_PREFS_EMAIL`
Fact name for storing the preferences' email.
`static final String`
`WF_UP_CREATE_SAVE_FACT_PREFS_FULL_NAME`
Fact name for storing the preferences' full name.
`static final String`
`WF_UP_CREATE_SAVE_FACT_PREFS_LOGIN_NAME`
Fact name for storing the preferences' login name.
`static final String`
`WF_UP_CREATE_SAVE_FACT_SUBMITTER`
Fact name for storing a the submitter name.
`static final String`
`WF_WP_SAVE_APPROVER`
The name of the key from jspwiki.properties which defines who shall approve the workflow of storing a wikipage.
`static final String`
`WF_WP_SAVE_DECISION_MESSAGE_KEY`
The message key for storing the Decision text for saving a page.
`static final String`
`WF_WP_SAVE_FACT_CURRENT_TEXT`
Fact name for storing the current text.
`static final String`
`WF_WP_SAVE_FACT_DIFF_TEXT`
Fact name for storing a diff text.
`static final String`
`WF_WP_SAVE_FACT_IS_AUTHENTICATED`
Fact name for storing whether the user is authenticated or not.
`static final String`
`WF_WP_SAVE_FACT_PAGE_NAME`
Fact name for storing the page name.
`static final String`
`WF_WP_SAVE_FACT_PROPOSED_TEXT`
Fact name for storing the proposed (edited) text.
`static final String`
`WF_WP_SAVE_REJECT_MESSAGE_KEY`
The message key for rejecting the decision to save the page.

## Method Summary

Modifier and Type
Method
Description
`Principal`
`getApprover(String messageKey)`
Looks up and resolves the actor who approves a Decision for a particular Workflow, based on the Workflow's message key.
`List<Workflow>`
`getCompletedWorkflows()`
Returns a collection of finished workflows; that is, those that have aborted or completed.
`DecisionQueue`
`getDecisionQueue()`
Returns the DecisionQueue associated with this WorkflowManager
`List<Workflow>`
`getOwnerWorkflows(Session session)`
Returns the current workflows a wiki session owns.
`Set<Workflow>`
`getWorkflows()`
Returns a collection of the currently active workflows.
`Map<Integer,Workflow>`
`getWorkflowsAsMap()`
Returns a map of the currently active workflows.
`boolean`
`requiresApproval(String messageKey)`
Returns `true` 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

static final String 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:
  - Constant Field Values

### WF_WP_SAVE_DECISION_MESSAGE_KEY

static final String WF_WP_SAVE_DECISION_MESSAGE_KEY
The message key for storing the Decision text for saving a page. Value is "decision.saveWikiPage".

See Also:
  - Constant Field Values

### WF_WP_SAVE_REJECT_MESSAGE_KEY

static final String WF_WP_SAVE_REJECT_MESSAGE_KEY
The message key for rejecting the decision to save the page. Value is "notification.saveWikiPage.reject".

See Also:
  - Constant Field Values

### WF_WP_SAVE_FACT_PAGE_NAME

static final String WF_WP_SAVE_FACT_PAGE_NAME
Fact name for storing the page name. Value is "fact.pageName".

See Also:
  - Constant Field Values

### WF_WP_SAVE_FACT_DIFF_TEXT

static final String WF_WP_SAVE_FACT_DIFF_TEXT
Fact name for storing a diff text. Value is "fact.diffText".

See Also:
  - Constant Field Values

### WF_WP_SAVE_FACT_CURRENT_TEXT

static final String WF_WP_SAVE_FACT_CURRENT_TEXT
Fact name for storing the current text. Value is "fact.currentText".

See Also:
  - Constant Field Values

### WF_WP_SAVE_FACT_PROPOSED_TEXT

static final String WF_WP_SAVE_FACT_PROPOSED_TEXT
Fact name for storing the proposed (edited) text. Value is "fact.proposedText".

See Also:
  - Constant Field Values

### WF_WP_SAVE_FACT_IS_AUTHENTICATED

static final String WF_WP_SAVE_FACT_IS_AUTHENTICATED
Fact name for storing whether the user is authenticated or not. Value is "fact.isAuthenticated".

See Also:
  - Constant Field Values

### WF_UP_CREATE_SAVE_ATTR_SAVED_PROFILE

static final String WF_UP_CREATE_SAVE_ATTR_SAVED_PROFILE
The workflow attribute which stores the user profile.

See Also:
  - Constant Field Values

### WF_UP_CREATE_SAVE_APPROVER

static final String 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:
  - Constant Field Values

### WF_UP_CREATE_SAVE_DECISION_MESSAGE_KEY

static final String 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:
  - Constant Field Values

### WF_UP_CREATE_SAVE_FACT_SUBMITTER

static final String WF_UP_CREATE_SAVE_FACT_SUBMITTER
Fact name for storing a the submitter name. Value is "fact.submitter".

See Also:
  - Constant Field Values

### WF_UP_CREATE_SAVE_FACT_PREFS_LOGIN_NAME

static final String WF_UP_CREATE_SAVE_FACT_PREFS_LOGIN_NAME
Fact name for storing the preferences' login name. Value is "prefs.loginname".

See Also:
  - Constant Field Values

### WF_UP_CREATE_SAVE_FACT_PREFS_FULL_NAME

static final String WF_UP_CREATE_SAVE_FACT_PREFS_FULL_NAME
Fact name for storing the preferences' full name. Value is "prefs.fullname".

See Also:
  - Constant Field Values

### WF_UP_CREATE_SAVE_FACT_PREFS_EMAIL

static final String WF_UP_CREATE_SAVE_FACT_PREFS_EMAIL
Fact name for storing the preferences' email. Value is "prefs.email".

See Also:
  - Constant Field Values

### PROPERTY_APPROVER_PREFIX

static final String PROPERTY_APPROVER_PREFIX
The prefix to use for looking up `jspwiki.properties` approval roles.

See Also:
  - Constant Field Values

## Method Details

### getWorkflows

Set<Workflow> getWorkflows()
Returns a collection of the currently active workflows.

Returns:
  the current workflows

### getWorkflowsAsMap

Map<Integer,Workflow> getWorkflowsAsMap()
Returns a map of the currently active workflows.

Returns:
  the current workflows as workflowId -> workflow tuples

### getCompletedWorkflows

List<Workflow> getCompletedWorkflows()
Returns a collection of finished workflows; that is, those that have aborted or completed.

Returns:
  the finished workflows

### requiresApproval

boolean requiresApproval(String messageKey)
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 by `Workflow.getMessageKey()`.
Returns:
  the result

### getApprover

Principal getApprover(String messageKey) throws WikiException
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
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

DecisionQueue getDecisionQueue()
Returns the DecisionQueue associated with this WorkflowManager

Returns:
  the decision queue

### getOwnerWorkflows

List<Workflow> getOwnerWorkflows(Session session)
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 `Session.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