Your SlideShare is downloading. ×
]project-open[ Workflow Developer Tutorial Part 3
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

]project-open[ Workflow Developer Tutorial Part 3


Published on

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

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

Published in: Technology

1 Comment
1 Like
No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 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. Tutorial Overview
    • PO-Workflow-Tutorial-1-Overview.ppt This document provides a short overview of the ]project-open[ workflow.
    • PO-Workflow-Tutorial-2-EDI-Example.ppt: The next section guides you step-by-step through a real-world EDI Message workflow scenario.
    • 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.
  • 3. Customizing Workflow Panels
  • 4. EDI Message WF Customer Satisfaction Survey
    • 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.
    • In the real world, this survey is used to calculate the bonus of the message development team…
    • We are now going to configure this “Simple Survey” as part of the workflow.
  • 5. Default Workflow “Panels”
    • By default, the workflow shows:
      • The default Object Panel on the left hand side with the name of the object and its type.
      • 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.
      • “ Administrative actions” are only shown to users with workflow admin permissions
      • The “Journal” contains an audit log of past actions, their time and the person executing them.
    Object Panel Action Panel
  • 6. Setup Simple Survey
    • Please setup a Simple Survey in Admin -> Simple Surveys similar to the one at the right hand side.
    • To test the survey please go to any Project and click on the “Take survey” link in the “Project Surveys” portlet.
  • 7. Set our Simple Survey as Workflow Panel
    • Go to your workflow and select the “Panels” page. It shows a list of WF transitions and their panels. Click on “add panel”.
    • 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!).
    • The /packages/ simple-survey/ www/ one page has been previously enabled to act as a workflow panel.
    • “ Override default Action panel” specifies if we want to override the left (object) or the right (action) panel.
    • Setting “Override both panels” to “yes” means that our Simple Survey panel will override both panels.
  • 8. Workflow Transition with Customer Satisfaction Survey
    • The finished custom panel shows the working Customer Satisfaction Survey.
    • Pressing “Continue” will automatically finish the workflow task. This behavior has been coded into the /package/ simple-survey/ www/ process-response.tcl page.
  • 9. Create Your Own Panel
    • Any valid TCL page can be used as a workflow panel, if it complies with some conventions:
      • 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.
      • The page should not include a ad_page_contract.
    <!-- /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. Other Existing WF Panels
    • The following pages have been prepared to
    • act a workflow panels:
    • Hello World example & tutorial: /packages/ intranet-workflow/ www/ panels/ hello-world
    • Absences: /packages/ intranet-timesheet2-workflow/ www/ absences/ absence-panel
    • Tickets: /packages/ intranet-helpdesk/ www/ new
    • Simple Surveys (uses the panel header as name of the survey to show): /packages/ simple-survey/ www/ one
    • Expense Bundles: /packages/ intranet-expenses/ www/ bundle-new
    • Timesheet Hours: /packages/ intranet-timesheet2-workflow/ www/ conf-objects/ conf-obj-panel
  • 11. Simple Status Reporting
  • 12. Inform the PM About the Status
    • The objective of status reporting is to tell stakeholders quickly about the progress of the workflow.
    • 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.
    • The screenshots at the right hand side shows how the project status is reported:
      • 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.
      • 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.
  • 13. Business Object Status Updates
    • Every workflow stage can update the status of the underlying business object. Examples:
      • Approval workflows: The object’s status is set to “accepted” or “rejected” depending on workflow decisions
      • Lifecycle workflows: The workflow controls the lifecycle of an object (EDI Message WF).
    • 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
    Analysis Developing QC Checking Getting UA Deployed Maintenance Business Object Status
  • 14. Status Reporting: How to Implement
    • Setup a new Category Example: Project status: “Analyzing”
    • Make the new category a sub-category of the project status “Open”
    • Add a “callback” to the WF transition to update the status
  • 15. Status Reporting: Create a New Category
    • Create a new category of type “Intranet Project Type”.
    • 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”
  • 16. Status Reporting: Callbacks to Set the Object State
    • 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.
    • 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.
    • The “Enable” callback is executed _before_ the task is started, so this is the right place to set the status of the project.
  • 17. Computed Assignments: Assign the Project Admin(s) to a Transition
  • 18. Business Case: Assign Project Admins
    • Let’s assume that you want to assign the project administrators to a transition.
    • “ Project admins” are users in the “Project Members” component with role “project manager”.
    • We will use the “Unassigned Callback” of the transition’s “Action” page to execute a PL/SQL procedure to assign the users.
  • 19. Data-Model: Identify Project Admins
    • How can we assign the project manager of a project to a workflow task?
    • The data-model on the right-hand side shows how to identify the “Project Members” of a project and the corresponding SQL query.
    • 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.
    • project_id
    • project_name
    • case_id
    • workflow_key
    • object_id
    • user_id
    • username
    • first_names
    • last_name
    • rel_id
    • rel_type
    • object_id_one
    • object_id_two
    im_biz_object members
    • rel_id
    • object_role_id
    • category_id
    • category
    • category_type
    =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. Data-Model: Identify Project Admins
    • The PL/SQL procedure will assign project admins to the current task, there was no manual or static assigments.
    • The procedure is part of ]po[ and available in /packages/ intranet-workflow/ sql/ postgresql/ workflow- callback- procs.sql
    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. Notifications and Emails
  • 22. Notifications Background
    • Workflow Notifications are a very sensitive subject, because of the profile of the notified users (managers, customers and employees)
    • Too many notifications are considered intrusive and may cause strong emotional reactions.
    • The problem appears particularly if many users are assigned to a transition, because only one of the users will actually perform the WF task.
    • 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.
  • 23. Static and Manual Assignment Notifications
    • A callback exists to
    • Transitions assigned to users via static and manual assignments can be
  • 24. Notification Computed Assignments
    • The computed assignment procedures automaticll
  • 25. Various Hints
  • 26. Changing the size of the WF Component
    • Are the workflow in the “Project WF Graph” portlet too large or too small for your typical workflows?
    • In Admin -> Parameters -> intranet-workflow you can modify the size of the workflow graphs.
  • 27. Notifications for late Transitions
    • Complicated solution: Add timeout logic to each of the transitions. This would clutter the WF a lot…
    • 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.
  • 28.  
  • 29.  
  • 30.  
  • 31.  
  • 32. Portlet Integration Project View Page (TCL) Project Base Data Finance Info Project Hierarchy Forum im_component_plugins
    • plugin_id - 12345
    • plugin_name - Forum
    • package_name - intranet-forum
    • sort_order - 20
    • page_url - /intranet/index
    • location - right
    • component_tcl - …
    • enabled_p - t
    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 = …
  • 33.  
  • 34. Workflow Notifications
    • Option 1: Use “im_workflow__assign_to_group” + group name in the “Unassigned Callback” of a transition
    • Option 2: Notification Callback Check Google…
  • 35. Frequently Used Assignment Callbacks
    • assign_to_owner – assign the task to the business object’s creator
    • assign_to_supervisor – assign the task the supervisor of the business object’s creator
    • assign_to_group – assign to the members of a particular group
  • 36. Linear vs. Real-World Workflows
    • asdf
    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