Defining Item Types and Attributes

arrow icon   To Create an Item Type:

  1. Open an existing data store or, select New from the File menu to create a new data store to define this new item type. Then define a new item type in the navigator tree by choosing New Item Type from the Edit menu. An Item Type property page appears.

  2. Every item type has an all-uppercase internal name, which is a maximum of eight characters long. All Oracle Workflow APIs, SQL scripts, and PL/SQL procedures refer to the internal name when identifying an item type.

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

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

  3. Enter a translatable Display Name that is longer and more descriptive. You can also supply a description for the item type.

  4. Specify a persistence type of Temporary or Permanent. If you set the persistence type to Temporary, then specify the number of days from the time the item instance completes before its status audit trail can be purged. See: Persistence Type.

  5. If your item type has or will have more than one workflow process associated with it, you may specify a selector function using the syntax <package_name>.<procedure_name>. The selector function is a PL/SQL stored procedure that automatically identifies the specific process definition the Workflow Engine should execute when a workflow is initiated for this item type. You can also extend the selector function to be a general callback function that resets context information each time the Workflow Engine establishes a new database session to execute activities. See: Standard API for an Item Type Selector or Callback Function.

  6. Choose Apply to save your changes.

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

  8. Select the Access tab page to set the access and customization levels for this item type. 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. A secondary branch appears in the navigator tree that represents the item type you just created. You can review or edit the properties of this item type at any time by double-clicking on the item type in the navigator tree or by selecting the item type and choosing Properties from the Edit menu.

  11. Define as many item type attributes as necessary to use as global variables in your process. You use these item type attributes to pass values to and from your function, notification, and event activities. See: To Define an Item Type or Activity Attribute.

arrow icon   To Define an Item Type or Activity Attribute:

  1. To create an item type attribute, select an item type in the navigator tree, then choose New Attribute from the Edit menu.

    To create an activity attribute, select an activity in the navigator tree and choose New Attribute from the Edit menu.

    An Attribute property page appears in both cases.

  2. Provide an Internal Name in all uppercase with no leading/trailing spaces. All Oracle Workflow APIs, SQL scripts, and PL/SQL procedures refer to the internal name when identifying an attribute.

    Important: To update the internal name for an attribute once it is defined, you must use special SQL scripts called wfchita.sql and wfchacta.sql. You should only use these scripts to correct errors in an attribute's internal name during design time. Do not use these scripts to rename attributes that are involved in running instances of processes. See: Wfchita.sql and Wfchacta.sql.

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

  3. Enter a Display Name. This is the name that appears in the navigator tree.

  4. Enter an optional description.

  5. Select the data type of the attribute. Form, URL, and document data types are not relevant if you are defining an activity attribute.

  6. Depending on the data type of your attribute, provide the following default value information:

  7. For item type attributes, the optional default value is a constant that you enter or select from a list of values. The constant, however, may be a text string that allows for token substitution at runtime.

    For activity attributes, the optional default value may be a constant or an item type attribute. If you want the default to acquire its entire value from an item type attribute, choose Item Attribute in the Default Value region, then use the adjacent poplist field to choose the item type attribute. The item type attribute you select must be associated with the same item type that the activity itself is associated with. The item type attribute you select must also be of the same data type as the activity attribute.

    Note: An activity attribute type of 'Text' is compatible with any item attribute type except the event type. All other activity attribute types must match the item attribute type exactly.

    Note: For attributes of type Lookup, the default value, if you specify one, must be a lookup code belonging to that lookup type.

  8. 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.

  9. If you are defining an item type attribute, select the Access tab page to set the access levels allowed to modify this attribute. Activity attributes assume the access/protection level of their parent activity. See: Allowing Access to an Object.

  10. Choose Apply to save your changes.

  11. Any item type attribute you create appears beneath the Attributes branch in the navigator tree. Any function activity attribute you define appears beneath the activity you defined it for in the navigator tree. You can review or edit the properties of an attribute at any time by double-clicking on the attribute in the navigator tree or by selecting the attribute and choosing Properties from the Edit menu.

    Important: The order in which you list these attributes in the navigator tree correlate to the order in which they appear in any list of values that draw upon these attributes. You can use the drag and drop feature of the navigator tree to reorder a set of attributes, or select an attribute and choose Move Attribute Up or Move Attribute Down from the Edit menu.

arrow icon   To Define a URL Attribute:

  1. Specify a Universal Resource Locator (URL) to a network location in the Default Value field of the Attribute property page. The URL can be a constant or a value returned from another item attribute.

    Note: If you define a URL attribute that points to an Oracle Application Framework-based Web page, that page must use the self-secured security mode. A page that relies on the user session in its security mode may not be accessible when a user navigates to the URL from an e-mail notification. For more information about Oracle Application Framework pages, refer to the Oracle Application Framework Developer's Guide, available from My Oracle Support Knowledge Document 1315485.1.

  2. You can include argument strings in your URL that are text strings. Additionally, if you are defining a message attribute of type URL, you can include argument strings that are token substituted with other message attributes. The message attributes used for token substitution can have constant values or can reference the values returned from item type attributes. See: To Define a Message Attribute and To Token Substitute an Attribute.

    To token substitute other message attributes in an argument string, specify the message attributes as follows:

     -&message_attr-
    

    For example, the following string represents a URL with two arguments called arg1 and arg2 that are token substituted with the runtime value of message attributes msgattr1 and msgattr2, respectively:

    http://www.example.com?arg1=-&msgattr1-&arg2=-&msgattr2-

    Note: If you are defining a message attribute of type URL, you can also include a special token in your argument string called -&#NID- which Oracle Workflow substitutes with the notification ID of the runtime notification.

  3. If your URL attribute contains an argument string, you must adhere to the following restrictions:

  4. If you need to pass a date and time as an argument to a URL, you should use TO_CHAR to format the string as YYYY/MM/DD+HH24:MI:SS. Similarly, you need to do the correlating format translation in the function that the URL calls, using TO_DATE. This formatting is required because in multibyte databases, the month portion of the DD-MON-YYYY format could potentially translate to a value that is not acceptable across a URL.

  5. You can also use a URL attribute to include an image in a notification. Define a 'Send' message attribute of type URL that points to an image file with an extension of gif, jpg, png, tif, bmp, or jpeg. Then use a message attribute token to include the URL attribute in the HTML message body.

    You can optionally add a prefix to the URL attribute value to control whether an image URL attribute appears in the message body as a link or as an inline image when the notification is viewed from the Notification Details Web page or as an HTML-formatted e-mail.

    If you define a URL for one of the listed image types without a prefix, then the image appears inline in the message body by default.

    When defining a URL attribute to point to an image, you must provide the complete URL for the image, either as a constant or as a value returned from another item attribute. You cannot token substitute any argument strings within the image URL.

    Additionally, for inclusion in an e-mail notification the image must be in a location to which the notification mailer has access, whether that location is on a Web server or on the local file system.

    Note: Oracle Workflow displays images only in the message body of a notification. If you check Attach Content for a URL attribute that points to an image file, the URL attribute appears as an attached link, just as other URLs do.

    Also, Oracle Workflow displays images only in the HTML-formatted versions of a notification. A plain text e-mail notification displays all URL attributes as the display name of the attribute, followed by a colon and the URL.

  6. If you are defining a URL attribute that links to an Oracle Application Framework page, the page must have the security mode Self secured. This security mode is required to ensure that the page can be accessed properly if the URL link is included in an e-mail notification. The page should also explicitly validate all parameters provided in the URL. For more information, see: Advanced OA Framework Development Topics > Security > Accelerated Validation > Bookmarkable Pages in the Oracle Application Framework Developer's Guide, available from My Oracle Support Knowledge Document 1315485.1.

    By default, when a user chooses an attached URL link to an Oracle Application Framework page in a notification, Oracle E-Business Suite displays a list of responsibilities assigned to that user that include that page. The user can then select the responsibility with which he or she wants to navigate to the page. When navigating from an e-mail notification, the user must also log into Oracle E-Business Suite before selecting a responsibility.

    When you define a URL attribute for an Oracle Application Framework page, you can optionally include Oracle Application Framework URL parameters to specify the responsibility and application context with which you want users to access that page. In this case, users do not need to select a responsibility when they choose the attached URL link; instead, they can navigate directly to the page. However, you must ensure that the users who receive the notification have the specified responsibility assigned to them. Otherwise they will not be able to access the page from that attached URL link.

  7. Choose OK when you are done.

arrow icon   To Define a Form Attribute:

  1. Specify a developer form function name and any optional argument string (form function parameters) in the Default Value field of the form Attribute property page.

  2. The default value must be entered using the following format:

    function_name:arg1=value1 arg2=value2 ...argN=valueN
    

    The value of argN can be a text string enclosed in quotes (" ") or can be token substituted with another item type attribute in any of the following ways, where &item_attr represents the internal name of the item type attribute:

    See: To Token Substitute an Attribute.

    Note: If you are defining a message attribute of type Form, you can also include a special token in your argument string called &#NID which Oracle Workflow substitutes with the notification ID of the runtime notification.

  3. If your form attribute contains an argument string, you must adhere to the following restrictions:

  4. By default, when a user chooses an attached form link in a notification, Oracle E-Business Suite displays a list of responsibilities assigned to that user that include that form. The user can then select the responsibility with which he or she wants to navigate to the form. When navigating from an e-mail notification, the user must also log into Oracle E-Business Suite before selecting a responsibility.

    When you define a form attribute, you can optionally specify the responsibility through which you want users to access that form. In this case, users do not need to select a responsibility when they choose the attached form link; instead, they can navigate directly to the form. However, you must ensure that the users who receive the notification have the specified responsibility assigned to them. Otherwise they will not be able to access the form from that attached form link.

    To specify a responsibility in the form attribute, append two special arguments in the argument string for the form function.

    The value for each of these arguments can be a text string enclosed in quotes (" ") or can be token substituted with another item type attribute using the following format: "&ITEM_ATTR"

    For example, the following form attribute value specifies that the Users form should be opened from the System Administration responsibility.

    FND_FNDSCAUS:#RESP_KEY="SYSTEM_ADMINISTRATION" #APP_SHORT_NAME="SYSADMIN"
    
  5. Choose OK when you are done.

arrow icon   To Define a Document Attribute:

  1. Enter a string that identifies the document in the default value field of the Attribute property page.

    You can identify the following types of document for a document attribute:

    Note: If you define a message attribute of type document, you must assign that attribute a source of Send. You cannot use a document attribute as a respond message attribute.

  2. A PL/SQL document represents data from the database as a character string, generated from a PL/SQL procedure. Specify the default value of a PL/SQL document as

     plsql:<procedure>/<document_identifier> 

    Replace <procedure> with the PL/SQL package and procedure name, separated by a period. Replace <document_identifier> with the PL/SQL argument string that you want to pass directly to the procedure. The argument string should identify the document.

    Note: The PL/SQL procedure must follow a standard API format. See: Standard APIs for "PL/SQL" Documents.

    For example, the following string represents the PL/SQL document po_req:2034, generated by the procedure po_wf.show_req.

    plsql:po_wf.show_req/po_req:2034
    

    Note: The maximum length of the data that a PL/SQL document can contain is 32 kilobytes. If you expect your document to exceed 32 Kb, you should use a PL/SQL CLOB document to hold the data instead.

    A PL/SQL document can be displayed in the subject line of a notification, displayed in the message body of a notification, or included as an attachment to the notification.

  3. A PL/SQL CLOB document represents data from the database as a character large object (CLOB), generated from a PL/SQL procedure. Specify the default value of a PL/SQL CLOB document as

    plsqlclob:<procedure>/<document_identifier>

    Replace <procedure> with the PL/SQL package and procedure name, separated by a period. Replace <document_identifier> with the PL/SQL argument string that you want to pass directly to the procedure. The argument string should identify the document.

    Note: The PL/SQL procedure must follow a standard API format. See: Standard APIs for "PL/SQL" Documents.

    For example, the following string represents the PL/SQL CLOB document, po_req:2036, generated by the procedure po_wf.show_req_clob.

    plsqlclob:po_wf.show_req_clob/po_req:2036
    

    A PL/SQL CLOB document that contains text or HTML can either be displayed in the message body of a notification or included as an attachment to the notification.

    PL/SQL CLOB documents do not support further substitution of message attribute tokens. The text or HTML contents of the CLOB are printed in a message body just as they are generated by the PL/SQL procedure.

    A PL/SQL CLOB document that you include as an attachment to a notification can also contain a PDF or RTF document or other binary data encoded to base64. You should first store the document in the database as a binary large object (BLOB) and then convert the document into a CLOB as part of the PL/SQL procedure you use to produce the CLOB. See: Standard APIs for "PL/SQL" Documents.

    You can use the UTL_RAW.Cast_To_VARCHAR2 function to convert PDF or RTF data from the BLOB into VARCHAR2 data that you write to a CLOB. You can optionally use the WF_MAIL_UTIL.EncodeBLOB procedure to encode the binary data to base64. See: UTL_RAW, Oracle Database PL/SQL Packages and Types Reference and EncodeBLOB.

  4. A PL/SQL BLOB document represents data from the database as a binary large object (BLOB), generated from a PL/SQL procedure. Specify the default value of a PL/SQL BLOB document as

    plsqlblob:<procedure>/<document_identifier>
    

    Replace <procedure> with the PL/SQL package and procedure name, separated by a period. Replace <document_identifier> with the PL/SQL argument string that you want to pass directly to the procedure. The argument string should identify the document.

    Note: The PL/SQL procedure must follow a standard API format. See: Standard APIs for "PL/SQL" Documents.

    For example, the following string represents the PL/SQL BLOB document po_req:2038, generated by the procedure po_wf.show_req_blob.

    plsqlblob:po_wf.show_req_blob/po_req:2038
    

    PL/SQL BLOB documents do not support further substitution of message attribute tokens.

    A PL/SQL BLOB document can contain an image or an application file stored as binary data, such as a PDF or RTF document or other types of files. You can include a PL/SQL BLOB document as an attachment to a notfication. However, this type of document cannot be displayed in the message body of a notification.

  5. If you wish to generate the document identifier for a PL/SQL, PL/SQL CLOB, or PL/SQL BLOB document dynamically, you can token substitute the document identifier with other item type attributes. The item attribute names must be in uppercase and must be separated by a colon. See: To Token Substitute an Attribute.

    For example:

    plsql:po_wf.show_req/&ITEM_ATTR1:&ITEM_ATTR2
    

    Note: If you are defining a message attribute of type Document, you can also include a special token in your argument string called &#NID which Oracle Workflow substitutes with the notification ID of the runtime notification.

  6. You can also use an attribute of type document to reference an Oracle Application Framework region that you want to embed in a notification message. Specify the JSP call to reference the region as the default value for the attribute. See: Embedding Oracle Application Framework Regions in Messages.

    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.

  7. Choose OK when you are done.

arrow icon   To Copy an Item Type:

  1. Select the item type to copy in the navigator tree.

  2. Drag the item type, holding down your select mouse button, to the data store or workspace you want to copy it to.

    You can also use the Copy and Paste commands in the Edit menu.

  3. If you copy this item type back to the same data store, you get prompted to enter a new internal and display name for the item type in the Item Type property page. This is because every item type must have a unique internal and display name. When you are done, choose OK.

    Note that when you copy an item type, you also copy all the components associated with the item type. Since most components must also have unique internal and display names, you may get prompted to update those components' internal and display names in their property pages as well.

  4. If you copy an item type to a data store where a previous version of the same item type already exists, you update the existing version of the item type in that target data store with the changes in the version of the item type you are copying.

    Important: The order in which you drag two or more item types to a new store is important. For example, suppose an item type references objects in the Standard item type. If you plan to copy that item type and the Standard item type to a new data store, you should first drag the Standard item type to the new data store before dragging the other item type over; otherwise the other item type will have unresolved references to the Standard item type.

arrow icon   To Copy an Attribute:

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

  2. Drag the attribute, holding down your select mouse button, to the component branch you want to copy it to.

  3. If you copy an attribute to a component associated with the same item type, the property page for the attribute appears.

    Enter a new unique internal name and display name for the attribute.

    When you are done, choose OK.

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

Related Topics