1 / 21

OpenACS Workflow

This presentation introduces the OpenACS Workflow package, covering roles, cases, actions, states, and how to define and integrate workflows in web applications.

mrandy
Download Presentation

OpenACS Workflow

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OpenACS Workflow Mark Aufflick pumptheory.com

  2. This presentation • Goal: Learn to use a workflow in a web application • The OpenACS Workflow package • Roles, Cases, Actions & States • Defining a workflow • Integrating a workflow with your app

  3. A Brief History • The original ACS Workflow package was designed using Petri Nets as the underlying formal model • It’s design was very thorough, but the use of Petri Nets was overcomplicated and unnecessary in perhaps 95% of use cases • In 2003 Lars Pind of Collaboraid didn’t use the existing workflow package because it was cumbersome and unfinished – even though he was the original author while working for ArsDigita!

  4. The new Workflow • An analysis of common use cases showed that all common business workflows can be modeled with a simple Finite State Machine • The new workflow package is a modular development framework, and allows multiple workflow models to be used • Initially only FSMs are supported

  5. User Interface? • Many workflow packages, including the original ACS Workflow, have funky UIs • But – development is nearly always required • So – the new workflow has been designed as a developer framework that allows the power of workflows to be easily incorporated into applications

  6. Workflow Overview • A workflow is a set of: • Roles • Actions • States • plus their relations • A workflow is associated with an object type

  7. Cases • A workflow in action is a CASE • A case revolves around a specific object • A case holds information about: • Current state • Current assignments • Activity log

  8. Roles • From our publishing example, roles might be: • Author • Editor • Publisher • Roles convey permission and responsibility • Roles can be assigned by default and reassigned

  9. Actions • Which actions are available will depend on the current state • Actions may change the state • Actions can have side effects • Allowed roles control who can perform what actions • Assigned roles indicate who is responsible for the action • A workflow has an initial action

  10. States • A workflow has a finite set of states • From our bug tracker example: • Open • Resolved • Closed • A case will always be in exactly one state • States contain almost no information

  11. Defining a workflow • Start by drawing a diagram • -> your states, actions and roles set spec { contract { pretty_name "Contract" package_key "finance-contracts" object_type “finance_contract“ roles { } states { } actions { } } }

  12. Defining a workflow: Roles roles { submitter { pretty_name "Submitter" call_backs { workflow.Role_DefaultAssignees_CreationUser } } assignee { pretty_name “Assignee” callbacks { bug-tracker.ComponentMaintainer bug-tracker.ProjectMaintainer workflow.Role_PickList_CurrentAssignees workflow.Role_AssigneeSubquery_RegisteredUsers } } }

  13. Defining a workflow: States submitted { pretty_name "Submitted“ hide_fields { date_approval date_settlement } } approved { pretty_name "Approved" hide_fields { date_settlement } } declined { pretty_name "Declined" hide_fields { date_settlement } } settled { pretty_name "Settled" } discarded { pretty_name "Discarded" }

  14. Defining a workflow: Actions (1) submit { pretty_name "Submit" pretty_past_tense "Submitted" new_state "submitted" initial_action_p t } comment { pretty_name "Comment" pretty_past_tense "Commented" allowed_roles { submitter } priviliges { read write } always_enabled_p t }

  15. Defining a workflow: Actions (2) decline { pretty_name "Decline" pretty_past_tense "Declined" assigned_role "submitter" assigned_states { submitted } new_state "declined" privileges { write } edit_fields { date_approval } } approve { pretty_name "Approve" pretty_past_tense "Approved" assigned_role "submitter" assigned_states { submitted } new_state "approved" privileges { write } edit_fields { date_approval } }

  16. Integrating With Your App's API • Creating new objects • workflow::case::new • Fetching data • workflow::case::get • Editing objects • workflow::case::action::execute • see packages/bug-tracker/tcl/bug-procs.tcl

  17. Integrating with your App’s UI • Bug Tracker demo… • Use ad_form to build the form fields • Workflow will give you: • Action buttons (workflow::case::get_available_actions) • Role assignment (workflow::case::role::add_assignee_widgets ) • Case log ( workflow::case::get_activity_html ) • See packages/bug-tracker/www/bug.tcl

  18. Integrating with your app’s queries • For complex view-only listings, stats etc. • Join with: • workflow_cases • workflow_fsm_states • And others… • See the bug-tracker index-postgresql.xql for an example

  19. Service Contracts and Callback goodness • What is a callback good for? • Notifications • Other side effects • What is a service contract? • ACS Service contract allows packages to define and register implementation of interfaces • ACS Service contract provides mean to dispatch method calls on an interface implementation. • Interface Discovery is available programmatically • The Service Contract interface specification was inspired by WDSL, the interface specfication for web services.

  20. Package development details • APM TCL callbacks: • after-install (workflow::fsm::new_from_spec) • before-uninstall ( workflow::delete ) • before-upgrade • after-instantiate ( workflow::fsm::clone ) • before-uninstantiate( workflow::delete )

  21. References • All references, slides and materials will be posted on the internet at: http://pumptheory.com/collaboration/open-acs/lectures/ • OpenACS Workflow documentation • http://www.collaboraid.biz/developer/workflow-spec

More Related