Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

launchHarness

Updated on December 13, 2022

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

NameDescriptionTypeRequired
harnessSpecifies the name of the harness that you want to launch.String
classSpecifies the name of the class that the harness belongs to.String
displayModeSpecifies 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
tabNameSpecifies 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
windowNameSpecifies 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
windowWidthSpecifies the window width in pixels. This setting is applicable only when displayMode is set to POP_UP_WINDOW.Integer
windowHeightSpecifies the window height in pixels. This setting is applicable only when displayMode is set to POP_UP_WINDOW.Integer
contextPageSpecifies the name of the context page for the harness. When not defined, the harness uses the primary page context.String
readOnlySpecifies if the harness is read-only. The default value is true. When set to false, Boolean
doSubmitSpecifies 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
keySpecifies 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
activitySpecifies the activity that the harness launches on refresh.JSON object
dataTransformSpecifies the data transform that the harness runs when launched.JSON object
displayHarnessFromServerSpecifies if the system submits editable data from the form to the clipboard. The default value is true.Boolean
eventSpecifies 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
      }
   ]
}
For example:

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);

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us