Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

]project-open[ Workflow Developer Tutorial Part 3

Customization, Graphical User Interface, business logic and other advanced topics

  • Be the first to comment

]project-open[ Workflow Developer Tutorial Part 3

  1. 1. ]project-open[ Workflow Tutorial Part 3: Customization, Graphical User Interface, business logic and other advanced topics Start Place Transition End Transition [Not OK] [OK]
  2. 2. Tutorial Overview <ul><li>PO-Workflow-Tutorial-1-Overview.ppt This document provides a short overview of the ]project-open[ workflow. </li></ul><ul><li>PO-Workflow-Tutorial-2-EDI-Example.ppt: The next section guides you step-by-step through a real-world EDI Message workflow scenario. </li></ul><ul><li>PO-Workflow-Tutorial-3-Cusomizations.ppt The third section deals with the customization of the workflow to implement custom business logic, custom GUI panels and custom assignments. </li></ul>
  3. 3. Customizing Workflow Panels
  4. 4. EDI Message WF Customer Satisfaction Survey <ul><li>According to the business specs from the 1st part of this tutorial, the customer should fill out a customer satisfaction survey to determine the quality of the work. </li></ul><ul><li>In the real world, this survey is used to calculate the bonus of the message development team… </li></ul><ul><li>We are now going to configure this “Simple Survey” as part of the workflow. </li></ul>
  5. 5. Default Workflow “Panels” <ul><li>By default, the workflow shows: </li></ul><ul><ul><li>The default Object Panel on the left hand side with the name of the object and its type. </li></ul></ul><ul><ul><li>The default Action Panel with a “Start task” button. The panel will show a “Task done” once the task is started or a yes/no select if this transition was configured as a loop. </li></ul></ul><ul><ul><li>“ Administrative actions” are only shown to users with workflow admin permissions </li></ul></ul><ul><ul><li>The “Journal” contains an audit log of past actions, their time and the person executing them. </li></ul></ul>Object Panel Action Panel
  6. 6. Setup Simple Survey <ul><li>Please setup a Simple Survey in Admin -> Simple Surveys similar to the one at the right hand side. </li></ul><ul><li>To test the survey please go to any Project and click on the “Take survey” link in the “Project Surveys” portlet. </li></ul>
  7. 7. Set our Simple Survey as Workflow Panel <ul><li>Go to your workflow and select the “Panels” page. It shows a list of WF transitions and their panels. Click on “add panel”. </li></ul><ul><li>The “Header” is used to select the corresponding simple survey. Please make sue the header contains the name of an active simple survey (case sensitive!). </li></ul><ul><li>The /packages/ simple-survey/ www/ one page has been previously enabled to act as a workflow panel. </li></ul><ul><li>“ Override default Action panel” specifies if we want to override the left (object) or the right (action) panel. </li></ul><ul><li>Setting “Override both panels” to “yes” means that our Simple Survey panel will override both panels. </li></ul>
  8. 8. Workflow Transition with Customer Satisfaction Survey <ul><li>The finished custom panel shows the working Customer Satisfaction Survey. </li></ul><ul><li>Pressing “Continue” will automatically finish the workflow task. This behavior has been coded into the /package/ simple-survey/ www/ process-response.tcl page. </li></ul>
  9. 9. Create Your Own Panel <ul><li>Any valid TCL page can be used as a workflow panel, if it complies with some conventions: </li></ul><ul><ul><li>The page should return a simple piece of HTML without <HTML>, <HEAD> and <BODY> tags, so you want to disable the ]po[ header in general. </li></ul></ul><ul><ul><li>The page should not include a ad_page_contract. </li></ul></ul><!-- /packages/intranet-workflow/www/panels/hello-world.tcl --> <h1>Hello World</h1> <p>The following list shows all entries in the &quot;task&quot; hash available.</p> <table> @debug_html;noquote@ </table> # /packages/intranet-workflow/www/panels/hello-world.tcl # Show al l available task information set debug_html &quot;&quot; foreach var [array names task] { set val $task($var) append debug_html &quot;<tr><td>$var=</td><td>$val</td></tr> &quot; } ad_return_template
  10. 10. Other Existing WF Panels <ul><li>The following pages have been prepared to </li></ul><ul><li>act a workflow panels: </li></ul><ul><li>Hello World example & tutorial: /packages/ intranet-workflow/ www/ panels/ hello-world </li></ul><ul><li>Absences: /packages/ intranet-timesheet2-workflow/ www/ absences/ absence-panel </li></ul><ul><li>Tickets: /packages/ intranet-helpdesk/ www/ new </li></ul><ul><li>Simple Surveys (uses the panel header as name of the survey to show): /packages/ simple-survey/ www/ one </li></ul><ul><li>Expense Bundles: /packages/ intranet-expenses/ www/ bundle-new </li></ul><ul><li>Timesheet Hours: /packages/ intranet-timesheet2-workflow/ www/ conf-objects/ conf-obj-panel </li></ul>
  11. 11. Simple Status Reporting
  12. 12. Inform the PM About the Status <ul><li>The objective of status reporting is to tell stakeholders quickly about the progress of the workflow. </li></ul><ul><li>One simple option is reporting via the underlying business object: The WF update the status of the business object, and this status is shown in the ]po[ GUI. </li></ul><ul><li>The screenshots at the right hand side shows how the project status is reported: </li></ul><ul><ul><li>In the “Projects” page, the status of each main project is shown. This is useful, if the workflow is associated with a top-level projects. </li></ul></ul><ul><ul><li>The 2nd screenshot shows the “Project Hierarchy” portlet of a project with the status of its sub-projects. This is useful if the workflow is associated with sub-projects, as it is the case in the EDI Message development example. </li></ul></ul>
  13. 13. Business Object Status Updates <ul><li>Every workflow stage can update the status of the underlying business object. Examples: </li></ul><ul><ul><li>Approval workflows: The object’s status is set to “accepted” or “rejected” depending on workflow decisions </li></ul></ul><ul><ul><li>Lifecycle workflows: The workflow controls the lifecycle of an object (EDI Message WF). </li></ul></ul><ul><li>The diagram at the right hand side shows an example on how the status of an EDI Message project could be updated from a workflow </li></ul>Analysis Developing QC Checking Getting UA Deployed Maintenance Business Object Status
  14. 14. Status Reporting: How to Implement <ul><li>Setup a new Category Example: Project status: “Analyzing” </li></ul><ul><li>Make the new category a sub-category of the project status “Open” </li></ul><ul><li>Add a “callback” to the WF transition to update the status </li></ul>
  15. 15. Status Reporting: Create a New Category <ul><li>Create a new category of type “Intranet Project Type”. </li></ul><ul><li>After creating the category please “edit” again and select “Open” in the “Is-A” list. This way, the status becomes a sub-status of “Open” </li></ul>
  16. 16. Status Reporting: Callbacks to Set the Object State <ul><li>In the WF admin page got to “Graphical Process Editor”, select the desired transition and click on “Actions” to see the screen at the right. </li></ul><ul><li>In the “Enable” callback write “im_workflow__set_object_status_id” and “60000” in the “Custom Argument” field (60000 is the category_id of the new project status “Business Analysis” that we have created in the last step. </li></ul><ul><li>The “Enable” callback is executed _before_ the task is started, so this is the right place to set the status of the project. </li></ul>
  17. 17. Computed Assignments: Assign the Project Admin(s) to a Transition
  18. 18. Business Case: Assign Project Admins <ul><li>Let’s assume that you want to assign the project administrators to a transition. </li></ul><ul><li>“ Project admins” are users in the “Project Members” component with role “project manager”. </li></ul><ul><li>We will use the “Unassigned Callback” of the transition’s “Action” page to execute a PL/SQL procedure to assign the users. </li></ul>
  19. 19. Data-Model: Identify Project Admins <ul><li>How can we assign the project manager of a project to a workflow task? </li></ul><ul><li>The data-model on the right-hand side shows how to identify the “Project Members” of a project and the corresponding SQL query. </li></ul><ul><li>The object_role_id of the im_biz_object_members table identifies the type of relationship between the user and the project. Project Admin relationships are identified by catgory-id = 1301. </li></ul>im_projects <ul><li>project_id </li></ul><ul><li>project_name </li></ul><ul><li>… </li></ul>wf_cases <ul><li>case_id </li></ul><ul><li>workflow_key </li></ul><ul><li>object_id </li></ul>cc_users <ul><li>user_id </li></ul><ul><li>username </li></ul><ul><li>first_names </li></ul><ul><li>last_name </li></ul><ul><li>… </li></ul>acs_rels <ul><li>rel_id </li></ul><ul><li>rel_type </li></ul><ul><li>object_id_one </li></ul><ul><li>object_id_two </li></ul>im_biz_object members <ul><li>rel_id </li></ul><ul><li>object_role_id </li></ul>im_categories <ul><li>category_id </li></ul><ul><li>category </li></ul><ul><li>category_type </li></ul>=1301 select r.object_id_two as user_id, im_name_from_user_id(r.object_id_two) as name from wf_cases wfc, im_projects p, acs_rels r, im_biz_object_members bom where wfc.object_id = p.project_id and r.object_id_one = p.project_id and r.rel_id = bom.rel_id and bom.object_role_id = 1301;
  20. 20. Data-Model: Identify Project Admins <ul><li>The PL/SQL procedure will assign project admins to the current task, there was no manual or static assigments. </li></ul><ul><li>The procedure is part of ]po[ and available in /packages/ intranet-workflow/ sql/ postgresql/ workflow- callback- procs.sql </li></ul>create or replace function im_workflow__assign_to_project_admins (integer, text, text) returns integer as ' declare p_case_id alias for $1; p_transition_key alias for $2; p_custom_arg alias for $3; v_task_id integer; v_case_id integer; v_creation_ip varchar; v_creation_user integer; v_object_id integer; v_object_type varchar; v_journal_id integer; v_transition_key varchar; v_workflow_key varchar; row RECORD; begin -- Select out some frequently used variables of the environment select c.object_id, c.workflow_key, task_id, c.case_id, co.object_type, co.creation_ip into v_object_id, v_workflow_key, v_task_id, v_case_id, v_object_type, v_creation_ip from wf_tasks t, wf_cases c, acs_objects co where c.case_id = p_case_id and c.case_id = co.object_id and t.case_id = c.case_id and t.workflow_key = c.workflow_key and t.transition_key = p_transition_key; FOR row IN select r.object_id_two as user_id, im_name_from_user_id(r.object_id_two) as user_name from wf_cases wfc, im_projects p, acs_rels r, im_biz_object_members bom where wfc.case_id = v_case_id and wfc.object_id = p.project_id and r.object_id_one = p.project_id and r.rel_id = bom.rel_id and bom.object_role_id = 1301 LOOP v_journal_id := journal_entry__new( null, v_case_id, v_transition_key || '' assign_to_user '' || row.user_name, v_transition_key || '' assign_to_user '' || row.user_name, now(), v_creation_user, v_creation_ip, ''Assigning to '' || row.user_name ); PERFORM workflow_case__add_task_assignment(v_task_id, row.user_id, ''f''); PERFORM workflow_case__notify_assignee (v_task_id, row.user_id, null, null, ''wf_'' || v_object_type || ''_assignment_notif''); END LOOP; return 0; end;' language 'plpgsql';
  21. 21. Notifications and Emails
  22. 22. Notifications Background <ul><li>Workflow Notifications are a very sensitive subject, because of the profile of the notified users (managers, customers and employees) </li></ul><ul><li>Too many notifications are considered intrusive and may cause strong emotional reactions. </li></ul><ul><li>The problem appears particularly if many users are assigned to a transition, because only one of the users will actually perform the WF task. </li></ul><ul><li>Only users “assigned” to a WF task may actually start a WF task (unless they are WF administrators). For this reason we need to assign all users who might(!) want to execute the task. </li></ul>
  23. 23. Static and Manual Assignment Notifications <ul><li>A callback exists to </li></ul><ul><li>Transitions assigned to users via static and manual assignments can be </li></ul>
  24. 24. Notification Computed Assignments <ul><li>The computed assignment procedures automaticll </li></ul>
  25. 25. Various Hints
  26. 26. Changing the size of the WF Component <ul><li>Are the workflow in the “Project WF Graph” portlet too large or too small for your typical workflows? </li></ul><ul><li>In Admin -> Parameters -> intranet-workflow you can modify the size of the workflow graphs. </li></ul>
  27. 27. Notifications for late Transitions <ul><li>Complicated solution: Add timeout logic to each of the transitions. This would clutter the WF a lot… </li></ul><ul><li>Better solution: Create a report that lists all late WF transitions and add a “batch-action” to send out mass-emails to the users with late transitions. </li></ul>
  28. 32. Portlet Integration Project View Page (TCL) Project Base Data Finance Info Project Hierarchy Forum im_component_plugins <ul><li>plugin_id - 12345 </li></ul><ul><li>plugin_name - Forum </li></ul><ul><li>package_name - intranet-forum </li></ul><ul><li>sort_order - 20 </li></ul><ul><li>page_url - /intranet/index </li></ul><ul><li>location - right </li></ul><ul><li>component_tcl - … </li></ul><ul><li>enabled_p - t </li></ul>im_forum_component -user_id $user_id -forum_object_id $project_id -current_page_url $current_url -return_url $return_url -forum_type &quot;project&quot; component_tcl user_id = $user_id forum_object_id = …
  29. 34. Workflow Notifications <ul><li>Option 1: Use “im_workflow__assign_to_group” + group name in the “Unassigned Callback” of a transition </li></ul><ul><li>Option 2: Notification Callback Check Google… </li></ul>
  30. 35. Frequently Used Assignment Callbacks <ul><li>assign_to_owner – assign the task to the business object’s creator </li></ul><ul><li>assign_to_supervisor – assign the task the supervisor of the business object’s creator </li></ul><ul><li>assign_to_group – assign to the members of a particular group </li></ul>
  31. 36. Linear vs. Real-World Workflows <ul><li>asdf </li></ul>Linear version of the EDI Message workflow. Start Business Analysis End Check Specs [Not OK] [OK] Develop Message QC Check [OK] [Not OK] QA Release to Production [OK] 30 days Maintenance [OK] [Not OK] User Acceptance [OK] [OK] [Not OK] [Not OK] [Not OK] User Survey [OK] Resource Assignment