An item type is a classification of the components that make up a workflow process. You must associate any component that you create for a process, such as a function activity or a message, with a particular item type. Often it makes sense to define an item type so that it describes the item being managed by your workflow process. For example, purchase order requisition can be an item type while a purchase order requisition identified by a particular ID number is an item of that item type. See: To Create an Item Type.
An item type attribute is a property associated with a given item type. It acts as a global variable that can be referenced or updated by any activity within a process. An item type attribute often provides information about an item that is necessary for the workflow process to complete. For example, the "Workflow Demonstration" item type has an item type attribute called "Requisition Amount." An activity in our example Requisition Approval process requires the value of this item type attribute to determine if a selected approver has the authority to approve a requisition of that amount.
Applications as well as function activities can reference and set item type attributes using the Oracle Workflow Engine APIs. You can define and maintain as many item type attributes as necessary for an item type. You should define as an item type attribute, any information that will be required by an activity in your process, or any information that will need to be sent in a notification message. See: To Define a Message Attribute and Item Attributes.
By default, when a work item is initiated, Oracle Workflow creates a runtime copy of each item attribute that is defined for that item type. You can optionally enhance performance for a process by specifying that the Workflow Engine should create runtime copies of item attributes only on demand. See: #ONDEMANDATTR Attribute.
There are ten attribute types, as shown below. The type determines what values are acceptable and how the attribute is used.
Text - The attribute value is a string of text.
Note: Due to security considerations, Oracle Workflow does not permit HTML content to be passed in attributes of type text. If Oracle Workflow encounters HTML tags in a text attribute, escape characters will be applied to display the content as plain text rather than executing the HTML. If you want to apply HTML formatting to your content, define an attribute of type document instead, and pass your HTML content as either a PL/SQL document or PL/SQL CLOB document.
Number - The attribute value is a number with the optional format mask you specify.
Date - The attribute value is a date with the optional format mask you specify.
Lookup - The attribute value is one of the lookup code values in a specified lookup type.
Form - The attribute value is an Oracle E-Business Suite internal form function name and its optional form function parameters.
If you include a form-type attribute in a notification message as a message attribute, the notification, when viewed from the Notification Details Web page, displays an attached form icon that lets users drill down to the referenced form. See: Overview of Menus and Function Security, Oracle E-Business Suite Developer's Guide.
URL - The attribute value is a Universal Resource Locator (URL) to a network location. If you reference a URL attribute in a notification message as a message attribute, the notification, when viewed from the Notification Details Web page or as an HTML-formatted e-mail, displays a link to the URL specified by the URL attribute. The user can complete an activity or see additional information related to the activity by accessing that URL. You can also use a URL attribute to display an inline image in a notification message, when the notification is viewed from the Notification Details Web page or as an HTML-formatted e-mail.
Document - The attribute value is an attached document. You can specify the following types of documents in the default value field:
PL/SQL document - A document representing data from the database as a character string, generated from a PL/SQL procedure.
PL/SQL CLOB document - A document representing data from the database as a character large object (CLOB), generated from a PL/SQL procedure. The CLOB can contain plain text, HTML, an Adobe Acrobat Portable Document Format (PDF) document, a Microsoft Rich Text Format (RTF) document, or binary data encoded to base64.
PL/SQL BLOB document - A document representing data from the database as a binary large object (BLOB), generated from a PL/SQL procedure. The BLOB can contain an image or other types of application files that are stored as binary data.
Oracle Application Framework region - A JSP call to an Oracle Application Framework region for inclusion in a notification message
Role - The attribute value is the internal name of a role. If a message attribute of type role is included in a notification message, the attribute automatically resolves to the role's display name, eliminating the need for you to maintain separate attributes for the role's internal and display names. Also when you view the notification from a Web browser, the role display name is a hypertext link to the e-mail address for that role. To set a default value for the attribute, you must initially load roles from the database. See: Roles.
Attribute - The attribute value is the internal name of another existing item type attribute that you want to maintain references to in a process.
Event - The attribute value is a Business Event System event message in the standard WF_EVENT_T structure. See: Event Message Structure.
Note: If you store an event message in an item attribute of type event, you can access the event data within that event message by creating an item attribute of type URL and setting the value of the URL attribute to reference the event data. See: SetItemAttribute.
When you define an item type, you must also specify its persistence type. The persistence type controls how long a status audit trail is maintained for each instance of the item type. If you set Persistence to Permanent, the runtime status information is maintained indefinitely until you specifically purge the information by calling the procedure WF_PURGE.TotalPerm().
If you set an item type's Persistence to Temporary, you must also specify the number of days of persistence ('n'). The status audit trail for each instance of a Temporary item type is maintained for at least 'n' days of persistence after its completion date. After the 'n' days of persistence, you can then use any of the WF_PURGE APIs to purge the item type's runtime status information. See: WF_PURGE.
If you set an item type's Persistence to Synchronous, Oracle Workflow expects instances of that item type to be run as forced synchronous processes with an item key of #SYNCH. Forced synchronous processes complete in a single SQL session from start to finish and never insert into or update any database tables. Since no runtime status information is maintained, you do not normally need to perform any purging for a process with the Synchronous persistence type. However, if you run the process with a unique item key in asynchronous mode for testing or debugging purposes, Oracle Workflow does maintain runtime status information for that process instance. You can purge this information by changing the item type's Persistence to Temporary and running any of the WF_PURGE APIs. Then change the item type's Persistence back to Synchronous. See: Synchronous, Asynchronous, and Forced Synchronous Processes, WF_PURGE, and Purging for Performance.
Note: You can also use the Purge Obsolete Workflow Runtime Data concurrent program to purge obsolete item type runtime status information. The executable name for this concurrent program is "Oracle Workflow Purge Obsolete Data" and its short name is FNDWFPR. See: Purge Obsolete Workflow Runtime Data.
If your item type has or will have more than one runnable process activity associated with it, define a PL/SQL function that determines which process activity to run in a particular situation. For example, you may have two different requisition approval process activities associated with the same item type. The process that Oracle Workflow executes may vary depending on how and where the requisition originates. Your selector function would determine which process would be appropriate in any given situation.
You can also extend the Selector function to be a general callback function so that item type context information can be reset as needed if the SQL session is interrupted during the execution of a process, such as during background processing. See: Standard API for an Item Type Selector or Callback Function.
Documents have an enormous impact in the operations of an organization. With the explosion of digital media and the worldwide Web, electronic documents of a wide variety of formats, including non-printed media, are forcing organizations to address the management of these documents. The value of information in these documents can be maintained only if the documents can be managed and shared.
In a workflow process, you can attach documents generated by a PL/SQL procedure, which we call PL/SQL, PL/SQL CLOB, or PL/SQL BLOB documents. You attach a document to a workflow process by referencing the document in a predefined item attribute or message attribute of type Document. See: Attribute Types, To Define an Item Type or Activity Attribute, and To Define a Message Attribute.
For PL/SQL, PL/SQL CLOB, or PL/SQL BLOB documents, the item or message attribute's value would be the name of the PL/SQL package and procedure used to generate the document. The PL/SQL procedure must follow an Oracle Workflow standard interface. See: Standard APIs for "PL/SQL" Documents.
For PL/SQL and PL/SQL CLOB documents that contain text or HTML, the document generated by the PL/SQL procedure can either be displayed within the text of a notification or included as an attachment. Other types of content in PL/SQL CLOB documents, as well as all PL/SQL BLOB documents, can only be included as attachments.
In addition to text or HTML, PL/SQL CLOB documents that are included as attachments can contain PDF or RTF documents or binary data encoded to base64.
PL/SQL BLOB documents that are included as attachments can contain images or other application files that are stored as binary data.
PL/SQL documents can also be displayed in the subject line of a notification.
Oracle Workflow also supports using attributes of type document to embed an Oracle Application Framework region in a notification. See: Embedding Oracle Application Framework Regions in Messages.
Note: An Oracle Application Framework region can only be displayed within the message body of a notification. It cannot be included as an attachment to the notification.