Adding New Data Types: Procedure

This example describes how to create a new data type called Table Values. The Table Values data type organizes many workflow attributes into logical groups and displays them on a series of custom tabs. The Project tab contains workflow attributes that define the name, code, due date, and priority of a project. The Customer tab contains workflow attributes that define the name and contact information of a customer that is related to the project. The Project and Customer tabs are contained within the Table Values tab, which is created for the Table Values data type and contained in the work packages of workflows to which the Table Values data type has been added.

The organization that the Table Values data type provides makes it easy for workflow participants to locate and use the workflow attributes that they must modify throughout the execution of a workflow.

To use the Table Values data type, the creator of a workflow map must first attach the Table Values data type to the workflow map definition, and then define whether each workflow attribute is editable, required, or read-only for each task in the workflow map. The Table Values data type is added to a workflow map definition by selecting the Table Values check box on the workflow map's General Properties page. The workflow attributes are then defined on the Table Values tab on the Step Definition page for each task in the workflow map.

The Table Values Data Type Tab in the Workflow Designer

When a workflow map that contains the Table Values data type is initiated in Content Server, the Table Values tab (containing the Project and Customer tabs) is added to the work package and routed to each workflow participant when their steps become ready. As workflow participants work on steps, they specify values for the workflow attribute fields on the Project and Customer pages. The information that each workflow participant provides is saved and updated as the work package is routed from one participant to another. Each workflow participant can view the information provided by the workflow participant who completed the preceding task.

Creating the Database Tables

The values that workflow participants provide for the workflow attribute fields that are listed on the Project and Customer pages are stored in database tables that reside outside of the Content Server database. Before you create the Table Values data type, you must create these external tables.

To create the Cust_Project and Cust_Customers database tables:
  1. Orphan DBWizAPI:DBWizAPIRoot:ExecPkg in your custom module's OSpace, and name it modulenameExecPkg.

  2. Orphan DBWizAPI:DBWizAPIRoot:ModuleDBObject in your custom module's OSpace, and name it ModuleDBObject.

  3. Create a child of your custom module's root object, and name it modulenameDBScripts.

  4. Create a child of the DBScripts object, and name it MSSQL or Oracle, depending on which RDMBS your organization uses for Content Server.

    The names of these child objects are case-sensitive-- type them exactly as they appear in step 4.

  5. In the DBScripts object, create a Dynamic feature, and name it MSSQL or Oracle, depending on the choice in step 4.

  6. In the DBScripts object, set the value of the feature you created in step 5 to the object reference number of the object that you created in step 4.

  7. In the ModuleDBObject, do the following:

  8. In the modulename  Globals object, run the BuildOSpace() script.

  9. In the modulenameDBScripts object, create a script and name it cust_sql.

    This script is used to create the tables when you install your custom module.

  10. In the modulenameDBScripts object, create a script and name it cust_drop.

    This script is used to delete the tables from the database when you uninstall your custom module.

  11. In the Configure object, set the value of the fHasDBSchema feature to TRUE.

  12. Uninstall and reinstall the custom module.

Creating a Utility Script

The Table Values data type requires a utility script that you must create before you can implement the new data type. This script can be created at any point throughout the implementation of the data type.

To create the utility script:
  1. Create a child object of the modulename  Root object, and name it modulenamePkg.
  2. Right click the modulenamePkg object, and click Add To Globals.
  3. In the modulenamePkg object, create a script named SetSubPaneIndexArg.
  4. In the modulename  Globals object, run the BuildOSpace() script.
Defining the Data Type's API Object

You begin adding the Table Values data type to Content Server by defining the data type's API object.

To define the data type's API object:
  1. Orphan WFMain:WFRoot:WFObjectTypes:WFDataTypes in your custom module's OSpace, and name it WFDataTypes.

  2. Create a child of the WFDataTypes object, and name it TableValues.

  3. In the TableValues object, change the fSubType feature to an Integer/Real type, and set its value to 1.

    The fSubType feature stores a unique integer that works with the fType feature to identify the API object.

  4. Change the fType feature to an Integer/Real type, and set its value to 11.

    The fType feature stores a unique integer that works with the fSubType feature to identify the object.

  5. Ensure that the fDataName feature is a String type, and set its value to Table Values.

    The fDataName feature stores the text that appears on the custom data type tab in the Content Server interface.

  6. Override the following scripts:

  7. Create a script, and name it LoadTableValues.

  8. Create a script, and name it SaveTableValues.

  9. Create a script, and name it UpdateSubWorkData.

  10. Create a script, and name it UpdateTableValues.

You have created a data type's API object. Now you must provide the code required to customize the API object for the Table Values data type.

Defining the Data Type's Workflow Designer Information

After you define the API object for the data type that you are creating, you must provide the Workflow Designer with the information it requires to add the data type to a workflow map.

To define the data type's Workflow Designer information:
  1. Orphan WebWFP:WebWFPRoot:WFPackage in your custom module's OSpace, and name it WFPTableValues.

  2. In the WFPTableValues object, change the fSubType feature to an Integer/Real type and set its value to 1.

    The fSubType feature stores a unique integer that works with the fType feature to identify this object.

  3. Change the fType feature to an Integer/Real type and set its value to 11.

    The fType feature stores a unique integer that works with the fSubType feature to identify this object.

  4. Override the following scripts:

  5. Create an HTML file in your modulename/html directory, and name it t_tablevalues.html.

You have created the object necessary to define a data type's Workflow Designer information. Now you must provide the code required to customize the object for the Table Values data type.

Defining the Data Type's Web Object

After you define the API object and the Workflow Designer information for the data type that you are creating, you must define the data type's Web object.

To define the data type's Web object:
  1. Orphan WebWork:WebWorkRoot:WFPackage in your custom module's OSpace, and name it WorkTableValues.

  2. In the WorkTableValues object, change the fSubType feature to an Integer/Real type, and set it to 1. The fSubType feature stores a unique integer that works with the fType feature to identify this object.

  3. Change the fType feature to an Integer/Real type, and set its value to 11. The fType feature stores a unique integer that works with the fSubType feature to identify this object.

  4. In the modulename  Globals object, run the BuildOSpace() script.

  5. Override the following scripts:

  6. Create an HTML file in your modulename/html directory, and name it submap_tablevalues.html.

  7. Create an HTML file in your modulename/html directory, and name it tablevalues.html.

  8. Create an HTML file in your modulename/html directory, and name it projectpane.html.

  9. Create an HTML file in your modulename/html directory, and name it customerpane.html.

You have created the object that is used to control a data type when it is manipulated in a workflow by workflow participants. Now you must provide the code required to customize the object for the Table Values data type.