The workflow module is pretty well-documented. It contains an installation guide. Follow it and definitely set up graphviz, because it visualizes the workflow process nicely.
If you have not set up graphviz, but want to see the graphical presentation, then click here.
Don't forget the necessary email templates:
And you have to grant access rights to the public to /workflow.
The workflow module is quite fragile. It is pretty easy to ruin a whole workflow process and it is very hard to track down errors. At one point I even managed to deadlock a session. Hence I strictly stuck to changing one thing only, testing the whole workflow process and in case of success do more of the changes I had thought of as necessary.
The whole workflow process is setup by running these two SQL scripts:
In case you want to recreate the library approval workflow, drop it by executing this script:
Change the SQL scripts if you want to change workflow's behaviour. The web interface is nice, but the export function doesn't work properly.
It's quite unlikely that the workflow process itself has to be changed. It's most certain though that you have to change a transition's context info. You register callback PL/SQL procedures to perform a certain job whenever a token passes a particular transition:
Check the sql/oracle/library-workflow-create.sql file to see which callbacks have been associated with which transition. It's the "insert into wf_context_transition_info" statements that register that information with the workflow module.
Let's look into what happens when a token passes the library_review transition - when a knowledge item is put into the "needs to be reviewed" state:
insert into wf_context_transition_info ( context_key, workflow_key, transition_key, assignment_callback, fire_callback, notification_callback, notification_custom_arg, unassigned_callback, access_privilege ) values ( 'default', 'library_approval_wf', 'library_review', 'library_callback.assign_task_to_assignee', 'library_callback.review_fire', 'library_callback.notification', 'library_review_object', 'library_callback.notify_admin', 'write' );
So if you want to change the task assignment, you either change the PL/SQL procedure assign_task_to_assignee, or assign another procedure to assignment_callback. Likewise with the fire_callback: if you want to muck around with the sn_objects table, then do it in review_fire.
Exercise the same caution as with the workflow process definition itself. Work in small steps, test completely, roll back or commit your work etc.