Adding New Step Types: Procedures

The following example describes how to add a new type of step to Content Server. When the creator of a workflow adds this type of step to their workflow, they can do the following:

The Step Definition page for this step looks just like the User Step Definition page, but contains two new fields: the Script to run field and the Template to use field. The creator of a workflow map can choose a callback script to run for the step from the Script to run field. This callback script can perform any custom operation and can run when the step becomes ready or when the step is complete. The creator of a workflow map can also choose an HTML template file to display for the step from the Template to use field. The HTML template defines the interface that is displayed when a workflow participant works on that particular step in Content Server. The creator of a workflow map can create many different tasks of this type, and can choose different callback scripts and HTML templates for each, so that each step looks and behaves differently. This lets the creators of workflow maps customize the workflow interface and operations - without actually changing any code using the Content Server IDE.

The HTML templates and callback scripts used for this step type are stored in two new folders in your custom module directory structure: the templates folder and the scripts folder. The HTML templates that you store in the templates folder can be selected from the Template to use field on a Step Definition page for this type of step. The callback scripts that you store in the scripts folder can be selected from the Script to run field on a Step Definition page for this type of step.

The CustomDisplayAPI Object

You begin adding the custom display step type to Content Server by defining the API object.

To define the API object for this step:

  1. Orphan WFMain:WFRoot:WFObjectTypes:WFTaskTypes:StandardTasks in your custom module's OSpace, and name it CustomDisplayAPI.

  2. In the CustomDisplayAPI 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 object.

  3. Ensure that the fType feature is 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.

  4. Ensure that the fTaskName feature is a String type, and set its value to Custom Display Step. The fTaskName feature stores the name of the step type as it is displayed in the Workflow Designer.

  5. Create a script, and name it CreateReviewMapRec().

  6. Override the following scripts:

You have created the API object. Now you must customize it for the custom display step type.

The CustomDisplayPaint Object

After you define the API object for the step type that you are creating, you must provide the Workflow Designer with the information it requires to display the step and handle the data that the performer of the step provides.

To define the Workflow Designer information:

  1. Orphan WebWFP:WebWFPRoot:WFTask in your custom module's OSpace, and name it CustomDisplayPaint.

  2. In the CustomDisplayPaint 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 the object. It must match the value specified for the fSubType feature in the CustomDisplayAPI object.

  3. Change the fType feature to an Integer/Real type, and set it to 11. The fType feature stores a unique integer that works with the fSubType feature to identify the object. It must match the value specified for the fType feature in the CustomDisplayAPI object.

  4. Override the following scripts:

  5. Create an HTML file, name it t_user.html, and store it in your module's html directory (for example, c:/opentext/module/modulename_1_0_0/html).

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

The CustomDisplayWork object

After you define the API object and Workflow Designer information for the custom display step type, you must define the information that handles the step when a workflow participant is working on it and when it is displayed on the Detailed Status page in Content Server.

To define the information that handles the step and displays it on the Detailed Status page:

  1. Orphan WebWork:WebWork Root:WFTask in your custom module's OSpace, and name it CustomDisplayWork.

  2. In the CustomDisplayWork object, set the fPaletteTask feature to TRUE.

  3. 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 the object. It must match the value specified for the fSubType feature in the CustomDisplayAPI object and the CustomDisplayPaint object.

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

    The fType feature stores a unique integer that works with the fSubType feature to identify the object. It must match the value specified for the fType feature in the CustomDisplayAPI object and the CustomDisplayPaint object.

  5. Change the fSmallTaskGif feature to a String type, and set it to custtask.gif.

    The custtask.gif file identifies the image that you want to display for the custom display step in the Step Palette and must be 16x16 pixels.

  6. Copy the custtask.gif file to the /webwork directory of your Content Server installation (for example, c:/opentext/module/webwork/support).

  7. Create a 16x16 pixel version of the custtask.gif file, name it 16user.gif, and copy the 16user.gif file to the support directory in your custom module. This 16user.gif file identifies the image that is displayed on the Custom Display Step Definition page.

  8. Override the following scripts:

  9. Create a script, and name it PutReviewData.

  10. Create a script, and name it ReassignStep.

  11. Create an HTML file, name it redirect.html, and store it in your module's html directory (for example, c:/opentext/module/modulename_1_0_0/html).

You have created the object necessary to handle the step operations. Now you must provide the code required to customize the information for the custom display step type.

The WFCustomScriptPkg Object

After you customize the objects necessary to create the custom display step type, you must orphan the WFCustomScriptPkg object, which is responsible for executing the callback scripts that can be used with this step type.

To orphan the WFCustomScriptPkg Object:

  1. Orphan WFMain:WFRoot:WFCustomScriptPkg in your custom module's OSpace, and name it WFCustomScriptPkg.

  2. In the WFCustomScriptPkg object, modify the CBExecute() script.

  3. In your custom module, create a child object of the Root object, and name it UtilityPkg.

  4. In the UtilityPkg object, create a script, and name it ExecuteCustTaskScript.

  5. Create a Script feature, and name it ExecuteScript.

  6. Create a Script feature, and name it ListScripts.

  7. Create a Script feature, and name it ListTemplates.

  8. In the Globals object, create a Dynamic feature, name it custtaskmodule, and set its value to the object reference number of the modulenameWebModule object in your custom module.

  9. In the Globals object, create a Dynamic feature, name it UtilityPkg, and set its value to the object reference number of the UtilityPkg object that you created in step 3.

  10. In the Globals object, run the BuildOSpace() script.

  11. Save and export your OSpace, then restart the Livelink Builder.

You have created the object responsible for handling callback scripts. Now you must customize this object for the custom display step type.

Adding Custom Scripts and Templates

After you implement the functionality required to create the custom display step type, you must create and store the custom scripts and templates for the tasks.

To add custom scripts and templates:

  1. Create a folder in your custom module's directory structure, and name it scripts (for example, c:/opentext/module/modulename_1_0_0/scripts).

  2. Create a folder in your custom module's directory structure and name it templates (for example, c:/opentext/module/modulename_1_0_0/templates).

  3. Add the scripts that you want to make available to the custom display step type to the scripts folder that you created in step 1. The scripts appear in the Script to run list on the Custom Display Step Definition page in the Workflow Designer.

  4. Add the templates that you want to make available to the Custom Display step type to the templates folder that you created in step 2. The templates appear in the Template to use list on the Custom Display Step Definition page in the Workflow Designer.