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:
- Attach callback scripts to particular workflow events that
are associated with the step. These callback scripts define the custom
operations that can occur when a step of this type becomes ready or is complete.
- Attach HTML templates to the step. These HTML
templates define the interface that is presented to workflow participants
when they work on tasks of this type.
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:
- Orphan WFMain:WFRoot:WFObjectTypes:WFTaskTypes:StandardTasks
in your custom module's OSpace, and name it
CustomDisplayAPI.
- 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.
- 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.
- 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.
- Create a script, and name it
CreateReviewMapRec().
- 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:
- Orphan WebWFP:WebWFPRoot:WFTask in
your custom module's OSpace,
and name it CustomDisplayPaint.
- 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.
- 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.
- Override the following scripts:
- 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:
- Orphan WebWork:WebWork Root:WFTask in
your custom
module's OSpace, and name it CustomDisplayWork.
- In the CustomDisplayWork object, set the fPaletteTask feature to TRUE.
- 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.
- 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.
- 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.
- Copy the custtask.gif file to the /webwork directory of your Content Server installation (for example,
c:/opentext/module/webwork/support).
- 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.
- Override the following scripts:
- Create a script, and name it PutReviewData.
- Create a script, and name it ReassignStep.
- 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:
- Orphan WFMain:WFRoot:WFCustomScriptPkg
in your custom module's OSpace, and name it WFCustomScriptPkg.
- In the WFCustomScriptPkg object, modify the CBExecute() script.
- In your custom module, create a child object of the Root
object, and name it UtilityPkg.
- In the UtilityPkg object,
create a script, and name it
ExecuteCustTaskScript.
- Create a Script feature,
and name it ExecuteScript.
- Create a Script feature, and name it ListScripts.
- Create a Script feature, and name it ListTemplates.
- 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.
- 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.
- In the Globals object,
run the BuildOSpace() script.
- 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:
- Create a folder in your custom module's directory structure, and name it scripts
(for example, c:/opentext/module/modulename_1_0_0/scripts).
- Create a folder in your custom module's directory structure and name it templates
(for example, c:/opentext/module/modulename_1_0_0/templates).
- 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.
- 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.