import { C11nEnv } from '../interpreter/c11n-env'; import type { ActionAPIOptions, ActionObject, CaseActionOptions, Component, ExtendedActionObject, RemoteCaseMeta } from '../globals'; import type { LoadViewConfig, RefreshCaseView, JSActionQueryParams, PreviewOptions } from './types'; /** * Provides the basic APIs to handle actions in the Constellation infrastructure */ declare class ActionsApi { MSG_CLASSNAME_REQUIRED: string; MSG_CLASSNAME_STRING: string; MSG_ACTION_ID_REQUIRED: string; MSG_ACTION_ID_STRING: string; MSG_ACTION_NAME_REQUIRED: string; MSG_ACTION_NAME_STRING: string; MSG_KEY_PROPERTIES_REQUIRED: string; MSG_DATAVIEWID_REQUIRED: string; MSG_DATAVIEWID_STRING: string; MSG_CONTAINERITEMID_REQUIRED: string; MSG_CONTAINERITEMID_STRING: string; MSG_PAGENAME_REQUIRED: string; MSG_PAGENAME_STRING: string; MSG_INSIGHTID_REQUIRED: string; MSG_DASHBOARDID_REQUIRED: string; MSG_ACTIVE_SUGGESTION_UNATTENDED: string; MSG_CASE_ID_REQUIRED: string; MSG_CONTEXT_STRING: string; MSG_SUBSCRIPT_VIEW_REQUIRED: string; /** * Constructor - Not for use outside of Core! Included for reference only. * @param c11nEnv The context object that is used for this instance of the ActionsApi */ private readonly c11nEnv; constructor(c11nEnv: C11nEnv); /** * Returns should delete case in create stage or not * @param isFormContextDirty - boolean flag for form dirty. * @param isFirstAssignment - boolean flag for first assignment. * @param isCoexistenceUIKITApp - boolean flag for uikit app. * @returns Returns true If the assignment is in create stage, first assignment and context is not dirty * @function * @private */ shouldDeleteCaseInCreateStage: (isFormContextDirty: boolean, isFirstAssignment: boolean, isCoexistenceUIKITApp: boolean) => boolean; /** * Retrieves the case id, if not present then undefined * @param options CaseActionOptions * @returns caseID or undefined * @private */ getCaseID: (options: CaseActionOptions) => string | undefined; /** * Returns payload for SAVE_AND_CLOSE action * @param containerItemID - Id of the container item. * * For example: "app/modal_1" * @param saveOnly parameter which determines whether to only save the assignment. * @returns Payload required for SAVE_AND_CLOSE action * @function * @private */ getSaveActionPayload: (containerItemID: string, saveOnly?: boolean) => { [key: string]: any; }; /** * Create a promise for an actionsApi action and return an object containing the promise * and the ActionManager actionMgrID associated with that promise * @param theActionType the action type for which we're creating a promise * @param actionConfig the payload of the action being registered * @param enableLoadingIndicator if true (the default), call the IsLoadingManager's enableLoadingIndicator * while registering the promise with the ActionManager. If false, do not call enableLoadingIndicator * @returns object with actionMgrID and promise keys: { actionMgrID: , promise: } * @function * @private */ actionsApiPromise: (theActionType: string, actionConfig?: ActionObject, enableLoadingIndicator?: boolean) => { actionMgrID: string; promise: Promise; }; /** * Displays the create view of a data object to be created. *
* * @example Example for showDataObjectCreateView() * Example usage - * getPConnect().getActionsApi().showDataObjectCreateView('OZR2SN-ReactApp-Data-Person', 'Create').then(() => { * // showDataObjectCreateView success handling * }).catch(() => { * // showDataObjectCreateView failure handling * }) * * @param className The name of the class that provides the type that the data object should belong to. * * @param viewName The name of the create view that is to be displayed for the data object. * * @returns A Promise associated with the action. *

*/ showDataObjectCreateView(className: string, viewName?: string): Promise; /** * Cancels creation of data object by showing cancel alert popup in case any changes were made. * If no changes were made it removes the container item in which create view of DataType is loaded *
* * @example Usage example * In this example, the success callback is called if the creation of the data object is canceled. * const cancelCreateDataObjectPromise = getPConnect().getActionsApi().cancelDataObject("app/modal_3"); * cancelCreateDataObjectPromise.then(() => { * // cancel creation of data object success handling * }).catch(() => { * // cancel creation of data object failure handling * }); * * @param containerItemID The ID of the container item containing the create view of the data object. *

* @returns A Promise associated with the action. * */ cancelDataObject(containerItemID: string): Promise | object; /** * Creates a data object whose create view is loaded in the specified container item. *
* * @example In this example, the success callback is called if the data object is created. * * const createDataObjectPromise = getPConnect().getActionsApi().createDataObject("app/modal_3"); * createDataObjectPromise.then(() => { * // create data object success handling * }).catch(() => { * // create data object failure handling * }); * * @param containerItemID The ID of the container item containing the create view of the data object. *

* @returns A Promise associated with the action. * */ createDataObject(containerItemID: string): Promise; /** * Deletes data object of specific type with object containing primary keys *
* * @example In this example, the success callback is called if the data object is deleted. * * getPConnect().getActionsApi().deleteDataObject('APP-ReactApp-Data-Person', { pyGUID: '3ba585e8-f3e2-4404-8a15-692992de53b4' }).then(() => { * // deleteDataObject success handling * }).catch(() => { * // deleteDataObject failure handling * }); * * @param className The name of the class that provides the type that the data object should belong to. * * @param keys Object of the primary keys with values for the data object. * * @returns A Promise associated with the action. */ deleteDataObject(className: string, keys: { [key: string]: any; }): Promise; /** * Displays the edit view of a data object to be updated. *
* * @example Example for getDataObjectView() * Example usage - * getPConnect().getActionsApi().getDataObjectView('OZR2SN-ReactApp-Data-Person', {pyGUID: "61a8e531-afcb-41f7-bd72-9809e1a3cbe9"}).then(() => { * // getDataObjectView success handling * }).catch(() => { * // getDataObjectView failure handling * }) * * @param className The name of the class that provides the type that the data object should belong to. * @param keyProperties The object which contains the key properties of the dataObject * @param options Javascript object contains the view information * @param options.viewName The name of the edit view that is to be displayed for the data object. * @param options.readOnly If passed as true, the view will be rendered as readOnly * @param options.actionName The name of the action that should be displayed in the modal title. * * @returns A Promise associated with the action. */ getDataObjectView(className: string, keyProperties: { [key: string]: string; }, options?: { viewName: string; readOnly: boolean; actionName: string; }): Promise; /** * Updates a data object whose edit view is loaded in the specified container item. *
* * @example Example for updateDataObject() * Example usage - * const updateDataObjectPromise = getPConnect().getActionsApi().updateDataObject("app/modal_3", {pyGUID:"61a8e531-afcb-41f7-bd72-9809e1a3cbe9"}); * updateDataObjectPromise.then(() => { * updateDataObject success handling * }).catch(() => { * updateDataObject failure handling * }); * * @param containerItemID The ID of the container item containing the edit view of the data object. * Example: "app/modal_3" * @param keys The keys of the dataRecord to be updated * Example: {pyGUID:"b1715d32-7d7b-4d41-97ce-ced87b7c8fb0"} * @returns A Promise associated with the action. * */ updateDataObject(containerItemID: string, keys: { [key: string]: any; }): Promise; /** * Displays the flow action view of a data object to be updated. * @example Example for openDataObjectAction() * Example usage - * const openDataObjectActionPromise = getPConnect().getActionsApi().openDataObjectAction("ON8TTL-C11nGall-Data-Card", {Number:1234}, 'updateCVV', 'Update CVV'); * openDataObjectActionPromise.then(() => { * openDataObjectAction success handling * }).catch(() => { * openDataObjectAction failure handling * }); * @param className - Class ID of the Data Type Configured. * @param keyProperties - values of the data type record. * @param actionID - ID of the Action that is configured on the Data Type. * @param actionName - Name of the Action that is configured on the Data Type. * @returns A Promise associated with the action. */ openDataObjectAction(className: string, keyProperties: { [key: string]: string; }, actionID: string, actionName: string): Promise; /** * Updates the data object action based on flow action. * @example In this example, the success callback is called if the specified data object is updated based on the updateCVV flow action. * Example usage - * const submitDataObjectActionPromise = getPConnect().getActionsApi().submitDataObjectAction("app/primary_1/modal_1", '{Number:1234}', 'updateCVV'); * submitDataObjectActionPromise.then(() => { * submitDataObjectAction success handling * }).catch(() => { * submitDataObjectAction failure handling * }); * @param {string} containerItemID - The ID of the container item containing the edit view of the data object. * @param {Object.} keyProperties - The keys of the dataRecord to be updated * @param {string} actionID - ID of the Action that is configured on the Data Type. * @param {Object} [options] - (optional) The JavaScript object that contains the properties required for updating the data object. * @param {Object} [options.jsActionQueryParams] - (optional) The JavaScript object that contains properties that are added as query parameters to the fetch call of the submitDataObjectAction API. * Note: The jsActionQueryParams object only supports the skipRoboticAutomation property as of Infinity '25. * Supported values: * true - When true, post processing robotic automation is skipped while submitting the form. * false - When false, post processing robotic automation is considered while submitting the form. * @returns A Promise associated with the action. */ submitDataObjectAction(containerItemID: string, keyProperties: { [key: string]: string; }, actionID: string, options?: { jsActionQueryParams: JSActionQueryParams; }): Promise; /** * * Creates a work object for the given className and displays the assignment. * * @example Example for createWork() * Example usage - * const options = { * flowType: "pyStartCase", * containerName: "primary", * startingFields: { * FirstName: "Adam", * LastName: "Smith", * Vehicle: { * Make: "Honda", * Model: "Accord" * } * } * }; * const createWorkPromise = getPConnect().getActionsApi().createWork("OPB1HW-SpaceTra-Work-RequestApproval", options);
* createWorkPromise.then(() => { * // create work success handling * }).catch(() => { * // create work failure handling * }); * * @param className - Name of the case class * @param options - Javascript object contains the flowType, and containerName information * in the creation of the work object. * @param options.flowType Flow type * @param options.containerName Name of the containter * @param options.openCaseViewAfterCreate - The flag that determines if we can auto-navigate to new case view * or stay on the same page upon case creation. * Note: * - The default value is true. * - Set openCaseViewAfterCreate to true if we can auto-navigate to the new case view upon case creation. * - Set openCaseViewAfterCreate to false if we shouldn't navigate to the new case view and stay on the same page upon case creation. * @param options.modalOptions - JavaScript object that contains the properties required to customize the modal display. * @param options.modalOptions.dockable - The flag that determines where the modal is positioned in the screen. * Note: * - The default value is false * - Set dockable to true if the modal should be displayed at the bottom right corner of the screen. * - Set dockable to false if the modal should be displayed at the center of the screen. * *

* @param options.startingFields object containing fields to be set while creating a case * @param options.channelName Channel name * @param options.remoteCaseMeta The JSON object that contains the metadata for creating a traditional remote case. * * @returns A promise associated with the action (and stored in ActionManager) */ createWork(className: string, options?: { flowType?: string; containerName?: string; openCaseViewAfterCreate?: boolean; modalOptions?: { dockable: boolean; }; startingFields?: object; channelName?: string; remoteCaseMeta?: RemoteCaseMeta; }): any; /** * * Gives the available actions for data object with given dataViewID. * * @example Example for getDataObjectActions() * Example usage - * const getDataObjectActionsPromise = getPConnect().getActionsApi().getDataObjectActions("D_DocusignEnvelopeByAccountandDocumentId", {'accountId': 'account8987', 'documentId': 'doc1234'});
* getDataObjectActionsPromise.then(() => { * // getDataObjectActions success handling * }).catch(() => { * // getDataObjectActions failure handling * }); * * @param dataViewID - Name of the data page * @param dataViewParameters - Javascript object contains the parameters that need to be passed for the datapage * @returns A promise associated with the action (and stored in ActionManager) */ getDataObjectActions(dataViewID: string, dataViewParameters: object): Promise; /** * * This API will merge the descendants of the case in the context which is provided
* * @example Example for getDataObjectActions() * Example usage - With the the below example, getDescendants API will merge in the context provided. * const context = getPConnect().getContextName() * const getDescendantsPromise = getPConnect().getActionsApi().getDescendants("ON8TTL-C11NGALL-WORK D-206014", context) * getDescendantsPromise.then(() => { * // getDescendants success handling * }).catch(() => { * // getDescendants failure handling * }); * *
* @param {string} caseID - Id(pzInsKey value) of the case whose descendants must be updated in the store. * @param {string} context - (optional) The ID of the container item that provides the current context of the case
* For example: "app/primary_1/workarea_1" * @returns A promise associated with the action (and stored in ActionManager) */ getDescendants(caseID: string, context?: string): Promise; /** * Open the work object associated with the given workID *
* * @example Example for openWorkByHandle() * Example usage - * const openWorkPromise = getPConnect().getActionsApi().openWorkByHandle("OPB1HW-SPACE-WORK RA-10001", "OPB1HW-SpaceTra-Work-RequestApproval");
* openWorkPromise.then(() => { * // open work by handle success handling * }).catch(() => { * // open work by handle failure handling * }); * * // The success callback is called if the work object is opened successfully. * * @param workID The work object to be opened
* Example: "OPB1HW-SPACE-WORK RA-10001"

* * @param className Name of the case class
* Example: "OPB1HW-SpaceTra-Work-RequestApproval" *

* @param options The JavaScript object that contains the properties required for opening the work object.
* @param options.targetContainer The name of the container that the work object will be opened in. * @param options.channelName Channel name * @param options.remoteCaseMeta The JSON object that contains the metadata for opening a traditional remote case. * *

* @returns A promise associated with the action (and stored in ActionManager) * */ openWorkByHandle(workID: string, className: string, options?: { viewType?: string; targetContainer?: string; channelName?: string; remoteCaseMeta?: RemoteCaseMeta; }): any; /** * This method is to add necessary parameters for remote case openWorkByHandle action * @param actionConfig * @param className * @param remoteCaseMeta * @returns string * @private */ setRemoteCaseParamsForOpenCase(actionConfig: ExtendedActionObject, className: string, remoteCaseMeta?: RemoteCaseMeta): string | undefined; /** * Open the given assignment and associated with the given container target *
* @example Example for openAssignment() * Example usage - * const openAssignmentPromise = getPConnect().getActionsApi().openAssignment( * "ASSIGN-WORKLIST OPB1HW-SPACE-WORK RA-43001!REQUEST_FLOW_0", * "OPB1HW-SpaceTra-Work-RequestApproval", * { containerName: "primary" } * );
* openAssignmentPromise.then(() => { * // open assignment success handling * }).catch(() => { * // open assignment failure handling * }); * * // The success callback is called if the assignment is opened successfully. * * @param assignmentID - The ID of the assignment to be opened.
* Example: "ASSIGN-WORKLIST OPB1HW-SPACE-WORK RA-43001!REQUEST_FLOW_0" *

* @param className - Name of the case class
* Example: "OPB1HW-SpaceTra-Work-RequestApproval" *

* @param options - Javascript object containing containerName
* @param options.containerName Name of the container * @param options.channelName Channel name * @param options.isActionFromToDoList (optional) isActionFromToDoList * @param options.isChild (optional) isChild * @param options.context (optional) context * @param options.viewType (optional) viewType * @param options.skipBrowserSemanticUrlUpdate (optional) skipBrowserSemanticUrlUpdate * @param options.remoteCaseMeta The JSON object that contains the metadata for opening a traditional remote case assignment. * *
* Example:
* { containerName: "primary" } *

* @returns A promise associated with the action (and stored in ActionManager) */ openAssignment(assignmentID: string, className: string, options?: { isActionFromToDoList?: boolean; isChild?: boolean; context?: string; viewType?: string; skipBrowserSemanticUrlUpdate?: boolean; containerName: string; channelName?: string; remoteCaseMeta?: RemoteCaseMeta; }): any; /** * Finish the assignment (from the component's caseData.ID) that is * associated with the given case (from the component's caseData.caseID) and * the given Flow Container ID. * *
* @example Example for finishAssignment() * Example usage - * const finishAssignmentPromise = getPConnect().getActionsApi().finishAssignment("app/primary_1/workarea_1");
* finishAssignmentPromise.then(() => { * // finish assignment success handling * }).catch(() => { * // finish assignment failure handling * }); * * // The success callback is called if the assignment is submitted successfully. * * @param containerItemID - Id of the container
* For example: "app/primary_1/workarea_1" * @param options - The Javascript object that contains optional properties that provide additional information for submitting the assignment * For example: "{"outcomeID": 'Book a Hotel'}" * @param options.outcomeID - The ID generated for an outcome of the assignment that must be submitted. * For example: "{"jsActionQueryParams": "{"skipRoboticAutomation": true}"}" * @param options.jsActionQueryParams - The jsActionQueryParams will be added to the fetch call to append parameters. * @returns A promise associated with the action (and stored in ActionManager) */ finishAssignment(containerItemID: string, options?: { isTriggeredFromDifferentContext?: boolean; outcomeID: string; jsActionQueryParams?: JSActionQueryParams; }): Promise; /** * Open the next urgent assignment for the user *
* @example Example for getNextWork() * Example usage - * const getNextWorkPromise = getPConnect().getActionsApi().getNextWork() *
* getNextWorkPromise.then(() => { * // open Next Work success handling * }).catch(() => { * // open Next Work failure handling * }); * * // The success callback is called if the next Work is opened successfully. * *
* Example:
* { containerName: "primary" } *

* @returns A promise associated with the action (and stored in ActionManager) */ getNextWork(): Promise | Promise; /** * Open's the stage associated with the case using the stageID. * *
* @example Example for openStage() * Example usage - * const openStagePromise = getPConnect().getActionsApi().openStage("PRIM3");
* openStagePromise.then(() => { * // open stage success handling * }).catch(() => { * // open stage failure handling * }); * * // The success callback is called if the assignment is submitted successfully. * * @param stageID - Id of the Stage
* For example: "PRIM3" * @returns A promise associated with the action (and stored in ActionManager) */ openStage(stageID: string): Promise; submitBulkAction(containerItemID: string | string[]): Promise; submitBulkActionAsync(containerItemID: string | string[]): Promise; openBulkAction(actionID: string, options: { caseTypeID?: string; type?: string; target?: string; name?: string; selectedList?: string[]; runningMode?: 'sync' | 'async'; callbacks?: { submit?: () => void; cancel?: () => void; } | null; containerName?: string; bulkContextID?: string; bulkContextType?: string; showProgress?: boolean; progressMessage?: string; }): any; cancelBulkAction(containerItemID: string): Promise; /** * This API performs the approval action for the approval step configured in a case. *
* @example Example for approveCase() * Example usage - * const approveCasePromise = getPConnect().getActionsApi().approveCase("app/primary_1/workarea_1");
* approveCasePromise.then(() => { * // approve case success handling * }).catch(() => { * // approve case failure handling * }); * * // The success callback is called if the approve case action is successfully. * * @param containerItemID - Id of the container
* For example: "app/primary_1/workarea_1" * * @returns A promise associated with the action (and stored in ActionManager) */ approveCase(containerItemID: string): Promise; /** * This API performs the reject action for the approval step configured in a case. *
* @example Example for rejectCase() * Example usage - * const rejectCasePromise = getPConnect().getActionsApi().rejectCase("app/primary_1/workarea_1");
* rejectCasePromise.then(() => { * // reject case success handling * }).catch(() => { * // reject case failure handling * }); * * * // The success callback is called if the reject case action is successfully. * * @param containerItemID Id of the container
* For example: "app/primary_7/workarea_1" * * @returns A promise associated with the action (and stored in ActionManager) */ rejectCase(containerItemID: string): Promise; /** * This API performs the resolve duplicate action for the search duplicate cases automation step configured in a case. *
* @example Example for resolveDuplicateCase() * Example usage - In this example, the API performs the resolve duplicate action for the search duplicate cases automation * step configured in the app/primary_1/workarea_1 container. * const resolveDuplicateCasePromise = getPConnect().getActionsApi().resolveDuplicateCase("app/primary_1/workarea_1");
* resolveDuplicateCasePromise.then(() => { * // resolve duplicate case success handling * }).catch(() => { * // resolve duplicate case failure handling * }); * * // The success callback is called if the resolve duplicate case action is successful. * * @param containerItemID - The ID of the container item that provides the current context of the case
* For example: "app/primary_1/workarea_1" * * @returns A promise associated with the action (and stored in ActionManager) */ resolveDuplicateCase(containerItemID: string): Promise; /** * This API performs the ignore duplicate action for the search duplicate cases automation step configured in a case. *
* @example Example for ignoreDuplicateCase() * Example usage - In this example, the API performs the ignore duplicate action for the search duplicate * cases automation step configured in the app/primary_1/workarea_1 container * const ignoreDuplicateCasePromise = getPConnect().getActionsApi().ignoreDuplicateCase("app/primary_1/workarea_1");
* ignoreDuplicateCasePromise.then(() => { * // ignore duplicate case success handling * }).catch(() => { * // ignore duplicate case failure handling * }); * * // The success callback is called if the ignore duplicate case action is successful. * * @param containerItemID - The ID of the container item that provides the current context of the case
* For example: "app/primary_1/workarea_1" * * @returns A promise associated with the action (and stored in ActionManager) */ ignoreDuplicateCase(containerItemID: string): Promise; /** * Opens the local action configure as Case Wide, Stage Wide or Assignment level. * *
* @example Example for openLocalAction() * Example usage - * const localActionPromise = getPConnect().getActionsApi().openLocalAction("EditDetails", { type : "Case" });
* localActionPromise.then(() => { * // local action success handling * }).catch(() => { * // local action failure handling * }); * * // The success callback is called if the local action is launched successfully. * * @param actionID - Id of the local action * Example: "EditDetails" *
* @param options - Javascript object containing caseID, assignmentID, actionTitle and type properties necessary for opening local action
* * @param options.target - Container name
* @param options.caseID - Id of the case pointing to pzInsKey value. Will be used if provided else will get it using current context
* @param options.assignKey - Id of the assignment. Will be used if provided else will get it using current context
* @param options.actionTitle - Title of the local action. Used as modal header title when local action is displayed in modal dialog
* @param options.containerName - is used to launch the local action in a modal or in workarea
* @param options.name - name of the local action
* @param options.type - Type of the local action, Type can be "Assignment" or "Case" or "Stage" or "Express"
* @param options.refreshConditions - refreshConditions should be an array of objects containing the field name and event. * Assignment, Stage and Case are the scopes that determine whether it is a Casewide local action or stagewide local action or assignment level local action.
* Express type is used when we need to call the local actions from the different context
*
* Example:
{ * "name": "Edit Details", * "type": “stage, * "containerName": "modal" * }, * { * "name": "Transfer assignment", * "type": “Assignment, * "containerName": "modal" * }, * { * "name": "Change stage", * "type": “Case, * "containerName": “workarea” * }, * { * "name": "Transfer assignment", * "type": “express”, * "containerName": “workarea” * “assignKey”:”ASSIGN-WORKLIST ON8TTL-GALLERY-WORK D-206014!VEHICLEDETAILS_FLOW” * “caseID”:”"ON8TTL-GALLERY-WORK D-206014” * "refreshConditions": [{field: ".Prop1", event: "Changes"}] * }, * { * caseID: "ORG-APP-WORK W-102", * assignmentID: "", * actionTitle: "Edit Details", * type: "Assignment" / "Case" / "Stage" / "Express" * } * @returns A promise associated with the action (and stored in ActionManager) */ openLocalAction(actionID: string, options: CaseActionOptions): Promise | Promise; /** * Opens the process action that is configured. *
* @example Example for openProcessAction() * Example usage - * const processActionPromise = getPConnect().getActionsApi().openProcessAction("VendorAddition_Flow", { type: "Case" });
* processActionPromise.then(() => { * // open process action success handling * }).catch(() => { * // open process action failure handling * }); * * // The success callback is called if the process action is launched successfully. * * @param actionID - Action Id
* Example: "VendorAddition_Flow" *
* @param options - Javascript object containing container target in which the process action will be shown
* @param options.caseID - Id of the case pointing to pzInsKey value. Will be used if provided else will get it using current context
* @param options.actionTitle - Title of the local action. Used as modal header title when local action is displayed in modal dialog
* @param options.type - Type of the process action. Type can be "Case" or "Stage"
* *
* Example:
* { * caseID: "ORG-APP-WORK W-102", * actionTitle: "Vendor Addition", * type: "Case" / "Stage" * } * @returns A promise associated with the action (and stored in ActionManager) */ openProcessAction(actionID: string, options: CaseActionOptions): Promise | Promise; /** * Navigate to the given step in the context of the given container *
* * @example Example for navigateToStep() * Example usage - * navigateToStepPromise = getPConnect().getActionsApi().navigateToStep("Step1", "app/primary_1/workarea_1");
* navigateToStepPromise.then(() = > { * // navigate to step success handling * }).catch(() => { * // navigate to step failure handling * }); * * // The success callback is called if the action is successful. * * @param stepID - ID of the step or "previous" to go to previous step
* For example: "Step1", "previous" * @param containerItemID - Id of the container item
* For example: "app/primary_1/workarea_1" * * * @returns A promise associated with the action (and stored in ActionManager) */ navigateToStep(stepID: string, containerItemID: string): Promise; /** * Cancel the assignment that is associated with the current component's * caseID (from caseData.caseID). * *

* This action will also perform necessary actions related to the cancellation (e.g., release any locks).

* * @example Example for cancelAssignment() * Example usage - * const cancelAssignmentPromise = getPConnect().getActionsApi().cancelAssignment("app/primary_1/workarea_1");
* cancelAssignmentPromise.then(() => { * // cancel assignment success handling * }).catch(() => { * // cancel assignment failure handling * }); * * // The success callback is called if the API is executed successfully. * * @param containerItemID - Id of the container item
* For example: "app/primary_1/workarea_1" * * @returns A promise associated with the action (and stored in ActionManager) */ cancelAssignment(containerItemID: string, skipPublishCancelEvent: boolean): Promise; /** * Cancel the local action that is associated with the current component's * caseID (from caseData.caseID). * *

* * There are different usecases the way this action works when the Edit Action and Local Actions are launched.
*
    *
  1. * If Edit Action or local Action is launched, form is not dirty and action is fired from modal dialog. * The case will be deleted by calling deleteCaseInCreateStage API. *
  2. *
  3. * If Edit Action or local Action is launched and the form is dirty and action is fired from modal dialog, then an event EVENT_SHOW_CANCEL_ALERT is dispatched. * This EVENT_CANCEL_ALERT is used to show an alert dialog. An alert dialog with a message and 2 buttons is shown. * (Go back and Discard) is shown. *
  4. * * * @example Example for cancelLocalAction() * Example usage - * const cancelLocalAction = getPConnect().getActionsApi().cancelLocalAction("app/modal_3");
    * cancelLocalAction.then(() => { * // cancel create stage assignment success handling * }).catch(() => { * // cancel create stage assignment failure handling * }); * * // The success callback is called if the API is executed successfully. * * @param containerItemID - Id of the container item
    *

    * * For example: "app/modal_3" * * @returns A promise associated with the action (and stored in ActionManager) */ cancelLocalAction(containerItemID: string): Promise | object; /** * Cancel the assignment that is associated with the current component's * caseID (from caseData.caseID). * *

    * * There are different usecases the way this action works when the assignment is in create stage.
    *
      *
    1. * If the current assignment is first assignment in create stage, form is not dirty and action is fired from modal dialog. * The case will be deleted by calling deleteCaseInCreateStage API. *
    2. *
    3. * If the current assignment is in create stage and the form is dirty and action is fired from modal dialog, then an event EVENT_SHOW_CANCEL_ALERT is dispatched. * This EVENT_SHOW_CANCEL_ALERT is used to show an alert dialog. An alert dialog with a message and 2 buttons is shown. * (Go back and Discard) is shown. *
    4. * * * @example Example for cancelCreateStageAssignment() * Example usage - * const cancelCreateStageAssignmentPromise = getPConnect().getActionsApi().cancelCreateStageAssignment("app/modal_3");
      * cancelCreateStageAssignmentPromise.then(() => { * // cancel create stage assignment success handling * }).catch(() => { * // cancel create stage assignment failure handling * }); * * // The success callback is called if the API is executed successfully. * * @param containerItemID - Id of the container item
      *

      * * For example: "app/modal_3" * * @returns A promise associated with the action (and stored in ActionManager) */ cancelCreateStageAssignment(containerItemID: string): Promise; /** * Saves the opened assignment. * * @example Usage example * In this example, the success callback is called if the opened assignment is saved successfully. * * const saveAssignmentPromise = getPConnect().getActionsApi().saveAssignment("app/modal_1"); * saveAssignmentPromise.then(() => { * // saveAssignment success handling * }).catch(() => { * // saveAssignment failure handling * }); * *
      * * @param containerItemID - The ID of the container item that contains information about the opened assignment.
      *

      * Example: "app/modal_1" * @returns A Promise associated with the action. */ saveAssignment(containerItemID: string): Promise; /** * Save the current work object opened in the modal dialog. * * @example Example for saveAndClose() * Example usage - * const saveAndClosePromise = getPConnect().getActionsApi().saveAndClose("app/modal_1");
      * saveAndClosePromise.then(() => { * // save and close success handling * }).catch(() => { * // save and close failure handling * }); * * // The success callback is called if the case is saved successfully. * * @param containerItemID - Id of the container item
      *

      * For example: "app/modal_1" * @returns A promise associated with the action (and stored in ActionManager) */ saveAndClose(containerItemID: string): Promise; /** * Deletes the case that is currently in the create stage. *
      * @example Usage example * In this example, the success callback is called if the case that is currently in the create stage is deleted successfully. * * const deleteCaseInCreateStagePromise = getPConnect().getActionsApi().deleteCaseInCreateStage("app/modal_1");
      * deleteCaseInCreateStagePromise.then(() => { * // delete case in create stage success handling * }).catch(() => { * // delete case in create stage success handling * }); * * @param containerItemID - The ID of the container item that contains information about the case that is currently in the create stage. *

      * Example: "app/modal_1" * * @param ignoreCaseDeletion - The flag that determines if a case will be deleted in the create stage. *
      * The default value is false. * Set ignoreCaseDeletion to true if the case should not be deleted in the create stage * Set ignoreCaseDeletion to false if the case should be deleted in the create stage. * * @returns A Promise associated with the action. */ deleteCaseInCreateStage(containerItemID: string, ignoreCaseDeletion?: boolean): Promise; /** * Fetches the recent items *
      * @example Example for getRecents() * Example usage - * const recentsPromise = getPConnect().getActionsApi().getRecents(15);
      * recentsPromise.then((data) => { * // recents success handling * }).catch(() => { * // recents failure handling * }); * * // The success callback is called if the API is successful. * * @param maxResultsToFetch - Maximum number of results to be fetch
      *

      * For example: 15 * * @returns A promise associated with the action (and stored in ActionManager) */ getRecents(maxResultsToFetch: number): Promise; /** * Update the recents with new item *
      * @example Example for updateRecents(classID, caseID,label,ID) * Example usage - * const recentsUpdatePromise = getPConnect().getActionsApi().updateRecents("APP-1TC-Work-TCUser","T-99009","TCUser","APP-1TC-WORK T-99009");
      * recentsUpdatePromise.then((data) => { * // update recents success handling * }).catch(() => { * // update recents failure handling * }); * * // The success callback is called if the API is successful. * @private * @param classID - Class of the Work Object
      * @param caseID - id of the work object
      * @param label - label of the work object
      * @param ID - INs Key of the Work Object
      * * @returns A promise associated with the action (and stored in ActionManager) */ updateRecents(classID: string, caseID: string, label: string, ID: string): Promise; /** * Invoke a Logout REST API using fetch function of the service broker. * * @example Example for logout() * Example usage - * const logoutPromise = getPConnect().getActionsApi().logout();
      * logoutPromise.then(() => { * // logout success handling * }).catch(() => { * // logout failure handling * }); * * // the callbackFunction is called if the API successfully obtains a logout response. * * @returns A promise for the pre-processed logout response. * @private */ logout(): Promise; /** * Invoke a REST API using fetch function of the service broker. * * @example Example for invoke() * Example usage - * * invokePromise = getPConnect().getActionsApi().invoke(url, options);
      * invokePromise.then(() => { * // invoke success handling * }).catch(() => { * // invoke failure handling * }); * *
      * // invokes the URL with the options provided, and returns a response * * @param url - The URL for the request.

      * Examples of url include: *
      /prweb/api/v1/messages?filterFor=DATA-PORTAL $SpaceTra *
      *
      /prweb/api/v1/data/D_pxOperatorDetails?OperatorId=user%40gallery.com * @param opts - The HTTP methods that are used in the request body to fetch the REST API * @returns A promise for the pre-processed response. */ invoke(url: string, opts?: { method?: string; body?: object; }): Promise; /** * This API displays a preview of a case item inside the preview panel. * * @example Example for showCasePreview() * Example usage - getPConnect().getActionsApi().showCasePreview(pzInsKey, configObj); * // Show the preview of a case item(identified by unique key called pzInsKey) inside preview panel with the extra configuration object provided * * @param pzInsKey - Unique identifier of the case item.

      * Examples of pzInsKey include: *
      OPB1HW-SPACE-WORK 20RA-2 * @param configObj object containing extra infomation like case class name which might be required. * @returns A promise associated with the action */ showCasePreview(pzInsKey: string, configObj?: object): void; /** * This API displays a preview of a data item inside the preview panel. * * @example showDataPreview() * Show the preview of a data item under D_TestData with ProductId 'prd-1' inside preview panel with the extra configuration object provided * ``` * getPConnect().getActionsApi().showDataPreview('D_TestData', {ProductId : 'prd-1'}); * ``` * * @param dataContext - Name of the data context

      * Examples of dataContext include: *
      D_TestData * @param dataContextParameters - Parameters required for the data context

      * Examples of dataContextParameters include: *
      {ProductId : 'prd-1'} * @param options - object containing additional infomation pertaining to opening of preview panel. * @returns A promise associated with the action */ showDataPreview(dataContext: string, dataContextParameters: Record, options?: PreviewOptions): Promise; /** * This API loads a view with data from server based on the context of a case
      * * @example Example for loadView() * In this example, the API loads the pyReview view with data from a server based on the context of the case whose ID is ON8TTL-GALLERY-WORK C-7001. * Example usage - * const loadViewPromise = getPConnect().getActionsApi().loadView(“ON8TTL-GALLERY-WORK C-7001”,”pyReview”);
      * loadViewPromise.then(() => { * // load view success handling * }).catch(() => { * // load view failure handling * }); * * @param {string} caseId Unique identifier of the case associated with a context * @param {string} viewName Name of the view which must be loadedwith data. * @param {object} config - (Optional) Object to pass context and container information * @param {boolean} config.containerName - The view should be loaded on the provided container by creating the new context. * @param {boolean} config.context - The name of the context in which associated data of view should be merged. * @param {boolean} config.updateData - flag to decide whether associated data of view should be merged to the provided context. Default is false. * @param {readOnly} config.readOnly - If passed as true, the view will be rendered as readOnly * If updatedata passed as true along with context, The data of the associated view is merged in the provided context. * If updatedata passed as true without context, The data of the associated view is merged in the current context. * @returns {Promise} A promise associated with the action (and stored in ActionManager) */ loadView(caseId: string, viewName: string, config: LoadViewConfig): Promise; /** * * Displays the page of a class. * * @example Example for showPage() * Example usage - * const showPagePromise = getPConnect().getActionsApi().showPage("pyHome", "Data-Portal");
      * showPagePromise.then(() => { * // show page success handling * }).cath(() => { * // show page failure handling * }); * * // obtains and displays the view metadata and class name of a page. * * @param pageName - Name of the page * Some examples:

      * page = "pyHome"
      * @param className - Class name to which the page belongs to * Some examples:

      * className: "Data-Portal" *

      * @param options - Javascript object containing containerName
      * @param options.containerName Name of the container * @param options.skipSemanticUrl - Flag to skip semantic url evaluation logic *
      * Example:
      * { containerName: "primary" } *

      * @returns A promise associated with the action (and stored in ActionManager) */ showPage(pageName: string, className: string, options?: { containerName: string; skipSemanticUrl: string; }): any; /** * This API performs loading the insight with semantic url. *
      * @example Example for showInsight() * Example usage - * const showInsight = getPConnect().getActionsApi().showInsight("sample_insightID");
      * showInsight.then(() => { * // show insight success handling * }).catch(() => { * // show insight failure handling * }); * * // The success callback is called if the showInsight action is successfully. * * @param insightID - Id of the Insight
      * For example: "d68f3f66-5ff3-443d-9ef9-544051fb74a4" * * @returns A promise associated with the action (and stored in ActionManager) * @function * @private */ showInsight(insightID: string, options?: { skipSemanticUrl?: boolean; }): Promise; /** * This API performs loading the dashboard with semantic url. *
      * @example Example for showDashboard() * Example usage - * const showDashboard = getPConnect().getActionsApi().showDashboard("sample_dashboardID");
      * showDashboard.then(() => { * // show dashboard success handling * }).catch(() => { * // show dashboard failure handling * }); * * // The success callback is called if the showDashboard action is successfully. * * @param dashboardID - Id of the dashboard
      * For example: "d68f3f66-5ff3-443d-9ef9-544051fb74a4" * * @returns A promise associated with the action (and stored in ActionManager) * @function * @private */ showDashboard(dashboardID: string, options?: { skipSemanticUrl?: boolean; }): Promise; /** * * Displays the data of a page based on the data context. * * @example Example for showData() * Example usage - * const showDataPromise = getPConnect().getActionsApi().showData("EmployeeDetails", "D_EmployeeDetails", {pyGUID: "0759409f-4146-439c-aa25-57d4f495fee5"});
      * showDataPromise.then(() => { * // show data success handling * }).cath(() => { * // show data failure handling * }); * * * @param pageName - The name of the view in which the data must be displayed. * @param dataContext - The name of page type data page whose data must be displayed. * @param dataContextParameters - The parameters associated with the data page. * @param options - The JavaScript object containing the properties to display the data.
      * @param options.containerName - The name of the container that displays the data. * @param options.skipSemanticUrl - The flag that determines if the semantic URL evaluation logic must be skipped. *
      * * Note: * - The default value is false * - If the value is false, the semantic URL evaluation logic will not be skipped. * - If the value is true, the semantic URL evaluation logic will be skipped. * *

      * @returns A promise associated with the action (and stored in ActionManager) */ showData(pageName: string, dataContext: string, dataContextParameters: object, options?: { container?: string; context?: string; containerName?: string; skipSemanticUrl?: boolean; }): Promise; /** * Run a changeHandler for the given component context of the component through the Action Processor * * @example Example for changeHandler() * Example usage - getPConnect().getActionsApi().changeHandler(pConnObject, event); * // handles the change event triggered by the UI component. * * @param pConn PConnect object associated with handler being run * @param event The Document Object Model (DOM)event object associated with the change */ changeHandler(pConn: C11nEnv, event: Event): void; /** * Run an eventHandler for the given component context of the component through the Action Processor * * @example Example for eventHandler() * Example usage - getPConnect().getActionsApi().eventHandler(pConnObject, event); * // handles the event triggered by the UI component. * * @param pConn PConnect object associated with handler being registered * @param event The Document Object Model (DOM)eventobject associated with the event. */ eventHandler(pConn: C11nEnv, event: Event): void; /** * This API runs validations on the control and triggers FIELD_CHANGE event * so that ChangeObserver can listen for it. * * @example Example for triggerFieldChange() * Example usage - getPConnect().getActionsApi().triggerFieldChange(propName, value, skipValidation); * // the API validates and invokes the FIELD_CHANGE event as triggered by the specified control. * * @param propName name of the control on which the FIELD_CHANGE event must be invoked * @param value value of the control that will be validated and passed when invoking the FIELD_CHANGE event * @param skipValidation true/false value stating if client side validation needs to run or not * @param options - Javascript object containing skipDirtyValidation details. * @param options.skipDirtyValidation - flag to decide whether the property has to considered in Dirty Validation. Default is false. If passed as true Dirty Validation will be skipped on the respected property. */ triggerFieldChange(propName: string, value: any, skipValidation?: boolean, options?: { skipDirtyValidation: boolean; }): void; /** * This API dispatches the SET_PROPERTY event on a specified control to store a specified value in the Redux Store. * This API also deletes the error messages of the control by calling the clearMessages API in the MessageManager module. * * @example Example for updateFieldValue() * Example usage - getPConnect().getActionsApi().updateFieldValue(propName, value); * // the API stores the value passed in the Redux Store as triggered by the control. * * @param propName name of the control whose value must be stored in the Redux Store * @param value value of the control to be stored in the Redux Store * @param options - Javascript object containing removePropertyFromChangedList, isArrayDeepMerge details * @param options.removePropertyFromChangedList - removePropertyFromChangedList - pass true to delete entry in changedPropertyList * @param options.isArrayDeepMerge - flag to decide whether to deep merge the objects or values inside array or not * @param options.skipDirtyValidation - flag to decide whether the property has to considered in Dirty Validation. Default is false. If passed as true Dirty Validation will be skipped on the respected property. * @param options.isListEntry - removePropertyFromChangedList - pass true to delete entry in the List */ updateFieldValue(propName: string, value: any, options?: { removePropertyFromChangedList?: boolean; isArrayDeepMerge?: boolean; skipDirtyValidation?: boolean; isListEntry?: boolean; contextPageReference?: string; associatedProperty?: string; }): void; /** * Activates the modal container item of the passed container item id *
      * @example Example for activateModalContainerItem() * Example usage - getPConnect().activateModalContainerItem({ * context: "app/primary_1", * isModalAction: true * }).then(successCallback); * * // The success callback is called if the case is deleted successfully. * * * @param actionInfo - Javascript object containing container properties like context and isModalAction
      * Example:
      * { * context: "app/primary_1", * isModalAction: true * } * * @returns A promise associated with the action (and stored in ActionManager) * * @function * @private */ activateModalContainerItem(actionInfo: { context: string; }): Promise; refreshCaseView(caseID: string, viewID: string, pageReference: string, options?: ActionAPIOptions): Promise; refreshEmbeddedDataWithAction(caseID: string, assignmentID: string, actionID: string, interestPage: string, interestPageActionID: string, localAction: boolean, isMultiRecordData: boolean, editType: string, options?: ActionAPIOptions): Promise; /** * Displays the view to add/update a record in Embedded data type. *
      * * @example Example for openEmbeddedDataModal() * In this example, the success callback is called if the modal is opened successfully * getPConnect().getActionsApi().openEmbeddedDataModal('Create', pConnObject, '.Employees', 1, 'CREATE', 'Add Employee').then(() => { * // openEmbeddedDataModal success handling * }).catch(() => { * // openEmbeddedDataModal failure handling * }) * * @param viewName The name of the view * @param component PConnect object associated with the Embedded data table * @param targetProperty The property associated to Embedded data * @param index The index of the new row * @param action CREATE/EDIT action * @param heading Heading for the create/edit modal * @returns A Promise associated with the action. *

      */ openEmbeddedDataModal(viewName: string, component: Component, targetProperty: string, index: number | string, action: string, heading: string, editType: string, interestPageActionID: string): Promise; /** * Submits the view and add/update a record to Embedded data type. *
      * * @example Example for submitEmbeddedDataModal() * In this example, the success callback is called if a row is added/edited successfully * getPConnect().getActionsApi().submitEmbeddedDataModal('app/modal_3').then(() => { * // submitEmbeddedDataModal success handling * }).catch(() => { * // submitEmbeddedDataModal failure handling * }) * @param containerItemID - The ID of the container item containing the add/edit view of the Embedded data type. * @returns A Promise associated with the action. *

      */ submitEmbeddedDataModal(containerItemID: string): Promise; /** * Fill the assignment form for the user with logical sample data based on the name and type of field using AI *
      * @example Example for fillFormWithAI() * Example usage - * const fillFormWithAIPromise = getPConnect().getActionsApi().fillForWithAI('app/primary_1/workarea_1') *
      * fillFormWithAIPromise.then(() => { * // fillFormWithAI success handling * }).catch(() => { * // fillFormWithAI failure handling * }); * * // The success callback is called if the form is filled successfully using fillFormWithAI * *
      * @param containerItemID - ID of the container
      * For example: "app/primary_1/workarea_1" *

      * @returns A promise associated with the action (and stored in ActionManager) */ fillFormWithAI(containerItemID: string): Promise; /** * Handles the subscript action for a given page group in the respective container item. * * @param {string} containerItemID - The ID of the container item. * @param {any} c11nEnv - The context object used for this instance of the ActionsApi. * @returns {Promise | null} - A promise associated with the action or null if the subscript view is invalid. * @private */ handleSubscript(containerItemID: string, c11nEnv: C11nEnv): Promise | null; /** * Displays the create view of a subscript. * * @param {string} className - The name of the class that provides the type that the subscript should belong to. * @param {string} referenceListStr - The reference list string for the subscript. * @param {string} subscriptName - The name of the subscript. * @param {string} [viewName=publicConstants.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW] - The name of the create view that is to be displayed for the subscript. * @returns {Promise} - A promise associated with the action. * @private */ showSubscriptCreateView(className: string, referenceListStr: string, subscriptName: string, viewName?: string): Promise; /** * Deletes the external sor using workId parameter * * @example In this example, the success callback is called if object is deleted. * * getPConnect().getActionsApi().deleteWork('workId', 'caseTypeId').then(() => { * // deleteWork success handling * }).catch(() => { * // deleteWork failure handling * }); * * @param workId * @param caseTypeID * */ deleteWork(workId: string, caseTypeID: string): Promise; } export default ActionsApi;