Defining Activities

arrow icon   To Create a Notification Activity:

  1. Select the item type that you want to create a notification for in the navigator tree, then choose New Notification from the Edit menu. Define your notification activity in the Activity property page that appears.

    You can also select a message in the navigator tree and drag and drop the message into the Notifications branch of the same item type to create a notification activity that sends that message.

  2. A notification activity must have an Internal Name (all uppercase and no leading/trailing spaces) and a Display Name, which is the translatable name that appears in your process diagram. Use the description to provide an explanation about this activity.

    Important: To update the internal name for an activity once it is defined, you must use a special SQL script called wfchact.sql. You should only use this script to correct errors in an activity's internal name during design time. Do not use this script to rename activities that are involved in running instances of processes. See: Wfchact.sql.

    Caution: Do not include colons ":" or leading/trailing spaces in your internal name.

  3. Indicate the result type (a predefined Lookup Type) for this activity. Result types list the possible results returned by this activity. Your workflow diagram may branch depending on the value returned by your completed activity. See: To Create Lookup Types.

    You can choose <None> as the result type if your activity does not return a value, or if your workflow process does not depend on the value returned.

  4. Select the name of the message you want this notification to send. See: To Create a Message.

  5. 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. See: Notification Activity.

  6. You can optionally specify a PL/SQL stored procedure in the Function field. The procedure is known as a post-notification function and lets you couple processing logic to the notification activity. See: Standard API for PL/SQL Procedures Called by Function Activities and Post-Notification Functions.

    If you check Expand Roles, and you assign a message that has a special Result to this notification activity, then use the Function field to specify the name of a custom PL/SQL stored procedure that tallies the responses you get back from each of the recipients of this notification. Specify the procedure using the format: <package_name>.<procedure_name>. See: Voting Activity.

  7. Choose an icon that identifies your activity. You can use any icon, as long as the icon is stored in a .ico file, to symbolize the action of an activity. See: Adding Custom Icons to Oracle Workflow.

    Choose Browse to view the icon files listed in the workflow icons subdirectory.

    You can also drag and drop icon files from the Windows Explorer onto an activity in your navigator tree to assign that icon to the activity.

  8. Choose Apply to save your changes.

  9. Select the Details tab to display and modify optional Details of the activity. See: To Define Optional Activity Details.

  10. Select the Roles tab page to specify the roles that have access to this notification activity. (This functionality will be supported in a future release.)

  11. Select the Access tab page to set the access levels allowed to modify this notification. See: Allowing Access to an Object.

  12. Choose OK to save your changes and close the property pages.

  13. The notification activity now appears beneath Notifications in the navigator tree. You can review or edit the properties of this activity at any time by double-clicking on the activity in the navigator tree or by selecting the activity and choosing Properties from the Edit menu or by pressing Enter on your keyboard.

arrow icon   To Create a Function Activity:

  1. Select the item type that you want to create a function for in the navigator tree, then choose New Function from the Edit menu. Define your function activity in the Activity property page that appears.

  2. A function activity must have an Internal Name (all uppercase and no leading/trailing spaces) and a Display Name, which is the translatable name that appears in your process diagram. Use the description to provide an explanation about this activity.

    Important: To update the internal name for an activity once it is defined, you must use a special SQL script called wfchact.sql. You should only use this script to correct errors in an activity's internal name during design time. Do not use this script to rename activities that are involved in running instances of processes. See: Wfchact.sql.

    Caution: Do not include colons ":" or leading/trailing spaces in your internal name.

  3. Enter the name of the function you want this activity to execute. In the Type field, specify whether the function is a PL/SQL function, an External function, or an External Java function.

    Note: The External Java function type is not currently used.

  4. Indicate the result type (a predefined Lookup Type) for this activity. Result types list the possible results returned by this activity. Your workflow diagram may branch depending on the value returned by your completed activity. See: To Create Lookup Types.

    You can choose <None> as the result type if your activity does not return a value, or if your workflow process does not depend on the value returned.

  5. Specify the cost of this function activity. See: Activity Cost.

  6. Choose an icon that identifies your activity. You can use any icon, as long as the icon is stored in a .ico file, to symbolize the action of an activity. See: Adding Custom Icons to Oracle Workflow.

    Choose Browse to view the icon files listed in the workflow icons subdirectory.

    You can also drag and drop icon files from the Windows Explorer onto an activity in your navigator tree to assign that icon to the activity.

  7. Choose Apply to save your changes.

  8. Select the Details tab to display and modify the optional details of the activity. See: To Define Optional Activity Details.

  9. Select the Roles tab page to specify the roles that have access to this function activity. (This functionality will be supported in a future release.)

  10. Select the Access tab page to set the access levels allowed to modify this function. See: Allowing Access to an Object.

  11. The function activity now appears beneath Functions in the navigator tree. You can review or edit the properties of this activity at any time by double-clicking on the activity in the navigator tree or by selecting the activity and choosing Properties from the Edit menu or by pressing Enter on your keyboard.

  12. If your function requires input arguments, you can expose those arguments in Oracle Workflow Builder as attributes of the function activity. Function activity attributes behave as parameters whose values you can modify for each usage of the activity in a process. Function activity attributes are specific to a function activity and are not global to a process. See: To Define an Item Type or Activity Attribute.

    To create a function activity attribute that references an item type attribute, select the referenced item type attribute in the navigator tree, and hold down your mouse select button as you drag the item type attribute to your function activity. The Default Value region is automatically set to Item Attribute and references the originating item attribute.

    When you include a function activity as a node in a process, you can assign a value to the function activity attribute that is specific to that node. See: To Define Activity Attribute Values.

arrow icon   To Create an Event Activity:

  1. Select the item type that you want to create an event for in the navigator tree, then choose New Event from the Edit menu. Define your event activity in the Activity property page that appears.

  2. An event activity must have an Internal Name (all uppercase and no leading/trailing spaces) and a Display Name, which is the translatable name that appears in your process diagram. Use the description to provide an explanation about this activity.

    Important: To update the internal name for an activity once it is defined, you must use a special SQL script called wfchact.sql. You should only use this script to correct errors in an activity's internal name during design time. Do not use this script to rename activities that are involved in running instances of processes. See: Wfchact.sql.

    Caution: Do not include colons ":" or leading/trailing spaces in your internal name.

  3. Choose an icon that identifies your activity. You can use any icon, as long as the icon is stored in a .ico file, to symbolize the action of an activity. See: Adding Custom Icons to Oracle Workflow.

    Choose Browse to view the icon files listed in the workflow icons subdirectory.

    You can also drag and drop icon files from the Windows Explorer onto an activity in your navigator tree to assign that icon to the activity.

  4. Select the Event Action for the activity.

    Note: Depending on the event action you select, you may need to define item type attributes for some or all of the following event details:

    • Event Name

    • Event Key

    • Event Message

    • Event Data

    • Out Agent

    • To Agent

    When you include the event activity as a node in a process, you can use the item type attributes to specify where to store or retrieve the required event detail information for that node. The item type attributes that you use for event details must be associated with the same item type as the event activity itself. See: To Define an Item Type or Activity Attribute and To Define Event Details for an Event Node.

  5. If you are defining a Receive event activity, you can optionally enter an Event Filter to specify the event that the activity can receive.

    See: Defining Events.

  6. Enter an optional cost for the activity. For event activities with the event actions Raise or Send, you can use the cost to defer long running activities to a background engine. See: Activity Cost.

  7. Choose Apply to save your changes.

  8. Select the Details tab to display and modify the optional details of the activity. See: To Define Optional Activity Details.

  9. Select the Roles tab page to specify the roles that have access to this function activity. (This functionality will be supported in a future release.)

  10. Select the Access tab page to set the access levels allowed to modify this event. See: Allowing Access to an Object.

  11. The event activity now appears beneath Events in the navigator tree. You can review or edit the properties of this activity at any time by double-clicking on the activity in the navigator tree or by selecting the activity and choosing Properties from the Edit menu or by pressing Enter on your keyboard.

  12. For a raise event activity, if the event raised by the activity requires additional parameters to be included in the event message, you can define those parameters as attributes of the raise event activity. When the event is raised, the activity attributes are set as parameters in the parameter list for the event message. If the event message is later received by another process, the Workflow Engine sets the event parameters as item type attributes for that process. You can modify the values of the attributes for each usage of the raise event activity in a process. Event activity attributes are specific to an event activity and are not global to a process. See: To Define an Item Type or Activity Attribute.

    Note: A Raise event activity also automatically sets the item type and item key for the current workflow process in the parameter list for the event message. If the event message is later received by another process, the Workflow Engine uses that item type and item key to automatically set the process that raised the event as the parent for the process that receives the event. See: SetItemParent.

    If you want to raise the new event using the event data and parameter list from an existing event message, you can also define a special activity attribute named #EVENTMESSAGE2 for the raise event activity. Set the existing event message as the value of the #EVENTMESSAGE2 attribute, which must be an attribute of type event. If this attribute is defined, the activity retrieves the event data and parameter list from the specified event and sets them into the new event message before it is raised.

    Note: If you also specified event data in the node's event details, however, the activity sets that event data into the event, overriding any event data from the #EVENTMESSAGE2 attribute. If you specified any additional parameters in activity attributes for the raise event activity, the activity also sets those parameters into the parameter list for the event message, overriding the values of any parameters with the same names from the #EVENTMESSAGE2 attribute.

    To create an event activity attribute that references an item type attribute, select the referenced item type attribute in the navigator tree, and hold down your mouse select button as you drag the item type attribute to your event activity. The Default Value region is automatically set to Item Attribute and references the originating item attribute.

    When you include an event activity as a node in a process, you can assign a value to the event activity attribute that is specific to that node. See: To Define Activity Attribute Values.

  13. For a receive event activity, if you want to match the event with one or more workflow processes based on a business key rather than sending the event to one particular workflow process, define a special activity attribute named #BUSINESS_KEY. This attribute must be of type text. Set the default value of the activity attribute to an item type attribute, and include logic in your workflow process to set that item type attribute to an appropriate business key value at runtime. For the workflow process to receive an event, this business key must match the event key. See: To Define an Item Type or Activity Attribute and Event Subscriptions.

arrow icon   To Create a Process Activity:

Before you can draw a workflow process diagram, you must first create a process activity in the navigator tree to represent the process diagram.

  1. Select the item type that you want to create a process activity for in the navigator tree, then choose New Process from the Edit menu. Define your process activity in the Activity property page that appears.

    If a process activity is closed and you want to redisplay it, select the process activity in the navigator tree and press Enter or select Properties from the mouse menu button.

  2. A process activity must have an Internal Name (all uppercase and no leading/trailing spaces) and a Display Name, which is the translatable name that appears in your process diagram. Use the description to provide an explanation about this activity.

    Important: To update the internal name of an activity once it is defined, you must use a special SQL script called wfchact.sql. You should only use this script to correct errors in an activity's internal name during design time. Do not use this script to rename activities that are involved in running instances of processes. See: Wfchact.sql.

    Caution: Do not include colons ":" or leading/trailing spaces in your internal name.

  3. Indicate the result type (a predefined Lookup Type) for this activity. Result types list the possible results returned by this process. See: To Create Lookup Types.

    You can choose <None> as the result type if you do not need to record any specific result for the completion of your process.

  4. Choose an icon that identifies your activity. You can use any icon, as long as the icon is stored in a .ico file, to symbolize the action of an activity. See: Adding Custom Icons to Oracle Workflow.

    Choose Browse to view the icon files listed in the workflow icons subdirectory.

    You can also drag and drop icon files from the Windows Explorer onto an activity in your navigator tree to assign that icon to the activity.

  5. Check Runnable so that the process that this activity represents can be initiated as a top-level process and run independently. If your process activity represents a subprocess that should only be executed if it is called from a higher level process, then uncheck Runnable. See: CreateProcess.

    Caution: Oracle Workflow does not support reusing a subprocess activity multiple times within a process hierarchy. If you wish to use a subprocess more than once in a process, you must create a distinct copy of the subprocess for each instance needed.

  6. Choose Apply to save your changes.

  7. Select the Details tab to display and modify the optional details of the activity. See: To Define Optional Activity Details.

  8. Select the Access tab page to set the access levels allowed to modify this process. The access you set for a process activity determines who has access to edit its process diagram. See: Allowing Access to an Object.

  9. Choose Apply to save your changes, OK to save your changes and close the property page, or Cancel to cancel your changes and close the property page.

  10. The process activity now appears beneath Processes in the navigator tree. You can review or edit the properties of this activity at any time by selecting the activity and choosing Properties from the Edit menu or by pressing Enter on your keyboard.

  11. For a runnable process activity, you can define a special process activity attribute named #ONDEMANDATTR to enhance performance by having the Workflow Engine create runtime copies of item attributes only on demand. See: #ONDEMANDATTR Attribute and To Define an Item Type or Activity Attribute.

arrow icon   To Define Optional Activity Details:

  1. Select the Details tab in the activity's property pages.

  2. If you are creating a process activity, you can specify an error process to execute in the event that an error occurs in the current process. Enter the internal name of the item type that owns the error process and then specify the internal name of the error process activity to execute. Note that the error process item type does not need to be open in your current Oracle Workflow Builder session for you to define it here. See: Error Handling for Workflow Processes.

    Note: Both the error item type and the error process must be specified for an error process to be launched when an error occurs. The error item type defaults to WFERROR, the internal name for the System: Error item type. If you want to launch one of the predefined error processes provided in this item type, you must enter the internal name of that process. You can also enter a custom error item type and process.

    If you assign one of the predefined error processes to your activity, you can customize the behavior of the error process by defining two special item type attributes within your own item type. A WF_ADMINISTRATOR attribute lets you specify the role to which Oracle Workflow sends an error notification, and an ERROR_TIMEOUT attribute lets you specify whether the error notification times out. See: Customizing Error Notifications for an Item Type.

  3. The effective date tells you when this version of the activity is available for the Workflow Engine to execute. If the Effective Date field is blank, the activity is effective immediately.

    You set the effective date when you save your changes using the Save As option in the File menu. All your activity modifications share the same effective date when you save.

  4. Select a value for On Revisit to determine how the Workflow Engine handles this activity when it is transitioned to more than once. If this activity is the first activity that is revisited, as in a loop, you should set On Revisit to specify how you want the Workflow Engine to process the loop. The first activity in a loop is also called the pivot activity. For all other activities in a loop, the value of On Revisit is irrelevant.

  5. The version number identifies which revision of the activity you are examining. The engine ensures that it uses the most recent updates to an activity by using the latest effective version number of that activity.

  6. Choose Apply to save your changes.

arrow icon   To Copy an Activity:

  1. Select the activity to copy in the navigator tree.

  2. Hold down your mouse select button as you drag the activity to the item type branch you want to copy it to.

  3. If you copy the activity within the same item type, a property page will appear prompting you for a new unique internal and display name for the copied activity.

    Note: You can also use the Copy and Paste options in the Edit menu.

  4. When you are done, choose OK.

    Note: Copying a function, event, or notification activity also copies any attributes or message associated with it, respectively.

Related Topics