LinkedIn
Copied!

Table of Contents

launchHarness

Version:

Only available versions of this content are shown in the dropdown

Launches a harness. You can configure this API to replace the current harness, open a new harness, or launch the harness in a pop-up window.

Signature

launchHarness(options)

Returns

Not applicable.

Parameters

Name Description Type Required
harness Specifies the name of the harness that you want to launch. String
class Specifies the name of the class that the harness belongs to. String
displayMode Specifies how the UI displays the harness. The following values are available:
  • pega.api.ui.constants.REPLACE_CURRENT: The default value. Replaces the current tab or container with the new harness.
  • pega.api.ui.constants.POP_UP_WINDOW: Opens the harness in a new browser window.
  • pega.api.ui.constants.NEW_DOCUMENT: Opens the harness and replaces the current dynamic container content.

If the harness is launched outside of a dynamic container, it always opens in a pop-up window.

Constant
tabName Specifies the name of the tab whose contents the harness replaces. By default, the harness opens in a new tab. This setting is applicable only when displayMode is set to NEW_DOCUMENT or REPLACE_CURRENT. String
windowName Specifies the name of the browser window whose contents the harness replaces. When not defined, the harness opens in a new window. This setting is applicable only when displayMode is set to POP_UP_WINDOW. String
windowWidth Specifies the window width in pixels. This setting is applicable only when displayMode is set to POP_UP_WINDOW. Integer
windowHeight Specifies the window height in pixels. This setting is applicable only when displayMode is set to POP_UP_WINDOW. Integer
contextPage Specifies the name of the context page for the harness. When not defined, the harness uses the primary page context. String
readOnly Specifies if the harness is read-only. The default value is true. When set to false, Boolean
doSubmit Specifies whether the UI framework saves harness data before it replaces the harness. The default value is true. You can use this parameter when displayMode is set to REPLACE_CURRENT. Boolean
key Specifies the key value (pzInsKey) of a data instance that you want to automatically open as the new primary page when the harness is launched. The system uses this value to identify the record. This action runs before a pre-activity, if defined. You can use this parameter when displayMode is set to NEW_DOCUMENT. String
activity Specifies the activity that the harness launches on refresh. JSON object
dataTransform Specifies the data transform that the harness runs when launched. JSON object
displayHarnessFromServer Specifies if the system submits editable data from the form to the clipboard. The default value is true. Boolean
event Specifies the event that launches the harness. DOM event object

JSON objects

dataTransform
Includes an array of parameter objects. isProperty indicates whether the parameter is a property or a literal constant. The default value of isProperty is false, which means that the parameter is a constant.
{
   "name":"dataTransformName",
   "parameters":[
      {
         "name":"param1",
         "value":"Page1.prop1",
         "isProperty":true
      },
      {
         "name":"param2",
         "value":123,
         "isProperty":false
      }
   ]
}
activity
Includes an array of parameter objects. isProperty indicates whether the parameter is a property or a literal constant. The default value of isProperty is false, which means that the parameter is a constant.
{
   "name":"activityName",
   "parameters":[
      {
         "name":"param1",
         "value":"Page1.prop1",
         "isProperty":true
      },
      {
         "name":"param2",
         "value":123,
         "isProperty":false
      }
   ]
}

var options = {
    harness: "harnessName",
    harnessClass: "className",
    displayMode: pega.api.ui.constants.REPLACE_CURRENT / pega.api.ui.constants.POP_UP_WINDOW / pega.api.ui.constants.NEW_DOCUMENT,
    tabName: {
        value: "Page1.Prop1",
        isProperty: boolean
    },
    contextPage: "Page1",
    windowName: "wName",
    windowWidth: No of pixels,
    windowHeight: No of pixels,
    readOnly: boolean,
    doSubmit: boolean,
    key: {
        value: "Page1.Prop1/pzInsKey",
        isProperty: boolean
    },

    activity: activityJSONObject,
    dataTransform: dataTransformJSONObject,
    displayHarnessFromServer: boolean,
    event: eventObj
};

pega.api.ui.actions.launchHarness(options);
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.