Oracle Workflow

  • Published on
    29-Nov-2014

  • View
    109

  • Download
    2

Embed Size (px)

Transcript

<p>Oracle Workflow</p> <p>Version 1.0</p> <p>1</p> <p>Agenda Overview Workflow Builder</p> <p> Workflow Components Create Workflow Process Item Type - Standard Workflow Architecture Workflow Directory Services Workflow Monitor Workflow Item attributes Business Event System Workflow development Approaches Workflow Technical Architecture</p> <p>Version 1.0</p> <p>2</p> <p>Objectives Know what is Oracle workflow Know how business processes are modelled with workflow builder Know how workflow processes can be monitored Know architecture of Oracle workflow</p> <p>Version 1.0</p> <p>3</p> <p>Overview Oracle Workflow is a Business Process Management tool. It is used for modeling, automating &amp; monitoring Business processes, during which documents, information or tasks are passed from one participant to another for action, according to a set of procedural rules. Here is a sample workflow process diagram..</p> <p>Version 1.0</p> <p>4</p> <p>Overview (Contd.).Oracle Workflow accomplishes these important business requirements: 1. Models Business Process with Rules :</p> <p>Oracle Workflow lets you model sophisticated business processes with loop, branch, parallel flows and then decompose into subflows. Oracle Workflow can decide which path to take based on the result of a stored PL/SQL procedure. Routes information through Oracle Apps for action or notification. The attachments include self-service Web page and Application forms. Delivers electronic notifications to any Oracle Applications user. Delivers electronic notifications to any e-mail or Internet user. Oracle Workflow lets you set up subscriptions to business events which can launch workflows. You can communicate events among systems within your own enterprise and with external systems as well to achieve complex system integration scenarios.5</p> <p>2. Routes Information for necessary Action :</p> <p>3. Delivers Electronic Notifications :</p> <p>4. Integrating Systems</p> <p>Version 1.0</p> <p>Workflow Builder</p> <p>Oracle Workflow Builder is a graphical tool that lets you create, view, or modify abusiness process with simple drag and drop operations.</p> <p>Version 1.0</p> <p>6</p> <p>Workflow Components Data Store: A database connection or flat file that holds a workflow processdefinition.</p> <p>Item Type: A specific business document or transaction eg. Purchase order can be</p> <p>an item type. All the workflow components mentioned below are grouped together as an Item type. Item Type Attribute: A feature of the item type which stores information that can be globally referenced by any activity in a process. Also referred to as an item attribute. Process Activity: A series of actions that need to be performed to accomplish a business goal. A process is represented by a workflow diagram. A process can include function activities, notification activities, event activities, and other subprocesses. Event Activity: A business event modeled as an activity so that it can be included in a workflow process. Notification Activity: A unit of work that requires human intervention. A notification activity sends a message to a performer. Function Activity: An automated unit of work, usually defined as a PL/SQL stored procedure. A function activity can also run an external function. In the standalone version of Oracle Workflow, a function activity can also run a Java program on the middle tier. Message: The information sent by a notification activity. The message may request the performer to do some work or may simply provide information.</p> <p>Version 1.0</p> <p>7</p> <p>Workflow Components (Contd.). Lookup Type: A list of values that can be referenced by any activity in a workflowprocess. The values in the list are called lookup codes.</p> <p>Transition: The relationship that defines the completion of one activity and theactivation of another activity within a process. In a process diagram, a transition is represented as an arrow between two activities.</p> <p>Item: A specific business document or transaction. For example, purchase order canbe an item type while a purchase order identified by a particular ID number is an item of that item type.</p> <p>Process Instance: A unique item being managed by a process.</p> <p>Version 1.0</p> <p>8</p> <p>Workflow Components (Contd.).Process: F T N Y Function: PL/SQL code returns Result Notification: Message Result T Result F Result B Result A</p> <p>}Result Type = Lookup Type Result Y Result N</p> <p>}RESULT Resp 1 Resp 2 </p> <p>FYI Response Required</p> <p>Send Attributes Send and Respond Attributes</p> <p>}9</p> <p>Event: Event MessageVersion 1.0</p> <p>Receive Raise Send</p> <p>}</p> <p>(No Result)</p> <p>Create Workflow Process</p> <p>Version 1.0</p> <p>Version 1.0</p> <p>10</p> <p>Create Item Type Open or create a data store in Navigator window. Right click and create an item type. Assign an eight character internal name in upper case without colons or spaces. Specify a persistence type of temporary or permanent. If temporary, then provide the no. of days after which its audit trail will be purged, once the workflow item instance is completed. If any workflow item type has more than one runnable processes, the selector function identifies the specific process the workflow Engine should execute when a workflow is initiated for this item type. Select the Access tab page to set the access and customization levels for this item type.</p> <p>Version 1.0</p> <p>11</p> <p>Create Item Attribute Create an item attribute , assign it an internal name which must be uppercase, maximum 8 characters. this is not updatable and should not have colons or spaces. It acts as a global variable that can be referenced or updated by any activity within a process.</p> <p>Version 1.0</p> <p>12</p> <p>Create Lookup Type A lookup type is a static list of values. These lists can be referenced as Result type by function and notification activities. A message attribute can reference a lookup type as a means of providing a list of possible responses to the performer of a notification. We can create an Approval lookup type, which will have 2 lookup codes viz: Approved &amp; Rejected.</p> <p>Version 1.0</p> <p>13</p> <p>Create Lookup Code Lookup codes represent the actual values in a lookup type. The lookup codes for a lookup type are defined in the navigator tree beneath the lookup type. Right click on the lookup type and choose New lookup code to create a APPROVED lookup code.</p> <p>Version 1.0</p> <p>14</p> <p>Create Message A message is what a notification activity sends to a role in a workflow process. A message can prompt a user for a reply or an action to take that determines what the next activity in the process should be. The recipient of a workflow message is called the performer, which is defined in Notification node.</p> <p>The subject can include message attributes that get token replaced with runtime values. To include a message attribute, use an ampersand (&amp;) followed by the message attributes internal name. You can enter plain text or html formatted message in the body.</p> <p>Version 1.0</p> <p>15</p> <p>Create Message Result and Attributes Specify a display name and description for Message Result. Select a lookup type from the poplist field. The lookup type you select should be identical to the lookup type specified for the notification activitys result type.</p> <p>Enter message attribute internal name. Specify Send or Respond in the Source field to indicate whether this attribute should send information or prompt a recipient for a response. The Display Name appears as the response prompt, If this is a Respond message attribute.</p> <p>Version 1.0</p> <p>16</p> <p>Create Notification Activity The message sent by a notification activity can simply convey information or it can require a response. If the message requires a response, then create Send message attributes that provide enough information for the recipient to respond, and also create Respond message attributes that prompt a response. If you plan to assign this notification to a role consisting of multiple users and you want to send an individual copy of this notification to each user in the role, then check Expand Roles. If you uncheck Expand Roles, then only one copy of the notification is delivered to the role as a whole. If you provide a PL/SQL procedure as Function, then it lets you add processing logic to the notification activity and also known as a post-notification function.</p> <p>Version 1.0</p> <p>17</p> <p>Create Function Activity The PL/SQL procedure for a function activity can return some result that determines the next transition the Workflow Engine takes. That result should be defined as a code in a lookup type.</p> <p>Version 1.0</p> <p>18</p> <p>Create Event Activity An event activity can either receive, raise, or send a business event from the Business Event System. An event activity does not have a result, but you can branch on the contents of an event message using comparison activities provided in the Standard item type.</p> <p>Version 1.0</p> <p>19</p> <p>Create Process Activity</p> <p>You can drag and drop activities from the navigator tree into the process window or create activities directly in the process window by right-click and choosing the option. You define transitions between activities by drawing arrows from one node to the next by clicking the right mouse button and drawing it to the next activity while keeping it pressed. Notification, function, event, and process activities make up the nodes of a process. 20</p> <p>Version 1.0</p> <p>Workflow Technical Architecture</p> <p>Version 1.0</p> <p>Version 1.0</p> <p>21</p> <p>Master Table ListWF_PROCESS_ACTIVITIES WF_ACTIVITIES WF_ACTIVITY_ATTRIBUTES WF_ITEM_TYPES WF_ITEM_ATTRIBUTES WF_MESSAGES WF_MESSAGE_ATTRIBUTES WF_ROUTING_RULES WF_ROUTING_RULE_ATTRIBUTES</p> <p>Version 1.0</p> <p>22</p> <p>Transaction Table ListWF_ACTIVITY_ATTR_VALUES WF_ACTIVITY_TRANSITIONS WF_ITEM_ACTIVITY_STATUSES WF_ITEM_ACTIVITY_STATUSES_H WF_ITEMS WF_ITEM_ATTRIBUTE_VALUES WF_NOTIFICATION_ATTRIBUTES</p> <p>Version 1.0</p> <p>23</p> <p>Views used in WorkflowWorkflow uses views for effective querying of data. These views are de-normalized so as to provide a faster access to data over networks. Some of the important views are: WF_ITEMS_V WF_ITEM_ACTIVITY_STATUSES_V WF_NOTIFICATIONS_VIEWS WF_ROLES WF_USERS WF_USER_ROLES</p> <p>Version 1.0</p> <p>24</p> <p>APIs used in WorkflowVarious PL/SQL APIs exist for the working of Oracle Workflow. WF_ENGINE WF_CORE WF_PURGE WF_MONITOR WF_QUEUE WF_NOTIFICATIONS</p> <p>These APIs can be used to create WF processes, send notifications, purge etc. These can essentially be used by the developer while developing any WF components (either customizing or creating new WF item types).</p> <p>Version 1.0</p> <p>25</p> <p>Workflow Transitions</p> <p>Version 1.0</p> <p>26</p> <p>Workflow Transitions Activity-Each activity is a node, a logical step that contributes toward the completion of a process. Transitions-Transitions appear as arrows in your diagram and represent the completion of one activity and the activation of another.</p> <p>Different Types of Transitions:-</p> <p>a. Self-looping Transitions b. Transitions c. Transitions</p> <p>Version 1.0</p> <p>27</p> <p>Self-looping Transitions</p> <p>Activity loops back to itself on Timeout</p> <p>Version 1.0</p> <p>28</p> <p> Transitions</p> <p> The Workflow Engine follows a transition if no other transition matching the completion result exists.</p> <p>Version 1.0</p> <p>29</p> <p> TransitionsAp p ro ve Do c um e nt Ap p ro ve d E nd (Ap p ro ve )</p> <p>S ta rt</p> <p>R e vie w Do c um e nt R e je c t</p> <p>Ye s No</p> <p>Do c um e nt R e je c te d</p> <p>E nd (R e je c t)</p> <p>Lo g R e vie w</p> <p> The Workflow Engine follows an transition regardless of what completion result the activity returns. This allows you to include a generic activity in the process that the Workflow Engine executes in parallel with the resultspecific activity.</p> <p>Version 1.0</p> <p>30</p> <p>Workflow Item Type - Standard</p> <p>Version 1.0</p> <p>Version 1.0</p> <p>31</p> <p>Item Type - Standard The seeded item type Standard includes function and notification activities provided by Oracle Workflow that can be included in your process diagrams. These activities include: And/Or : In a process diagram where multiple branches transition to a single node, use this logic can be to progress further. Compare Date/Number/Text : Use this to compare an item attribute with a constant value or another attribute. Wait : You can wait until a time period after this activity is encountered or until a specific date or until a day of the week/month. Block : The Block activity lets you pause a process until some external program or manual step completes and makes a call to the CompleteActivity Workflow Engine API. Launch Process : This lets you launch another workflow process from the current process. Noop : Use this activity in the workflow process, where you want to place a node without performing an action.</p> <p>Version 1.0</p> <p>32</p> <p>Item Type Standard (Contd.). Loop Counter : Use this to limit the no. of times workflow engine transitions through a particular path. Start/End : These activities mark the start or end of a process and does not perform any action. Vote Yes/No :This activity lets you send a notification to a group of users in a role and tally the Yes/No responses from those users. The results of the tally determine the activity that the process transitions to next. Continue Flow/Wait for Flow : One activity lets you pause a process and the other signals the halted process to continue. To use these activities, you place one activity in the master process and the other in each detail process. Assign : Lets you assign a value to an item attribute.</p> <p>Version 1.0</p> <p>33</p> <p>Workflow Directory Services</p> <p>Version 1.0</p> <p>34</p> <p>Directory ServicesThe directory service for Oracle Workflow is implemented as a set of views that are mapped across the user tables of the underlying application. Create Roles: Adhoc roles can be created using User Management Responsibility or through PL/SQL in database. If you use PL/SQL to create roles make sure you give all user names and role names in UPPER case to avoid some problems Version 1.0</p> <p>Script to Create a Adhoc Role Script to Add user to existing Adhoc Role Script to Remove user from existing Adhoc Role Using Adhoc roles in workflow notifications Adhoc Roles Tables35</p> <p>Script to Create a Adhoc RoleDECLARE lv_role varchar2(100) := 'DEMO_ROLE'; lv_role_desc varchar2(100) := 'DEMO_ROLE'; BEGIN wf_directory.CreateAdHocRole(lv_role, lv_role_desc, NULL, NULL, 'Role Demo for erpschool users', 'MAILHTML', 'NAME1 NAME2', --USER NAME SHOULD BE IN CAPS NULL, NULL, 'ACTIVE', NULL); dbms_output.put_line('Created Role' ||' '||lv_role); End; /</p> <p>Version 1.0</p> <p>36</p> <p>Script to Add user to already existing Adhoc RoleDECLARE v_role_name varchar2(100); v_user_name varchar2(100); BEGIN v_role_name := 'DEMO_ROLE'; v_user_name := 'NAME3'; WF_DIRECTORY.AddUsersToAdHocRole(v_role_name, v_user_name); --USER NAMES SHOULD BE in CAPS END;</p> <p>Version 1.0</p> <p>37</p> <p>Script to Remove user from existing Adhoc RoleDECLARE v_role_name varchar2(100); v_user_name varchar2(100); BEGIN v_role_name := 'ERPSCHOOLS_DEMO_ROLE'; v_user_name := 'NAME3'; WF_DIRECTORY.RemoveUsersFromAdHocRole(v_role_name, v_user_name); --USER NAMES in CAPS END;</p> <p>Version...</p>