OpenACS Petri-Net Workflows

Petri-Net workflow support for financial approval and similar processes. This package comes with a workflow editor, a Petri-Net execution engine and and integration with the rest of the ]project-open[ system.


]project-open[ Petri-Net Workflow

This package lets you define the process that your projects, vacation requests, invoices or any other important object of interest must go through to avoid that any cases falls through the cracks.

  Order Fulfillment Workflow

What is a Workflow?

Workflows are a way to formalize and understand any business process involving multiple steps and complex participation amongst workers to achieve the final result.  In a manufacturing or engineering setting the workflow can be quite rigid and inflexible, while in service and consulting industries changes can be rapid and a process completly out of order and coordination among project members can take a diverse/infinite number of steps and paths towards completion.  ]project-open[ workflows are adaptable and customizable to account for and attempt to portray the actual realities of the business world.  

Elements of a Workflow

]po[ workflows are based on the Petri-Net formalism, inspired by an article from W.M.P. van der Aalst. A ]po[ workflow consists of the following elements:

  • Transitions - the square boxes in the diagram above.
    Transition represent actions. Actions can be performed either by a user, or by the system.

  • Places - the little circles in the diagram above.
    Places represent the "state" of the workflow.

  • Arcs - the arrows that connect transitions with places.

  • Guards - logical conditions on arcs, written in [brackets] in the diagram above.
    Guards allow for implementing business rules and other logical conditions.

]po[ supports several types of transitions, as depicted in the figure above:

  • User transitions:
    These are the most common forms of transitions. These transitions will appear in the Inbox (see below) of all assigned users, who can "start" the transition to indicate that they have started the activity, and then "finish" the transition.

  • Automatic transitions:
    There is no user interaction with these transitions. However, the transitions can call API functions to perform actions.

  • Timed transitions:
    Time transitions fire at a specified time. They are used to implement timeout logics etc.

  • Message transitions:
    Message transitions wait for a trigger from outside the workflow to continue. This can be used to integrated ]po[ with an external application.

Using these basic elements, the Petri-Net formalism allows to specify arbitrarily complex processes. Petri-Nets are known to be sufficiently powerful to represent even workflows specified in workflow formalisms such as BPMN and EPC.

Workflows and Business Objects

In ]po[, every workflow is related to a business object such as a project, vacation request, [translation task] etc. There are more then 40 business objects in ]po[. There can be more then one active workflow per business object.

There are several links between the business objects and it's workflow:

  • Status: The workflow can modify the "status" of its business object:
    For example, a vacation request may "requested" after the user has entered the data, and may only receive the status "confirmed" if the employee's manager has approved the request.

  • Type: The "type" of the business object determines the workflow:
    For example, both "vacation request" and "sickness leave" are sub-types of the user absence object type. However, a vacation request should be handled by a "vacation_request_wf" workflow for approval of the employee's supervisor, while a sickness leave request just needs to be confirmed by the HR department via a "sickness_leave_wf" workflow.

  • Variables: The workflow can access the business object's fields.
    "Guard expressions" can use the business object's fields to determine if the workflow should take one route or another.

  • Input Fields: Storing user input captured during the workflow:
    Workflows frequently requires user input that needs to be stored somewhere. The business object provides a suitable space to store this information, in particular in combination with the DynField dynamic field extension that allows adding new fields to business objects.

Starting a Workflow for a ]project-open[ Objects

With ]project-open[ V3.4.0, the following objects already include a workflow integration:

In order to start a workflow for these objects, you have to:

  1. Create a suitable workflow in the Admin -> Workflows
  2. Go to Admin -> Categories -> Intranet <Object> Type and enter the workflow key into the "String1" property of the categories.

For example, you may create a new workflow with the key "simple_vacation_approval_wf" designed for the approval process of absences of type "Vacation". In order to enable this workflow, please enter the "simple_vacation_approval_wf" into the "String1" field of Admin -> Categories -> Intranet Absence Type -> "Vacation". The next time you create a new "Vacation" absence, a workflow is automatically created.

Please note that the WF integration of the objects above includea "skipping" the first WF transition. This trick allows to design workflows with a clean optical appearance with the first transition representing an "Edit Object" action that is not necessary directly after the creation of an object.

The Inbox - Interacting With Users

The "Inbox" is the interface between the user and the workflow. The inbox will show a new task every time that a user needs to perform a certain workflow action - for example approve a vacation request. This way, the inbox acts like a cockpit for every ]po[ user and allows the user to take actions (approve or reject vacation requests) to follow-up the status of the users's own requests.

The inbox can also send out Email notifications to user for each new task.

Assignments - Who Should Take Action?

Real-world experience with workflows shows that the assignment of users to actions/transitions is suprisingly complex. Assignments depend on the workflow transition (approving a project budget vs. executing the project), on the type of workflow (PMs approve vacation requests of their project members, HR approves sickness leaves) and on the context (project budgets > 50.000 EUR need to be approved by Senior Managers, while the Account Managers may approve smaller budgets).

In order to deal with these real-world requirements, the ]po[ workflow provides several options to assign a transition to a user:

  • Static assignment to a user or profile:
    Assign a specific WF transition to a single user or a group of users.

  • Dynamic assignment as part of the WF:
    ]po[ allows the assignee of one transition to specifiy the assignee for the next transition.

  • Custom assignments via Callbacks:
    Callbacks allow to implement custom assignment logic, for example in the case of a vacation request:
    "All PMs can approve the vacation request who are the PMs of a projects in which the user is participating".

Panels - Working with User Input

Once a user is assigned to a transition and he clicks on the link in his Inbox, the user is transferred to a page ("panel") where he or she can interact with the system - pressing an "Approve" button, entering a comment or filling out a form.

The ]po[ workflow provides a number of default panels:

  • Default Start/Finish Panel:
    Allows the user to say "start - I have started the work on this transition" and "finish - I have finished the work on this transition".

  • Default Approval Panel:
    Allows the user to choose Yes/No to a specific question such as "Approve this Vacation Request"?

  • Default Assignment Panel:
    Allows the current user to assign other users to upcoming transitions.

  • Business Object Panels:
    Many of the normal edit screens for ]po[ business objects can be used as a panel.
    No development is required in this case, and the DynField package allows to configure the fields that specific user profiles can enter.

  • Custom Panels:
    Panels are nothing but a normal TCL screen, so developers can use the full power of TCL and the ]po[ system to develop panels. Once developed, such a TCL panel can be assigned to one or more workflow transitions.

Callbacks - Taking Action

"Callbacks" is the mechanism that allows ]po[ workflows to modify its underlying business object and the system in general. For example let's assume that the HR department has approved a vacation request. We now want to set the status of the vacation request to "approved". Technically, a callback is nothing but the name of a PL/SQL procedure, and the following PL/SQL procedure is readily available for this purpose:

im_workflow__set_object_status_id(case_id, transition_key, object_status_id)

The "case_id" and "transition_key" variables are filled in by the ]po[ workflow automatically, so that a developer only needs to specify the "object_status_id". Looking at Admin -> Categories -> Intranet Absence Status we see that the status "active" has the status_id=16000.

Other callbacks are used to assign users to otherwise unassigned transitions and to implement the business logic for "guard" decisions.Please see the Workflow Developer's Guide for a detailed description of callbacks.

Pre-configured Workflows

These workflows come pre-defined (as of version 3.4) as part of the basic ]project-open[ download and install.

Related Contents

For Deciders:
For Workflow Designers: For Developers:

References

Related Packages

Package Documentation

Procedure Files

tcl/display-procs.tcl       Procs to render workflow information in HTML. 
tcl/expenses-procs.tcl       Procs to render workflow information in HTML. 
tcl/graph-procs.tcl       Helper procs for generating graphical representations of workflows. 
tcl/intranet-workflow-procs.tcl       ]project-open[ specific extension for acs-workflow. 
tcl/wizard-procs.tcl       Helper-procs for the process wizard. 
tcl/workflow-procs.tcl       Tcl-API for the workflow engine. 

Procedures

wf_action_pretty       Returns the pretty version of a task action. 
wf_add_arc        
wf_add_arc_in        
wf_add_arc_out        
wf_add_place        
wf_add_role        
wf_add_trans_attribute_map        
wf_add_trans_role_assign_map        
wf_add_transition        
wf_assignment_widget       Returns an HTML fragment containing a form element for entering the value of an attribute. 
wf_attribute_value_pretty       Returns a nice display version of the value of an attribute. 
wf_attribute_widget       Returns an HTML fragment containing a form element for entering the value of an attribute. 
wf_case_add_manual_assignment        
wf_case_add_task_assignment        
wf_case_cancel       Cancels a case 
wf_case_clear_manual_assignments        
wf_case_clear_task_assignments        
wf_case_comment       Comment on a case 
wf_case_info       Get information about a case. 
wf_case_new       Creates and initializes a case of the given workflow type. 
wf_case_remove_case_deadline        
wf_case_remove_manual_assignment        
wf_case_remove_task_assignment        
wf_case_resume       Resumes a suspended case 
wf_case_set_case_deadline        
wf_case_set_manual_assignments        
wf_case_set_task_assignments        
wf_case_suspend       Suspends a case 
wf_decorate_workflow       Adds linking information to the workflow net, based on the arguments given. 
wf_delete_arc        
wf_delete_place        
wf_delete_role        
wf_delete_trans_attribute_map        
wf_delete_trans_role_assign_map        
wf_delete_transition        
wf_expenses_get_assign_panels        
wf_export_workflow       Generates a SQL script that can re-create this process in another installation. 
wf_generate_dot_representation       Generates a dot-file for use with Graphviz. 
wf_get_workflow_net       We cache the workflow net, although we don't really need that anymore. 
wf_get_workflow_net_internal        
wf_graphviz_dot_exec       Implementation of wf_graphviz_dot_exec. 
wf_graphviz_installed_p       Will tell you whether the AT&T GraphViz package is installed or not. 
wf_if_null       If string is emtpy, returns <code>value_if_null</code>, otherwise returns string. 
wf_ismap_to_client_map       Translates a server-side imagemap as generated by graphviz into a client-side imagemap that you can include in your HTML. 
wf_journal       Get the journal for a case. 
wf_make_unique       Takes a name (split in two parts) and makes it unique with respect to the list passed in <code>taken_names</code>, by putting an integer number between <code>name_part_one</code> and <code>name_part_two</code>, chopping <code>name_part_one</code> as required to stay within maxlen. 
wf_message_transition_fire       Fires a message transition. 
wf_move_role_down        
wf_move_role_up        
wf_name_to_key       Generates a key from a name by making it all lowercase, removing non-letters and putting in underscores instead of spaces. 
wf_new_journal       Creates a new journal entry that can be passed to PL/SQL routines 
wf_progress_bar       Returns an HTML fragment that displays the progress of a wizard nicely. 
wf_simple_wizard_process_def       Gives the process definition list for use with <code>wf_progress_bar</code> 
wf_simple_workflow_p       Returns whether the workflow is "almost linear" or not. 
wf_split_query_url_to_arg_spec       Splits a URL including query arguments (e.g., /foo/bar?baz=greble&yank=zazz) up into a list of lists of name/value pairs, that can be passed as an argument to export_vars. 
wf_sweep_message_transition_tcl       Sweep those message transitions that have a TCL callback and advance the transitions. 
wf_sweep_time_events       Sweep timed transitions and hold timeouts. 
wf_task_action       Tells the workflow engine that the given action has been taken. 
wf_task_actions       Returns a list of the possible actions given the task state. 
wf_task_info       Get detailed information about one task. 
wf_task_list       Get information about the tasks are on a user's work list. 
wf_task_panels       Add the panels for a task into the multirow target. 
wf_task_state_pretty       Returns a pretty-print version of a task state. 
wf_valid_key_p       Check that a value is valid as a key for a workflow/transition/place in a workflow definition. 
wf_wizard_massage_tasks       We store tasks in a client property as a list of array gets with the keys: task_name, transition_key, task_time, loop_to_transition_key, loop_question, loop_answer, assigning_transition_key. 
wf_workflow_changed       Flushes the cache. 
wf_workflow_info       Get the definition of a workflow. 

SQL Files

sql/postgresql/acs-workflow-create.sql        
sql/postgresql/acs-workflow-drop.sql        
sql/postgresql/load-workflow.sql        
sql/postgresql/sample-article-create.sql        
sql/postgresql/sample-article-drop.sql        
sql/postgresql/sample-expenses-create.sql        
sql/postgresql/sample-expenses-drop.sql        
sql/postgresql/test/workflow-case-package-test.sql        
sql/postgresql/upgrade/upgrade-4.0-4.0.1.sql        
sql/postgresql/upgrade/upgrade-4.0.1-4.1b.sql        
sql/postgresql/upgrade/upgrade-4.1.1-4.3.sql        
sql/postgresql/upgrade/upgrade-4.5.0-4.5.1.sql        
sql/postgresql/upgrade/upgrade-4.5.1-4.5.2.sql        
sql/postgresql/upgrade/upgrade-4.5.2-4.5.3.sql        
sql/postgresql/upgrade/upgrade-4.5.3-4.5.4.sql        
sql/postgresql/upgrade/upgrade-4.5.4-4.5.6.sql        
sql/postgresql/upgrade/upgrade-4.5.6-4.5.7.sql        
sql/postgresql/wf-callback-package-body.sql        
sql/postgresql/wf-callback-package-head.sql        
sql/postgresql/wf-callback-package.sql        
sql/postgresql/wf-core-create.sql        
sql/postgresql/wf-core-drop.sql        
sql/postgresql/workflow-case-package-body.sql        
sql/postgresql/workflow-case-package-head.sql        
sql/postgresql/workflow-case-package.sql        
sql/postgresql/workflow-package-body.sql        
sql/postgresql/workflow-package-head.sql        
sql/postgresql/workflow-package.sql        

Content Pages

www/
      active-tasks.adp
      active-tasks.tcl
     admin/
           arc-add.tcl
           arc-delete.tcl delete an arc.
           arc-edit-2.tcl Edit arc.
           arc-edit.adp
           arc-edit.tcl Edit arc.
           assign-transition-role-2.tcl Add assignment of a transition to a role.
           assign-transition-role.adp
           assign-transition-role.tcl
           attribute-add-2.tcl Really add the attribute.
           attribute-add.adp
           attribute-add.tcl Add a workflow attribute.
           attribute-delete.tcl Delete the attribute.
           attributes-table.adp
           attributes-table.tcl
           attributes.adp
           attributes.tcl Manage workflow attributes.
           case-debug.adp
           case-debug.tcl Displays information about a case.
           cases.adp
           cases.tcl View active cases.
           context-add-2.tcl Add new context.
           context-add.adp
           context-add.tcl Add new context.
           define-place-info.adp
           define-place-info.tcl
           define-transition-info.adp
           define-transition-info.tcl
           define.adp
           define.tcl The advanced process builder main page.
           export-2.adp
           export-2.tcl Export the definition of a workflow as a SQL script.
           export-download.tcl Export the definition of a workflow as a SQL script.
           export.adp
           export.tcl Export the definition of a workflow as a SQL script.
           index.adp
           index.tcl Admin index page.
           init-2.tcl Hack to initialize a new case.
           init.adp
           init.tcl This page should go away and the applications take care of this themselves.
           name-edit-2.tcl Edit name of workflow.
           name-edit.adp
           name-edit.tcl Edit name of workflow.
           place-add-2.tcl Add place.
           place-add.adp
           place-add.tcl Add place.
           place-delete.tcl Delete place.
           place-display.adp
           place-display.tcl
           place-edit-2.tcl Edit place.
           place-edit.adp
           place-edit.tcl Edit place.
           role-add-2.tcl Adds a role
           role-add.adp
           role-add.tcl Adds a role to a workflow
           role-delete.tcl Delete role.
           role-edit-2.tcl Edits a role
           role-edit.adp
           role-edit.tcl Edit a role.
           role-manual-2.tcl Make role manually assigned.
           role-manual.adp
           role-manual.tcl Makes a role manually assigned
           role-move-down.tcl Move role down.
           role-move-up.tcl Move role up.
           roles-assignment-table.adp
           roles-assignment-table.tcl
           roles-table.adp
           roles-table.tcl
           static-assignment-add.tcl
           static-assignment-delete.tcl
           static-assignments-table.adp
           static-assignments-table.tcl
           static-assignments.adp
           static-assignments.tcl Manage static assignments for a workflow.
           task-actions-2.tcl Update task attributes.
           task-actions.adp
           task-actions.tcl Task actions.
           task-add-2.tcl Add task.
           task-add.adp
           task-add.tcl Add task
           task-assignment-add.tcl Make assignment manual.
           task-assignment-delete.tcl Make assignment static for the given transition.
           task-assignment.adp
           task-assignment.tcl Manage assignment of a transition.
           task-attribute-add.tcl Add another attribute to be set by a task.
           task-attribute-delete.tcl The attribute should not be set by the transition.
           task-attribute-move-up.tcl Move up one attribute in the sort_order sequence.
           task-attributes.adp
           task-attributes.tcl Manage attributes to set during a task.
           task-delete.tcl Delete task.
           task-edit-2.tcl Edit task.
           task-edit.adp
           task-edit.tcl Edit task.
           task-panel-add-2.tcl Add the panel.
           task-panel-add.adp
           task-panel-add.tcl Add a task panel.
           task-panel-delete.tcl Delete the panel.
           task-panel-edit-2.tcl Edit the panel.
           task-panel-edit.adp
           task-panel-edit.tcl Edit a task panel.
           task-panel-move-up.tcl Move up one task panel in the sort_key sequence.
           task-panels.adp
           task-panels.tcl Manage workflow task panels.
           transition-display.adp
           transition-display.tcl
           transition-panels-table.adp
           transition-panels-table.tcl
           transitions-table.adp
           transitions-table.tcl
           unassigned-tasks.adp
           unassigned-tasks.tcl List unassigned tasks
          wizard/
                assignments.adp
                assignments.tcl Fourth stage of simple process wizard.
                create.adp
                create.tcl Fifth stage of simple process wizard.
                debug.tcl
                index.adp
                index.tcl Simple process wizard.
                loop-add-2.tcl
                loop-add.adp
                loop-add.tcl
                loop-delete.tcl
                loops.adp
                loops.tcl Third stage of simple process wizard.
                manual-assignment.tcl
                new-2.tcl Second stage of simple process wizard.
                progress-bar.adp
                progress-bar.tcl
                reset-tasks.tcl
                static-assignment.tcl
                task-add-2.tcl
                task-add.adp
                task-add.tcl
                task-delete.tcl
                task-edit-2.tcl
                task-edit.adp
                task-edit.tcl
                task-move.tcl Move a task up one step.
                tasks.adp
                tasks.tcl Second stage of workflow definition.
           workflow-add-2.tcl Add new process.
           workflow-add.adp
           workflow-add.tcl Create new process.
           workflow-cases-delete.tcl Delete a workflow definition from the system.
           workflow-copy-2.tcl Make a copy of a process.
           workflow-copy.adp
           workflow-copy.tcl Make a copy of a process.
           workflow-delete.tcl Delete a workflow definition from the system.
           workflow-display.adp
           workflow-display.tcl
           workflow-dot.tcl Returns a graphviz-dot file representation of the workflow.
           workflow-graph.adp
           workflow-graph.tcl
           workflow-roles.adp
           workflow-roles.tcl Display roles for a workflow
           workflow-summary.adp
           workflow-summary.tcl Displays basic aggregate statistics on a workflow
           workflow-tabs.adp
           workflow-tabs.tcl
           workflow.adp
           workflow.tcl Index page for a workflow.
      assign-yourself.tcl This page assigns a task to the user accessing this page.
      assignee-add-2.tcl Add assignee to task.
      assignee-add.adp
      assignee-add.tcl Add assignee
      assignee-remove-2.tcl Remove assignee from task.
      case-assignment-remove-2.tcl Remove manual assignment.
      case-assignment-set-2.tcl Set case assignments for a role.
      case-assignment-set.adp
      case-assignment-set.tcl Set case assignments for a role.
      case-assignments-table.adp
      case-assignments-table.tcl
      case-assignments.adp
      case-assignments.tcl View/change role assignments for a case.
      case-attributes-table.adp
      case-attributes-table.tcl
      case-deadline-remove-2.tcl Sets deadline for case transition.
      case-deadline-set-2.tcl Sets deadline for case transition.
      case-deadline-set.adp
      case-deadline-set.tcl Set the deadline for a transition in a case.
      case-deadlines-table.adp
      case-deadlines-table.tcl
      case-deadlines.adp
      case-deadlines.tcl Displays deadlines set for a case.
      case-state-change.tcl Change the state of a case
      case-state-graph.adp
      case-state-graph.tcl
      case.adp
      case.tcl Displays information about a case.
      comment-add-2.tcl Add a comment to the journal for a case.
      comment-add.adp
      comment-add.tcl Add a comment to the journal for a case.
      finished-tasks.adp
      finished-tasks.tcl
      index.adp
      index.tcl Displays the user's task list.
      journal.adp
      journal.tcl
     sample/
           expenses-approval-aids.adp
           expenses-approval-aids.tcl
           expenses-claim-info.adp
           expenses-claim-info.tcl
      task-action.adp
      task-action.tcl
      task-assignees.adp
      task-assignees.tcl Remove one or more assignees for a task.
      task-deadline-set-2.tcl Update deadline for a task
      task-deadline-set.adp
      task-deadline-set.tcl Set the deadline for a task
      task-default-info.adp
      task-default-info.tcl
      task-instructions.adp
      task-instructions.tcl
      task-list.adp
      task-list.tcl
      task.adp
      task.tcl Displays information about a specific task.
      test-display.tcl
      transition-fire.tcl Fire a transition.
      workflow-gif.tcl
      workflow.tcl Admin big picture view of a workflow, including places, transitions and arcs
 

 

  Contact Us
  Project Open Business Solutions S.L.

Calle Aprestadora 19, 12o-2a

08902 Hospitalet de Llobregat (Barcelona)

Spain

 Tel Europe: +34 609 953 751
 Tel US: +1 415 200 2465
 Mail: info@project-open.com