Forum OpenACS Q&A: Response to Workflow HOWTO

2: Response to Workflow HOWTO (response to 1)
Posted by Lars Pind on

You need to create PL/SQL functions when you want to execute some code when some event occurs: For callbacks.

To start a workflow, you use the to create a new case, then workflow_case.start to start it.

While you can manually do this from the workflow admin page, you really need to do this from your application. For example, on the page that creates a new content item, or a new ticket, or whatever, you also create a new case and start it.

To fire an enabled transition, you use workflow_case.begin_task_action, then workflow_case.end_task_action, with an optional number of calls to workflow_case.set_attribute_value in between. (This really ought to be one function call, but it can't be done in PL/SQL.)

Here, you can use the task page delivered by the workflow package. When I left them off, they could still use some improvement, but they generally work, and they take care of all the attribute setting, re-assignment, etc. for you. They take a return_url argument, so you can just redirect to them from your own application.

If you want to, you can also roll your own, and possibly only use the pages that do the actual firing/reassignment, etc. from the workflow package.

Did that help you get started?