Difference between revisions of "Workflow Course: Exercise 8"
From OpenKM Documentation
Line 1: | Line 1: | ||
+ | {{TOCright}} __TOC__ | ||
+ | |||
== Step 1 - Create real life example == | == Step 1 - Create real life example == | ||
− | |||
The idea of this exercise is create a real life approve workflow. | The idea of this exercise is create a real life approve workflow. | ||
− | + | To do it you should: | |
− | * Start node with | + | * Start node with '''swimlane initiator'''. |
* Create metadata with status select ( take a look here ) | * Create metadata with status select ( take a look here ) | ||
− | * Create a form to creator, reviewer and approver task. | + | * Create a form to '''creator''', '''reviewer''' and '''approver''' task. |
− | * Assign | + | * Assign '''swimlane initiator''' to task creator. |
* Assign actor reviewer to reviewer task. | * Assign actor reviewer to reviewer task. | ||
* Assign actor approver to approver task. | * Assign actor approver to approver task. | ||
− | * In node metadata_created change document metadata status to created. | + | * In node '''metadata_created''' change document metadata status to '''created'''. |
− | * In node metadata_reviewed change document metadata status to reviewed. | + | * In node '''metadata_reviewed''' change document metadata status to '''reviewed'''. |
− | * In node metadata_approved change document metadata status to approved. | + | * In node '''metadata_approved''' change document metadata status to '''approved'''. |
− | * In node cancellation change document metadata status to | + | * In node cancellation change document metadata status to cancelled and send mail to approver and reviewer users. |
− | [[File: | + | == Diagram == |
+ | |||
+ | [[File:Wf real example.png|center]] | ||
+ | |||
+ | == Notes == | ||
+ | For changing metadata property group use the code: | ||
− | |||
− | |||
<source lang="java"> | <source lang="java"> | ||
− | String sysToken = | + | String sysToken = DbSessionManager.getInstance().getSystemToken(); |
OKMPropertyGroup.getInstance().setProperties(sysToken, path, grpName, properties); | OKMPropertyGroup.getInstance().setProperties(sysToken, path, grpName, properties); | ||
</source> | </source> | ||
Line 27: | Line 31: | ||
In this case we have created nodes to make the actions. We made it with the idea to be more clear, but in real case we suggest using transactions for doing this kind of logic ( updating metadata ), because workflow will have less boxes. | In this case we have created nodes to make the actions. We made it with the idea to be more clear, but in real case we suggest using transactions for doing this kind of logic ( updating metadata ), because workflow will have less boxes. | ||
− | + | [[Category: Workflow Guide]] | |
− | |||
[[Category: Workflow Course]] | [[Category: Workflow Course]] |
Revision as of 08:52, 18 June 2013
Step 1 - Create real life example
The idea of this exercise is create a real life approve workflow.
To do it you should:
- Start node with swimlane initiator.
- Create metadata with status select ( take a look here )
- Create a form to creator, reviewer and approver task.
- Assign swimlane initiator to task creator.
- Assign actor reviewer to reviewer task.
- Assign actor approver to approver task.
- In node metadata_created change document metadata status to created.
- In node metadata_reviewed change document metadata status to reviewed.
- In node metadata_approved change document metadata status to approved.
- In node cancellation change document metadata status to cancelled and send mail to approver and reviewer users.
Diagram
Notes
For changing metadata property group use the code:
String sysToken = DbSessionManager.getInstance().getSystemToken();
OKMPropertyGroup.getInstance().setProperties(sysToken, path, grpName, properties);
In this case we have created nodes to make the actions. We made it with the idea to be more clear, but in real case we suggest using transactions for doing this kind of logic ( updating metadata ), because workflow will have less boxes.