Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item14441: reworked example, improved tests, fixed promotion of acces…
…s controls
- Loading branch information
cdot
committed
Jul 28, 2017
1 parent
fb18f86
commit c6217c3
Showing
29 changed files
with
315 additions
and
274 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Example form used by the DocumentApprovalWorkflow. Topics get this form when they are moved to PLEASEAPPROVE state | ||
|
||
| *Name* | *Type* | *Size* | *Values* | *Tooltip messages* | *Attributes* | | ||
| Summary of changes | text | 60 | | | | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
This is an example document that demonstrates some of the features of | ||
the %SYSTEMWEB%.WorkflowPlugin. The document is controlled by the %WORKFLOW% | ||
workflow. | ||
|
||
The table below is part of the example content, and is generated by expanding | ||
some of the macros described in %SYSTEMWEB%.VarWORKFLOW | ||
|
||
| *Macro* | *Description* | *Expands to*| | ||
| =WORKFLOWSTATE= | Current state of the document | %WORKFLOWSTATE% | | ||
| =WORKFLOWSTATEMESSAGE= | State message | %WORKFLOWSTATEMESSAGE% | | ||
| =WORKFLOWTRANSITIONS= | Transitions available to you | %WORKFLOWTRANSITION% | | ||
| =WORKFLOWLAST= | Last time in APPROVED state | %WORKFLOWLAST{"APPROVED" format="$time by $author"}% | | ||
| =WORKFLOWLASTVERSION= | Link to version when it was last in APPROVED state | %WORKFLOWLASTVERSION{"APPROVED"}% | | ||
| =WORKFLOWHISTORY= | Workflow history | %WORKFLOWHISTORY% | | ||
| =WORKFLOWFORK= | Fork the document to a new topic 'ControlledDocumentFork' | %WORKFLOWFORK{"ControlledDocumentFork"}% | | ||
|
||
Other =WORKFLOW*= preferences defined in %WORKFLOW% are defined | ||
here too: | ||
| =WORKFLOWNOTICE= | %WORKFLOWNOTICE% | | ||
| =WORKFLOWSET= | %WORKFLOWSET% | | ||
| =WORKFLOWDEBUG= | %WORKFLOWDEBUG% | | ||
|
||
%META:PREFERENCE{name="WORKFLOW" value="DocumentApprovalWorkflow"}% | ||
%META:PREFERENCE{name="WORKFLOWDEBUG" value="1"}% | ||
%META:WORKFLOWHISTORY{name="1" state="APPROVED" date="123456789" author="WikiGuest"}% |
50 changes: 50 additions & 0 deletions
50
data/Sandbox/WorkflowPluginExample/DocumentApprovalWorkflow.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
This is an example workflow description used with the %SYSTEMWEB%.WorkflowPlugin. | ||
|
||
See ControlledDocument for a document controlled by this workflow. | ||
|
||
Any topic using this workflow can use settings from this topic that start | ||
with =WORKFLOW= - for example, | ||
* Set WORKFLOWNOTICE = This document is under workflow control | ||
|
||
The workflow is a very simple one, with only three states and four | ||
transitions: | ||
|
||
<verbatim> | ||
UNDERREVISION ------>-------- PLEASEAPPROVE --->--- APPROVED | ||
^ needs approval | approve | | ||
| | | | ||
+------------<---------------' | | ||
| reject | | ||
| | | ||
`-------------------------<---------------------' | ||
revise | ||
</verbatim> | ||
Anyone can make the =needs approval= and =revise= transitions, but | ||
only the (fictional) !QualityGroup can make the 'approve' and 'reject' | ||
transitions. Further, | ||
* the document can only be edited in UNDERREVISION state. In all other states, it is locked for editing | ||
* when a topic is moved to PLEASEAPPROVE state, it gets the ApproveForm | ||
* when a topic is moved to UNDERREVISION state, it gets the RevisionForm | ||
* the user who last moved a document to UNDERREVISION is not allowed to move it to APPROVED. | ||
* WikiGuest is denied most actions unti lthe document is in approved state | ||
|
||
---++ States | ||
The first table describes the states a topic can be in. | ||
|
||
| *State* | *Allow VIEW* | *Allow CHANGE* | *Message* | | ||
| UNDERREVISION | not(WikiGuest) | not(WikiGuest) | Under revision | | ||
| PLEASEAPPROVE | not(WikiGuest) | nobody | Waiting for approval | | ||
| APPROVED | | nobody | Approved for release | | ||
|
||
--++ Transitions | ||
The second table describes the transitions available from each state. | ||
|
||
| *State* | *Action* | *Next State* | *Allowed* | *Form* | | ||
| UNDERREVISION | needs approval | PLEASEAPPROVE | not(WikiGuest) | ApproveForm | | ||
| APPROVED | revise | UNDERREVISION | not(LASTUSER_UNDERREVISION) | RevisionForm | | ||
| PLEASEAPPROVE | approve | APPROVED | QualityGroup | | | ||
| PLEASEAPPROVE | reject | UNDERREVISION | QualityGroup | RevisionForm | | ||
|
||
%META:PREFERENCE{name="WORKFLOWDEBUG" value="1"}% | ||
%META:PREFERENCE{name="WORKFLOWSET" value="Example setting"}% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Example form used by the DocumentApprovalWorkflow. Topics get this form when they are moved to UNDERREVISION state | ||
|
||
| *Name* | *Type* | *Size* | *Values* | *Tooltip messages* | *Attributes* | | ||
| Reason for revision | text | | | | | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This web contains a working example of the %SYSTEMWEB%.WorkflowPlugin | ||
|
||
* DocumentApprovalWorkflow contains the workflow | ||
* ControlledDocument is an example document | ||
|
||
<form action="%SCRIPTURLPATH{edit}%/%WEB%/ControlledDocumentAUTOINC000"> | ||
You can create a new document (based on ControlledDocument) that you can use with the workflow here: | ||
<input type="hidden" name="templatetopic" value="ControlledDocument"/> | ||
<input type="submit" value="Create new controlled document" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%WIKIUSERNAME% | ||
| *Controlled Documents* | | ||
%SEARCH{"ControlledDocument" scope="topic" nonoise="on" format="| [[$topic]] |"}% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
---+!! <nop>%WEB% Web Preferences | ||
|
||
%TOC% | ||
|
||
---++ Appearance | ||
|
||
* Set WEBBGCOLOR = #EBABEFAC | ||
* <sticky>web-specific background color, <span style='background-color: %WEBBGCOLOR%'> current color </span></sticky> | ||
|
||
* Set SITEMAPLIST = on | ||
* set to =off= to hide this web from the [[%SYSTEMWEB%.SiteMap][SiteMap]] | ||
|
||
* Set WEBSUMMARY = Working example for the WorkflowPlugin | ||
* description what this web is used for | ||
|
||
* Set NOSEARCHALL = on | ||
* if set to =on=, this web will be exclude web from a global search | ||
|
||
* Set WEBFORMS = RevisionForm, ApproveForm | ||
* Comma separated list of forms that can be attached to topics in this web. See [[%SYSTEMWEB%.DataForms][DataForms]] for more information. | ||
|
||
--- | ||
%INCLUDE{"%SYSTEMWEB%.WebPreferencesHelp"}% | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.