Forum OpenACS Q&A: Workflow HOWTO

Collapse
Posted by Kevin Crosbie on
Hi all,

I have been reading through all of the documentation available for
the workflow module, as in how to configure your own workflow.  It
appears to tell you what everything is, but not really to give you
any examples or step by step guide of just how to go about creating a
workflow and integrating it into your system.

I did see the Developers Guide, and it gave me a better view, but I'm
not sure if I'm supposed to be creating my own PL/SQL functions or
when I will need them.  I sort of get a bit lost after creating the
diagram and adding arcs etc.  How would you get your workflow to
start off or 'fire'?

Am I missing something? is there more out there, or will there be
more info in the next Beta release.

Cheers,

Kevin

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

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 workflow_case.new 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?

Collapse
3: Response to Workflow HOWTO (response to 1)
Posted by Kevin Crosbie on
Thanks Lars,

That seems much clearer now.  I'm going though the examples, and I've a much better idea of what's going on.

Cheers,

Kevin