Index: openacs-4/packages/workflow/www/doc/developer-guide.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/www/doc/developer-guide.html,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/workflow/www/doc/developer-guide.html 22 Apr 2003 17:15:03 -0000 1.1.2.3 +++ openacs-4/packages/workflow/www/doc/developer-guide.html 23 Apr 2003 09:20:05 -0000 1.1.2.4 @@ -1311,16 +1311,70 @@

- To add the case log to the comment field, use workflow::case::get_activity_html. + To add the case log to the comment field, use + workflow::case::get_activity_html and feed it to the + before_html property of a textarea.

-

Integrating With Your Application's Queries

+

+ Here's an example of how the bug-tracker integrates with workflow + for nformation about the current state of bugs. +

+
+select b.bug_id,
+       ...
 
+       st.pretty_name as pretty_state,
+       st.short_name as state_short_name,
+       st.state_id,
+       st.hide_fields,
 
+       assignee.party_id as assignee_party_id,
+       assignee.email as assignee_email,
+       assignee.name as assignee_name
+
+from   bt_bugs b,
+       workflow_cases cas left outer join
+       (select rpm.case_id,
+               p.party_id,
+               p.email,
+               acs_object__name(p.party_id) as name
+          from workflow_case_role_party_map rpm,
+               parties p
+         where rpm.role_id = :action_role
+           and p.party_id = rpm.party_id
+         ) assignee on (cas.case_id = assignee.case_id),
+       workflow_case_fsm cfsm,
+       workflow_fsm_states st 
+where  cas.workflow_id = :workflow_id
+and    cas.object_id = b.bug_id
+and    cfsm.case_id = cas.case_id
+and    st.state_id = cfsm.current_state
+and    b.project_id = :package_id
+order  by $order_by_clause
+
+ +

+ Note the outer join to get the assignee(s). The joins to get + information about the current state is straight-forward. +

+ +

Good Luck!

+ +

+ That's all I think you'll need to know to start developing + workflow-enabled applications. +

+ +

+ Let me know how it goes, or of something's missing, by posting on + the OpenACS Forums. +

+
lars@pinds.com