| Builds an approval workflow that requests approval from a named
user,
com.ecyrd.jspwiki.auth.authorize.Group or
com.ecyrd.jspwiki.auth.authorize.Role before running a Task.
The Principal who approves the activity is determined by looking up
the property jspwiki.approver.workflowApproverKey
in jspwiki.properties . If that Principal resolves to a known user, Group
Role, a Decision will be placed in the respective workflow queue (or multiple queues,
if necessary). Only one approver needs to make the Decision, and if the request is
approved, the completion task will be executed. If the request is denied, a
SimpleNotification with a message corresponding to the rejectedMessage
message key will be placed in the submitter's workflow queue.
To help approvers determine how to make the Decision, callers can supply an
array of Fact objects to this method, which will be added to the Decision in the order
they appear in the array. These items will be displayed in the web UI.
In addition, the value of the first Fact will also be added as the third message
argument for the workflow (the first two are always the submitter and the approver).
For example, the PageManager code that creates the "save page approval" workflow
adds the name of the page as its first Fact; this results in the page name being
substituted correctly into the resulting message:
"Save wiki page <strong>{2}</strong>".
Parameters: submitter - the user submitting the request Parameters: workflowApproverKey - the key that names the user, Group or Role who must approvethe request. The key is looked up in jspwiki.properties , and is derivedby prepending jspwiki.approver to the value of workflowApproverKey Parameters: prepTask - the initial task that should run before the Decision step is processed.If this parameter is null , the Decision will run as the first Step instead Parameters: decisionKey - the message key in default.properties that containsthe text that will appear in approvers' workflow queues indicating they need to makea Decision; for example, decision.saveWikiPage . In the i18n message bundlefile, this key might return text that reads "Approve page <strong>{2}</strong>" Parameters: facts - an array of Fact objects that will be shown to the approverto aid decision-making. The facts will be displayed in the order supplied in the array Parameters: completionTask - the Task that will run if the Decision is approved Parameters: rejectedMessageKey - the message key in default.properties that containsthe text that will appear in the submitter's workflow queue if request wasnot approved; for example, notification.saveWikiPage.reject . In thei18n message bundle file, this key might might returntext that reads "Your request to save page <strong>{2}</strong> was rejected."If this parameter is null , no message will be sent the created workflow throws: WikiException - if the name of the approving user, Role or Group cannot be determined |