import { C11nEnv } from '../interpreter/c11n-env'; import type { ActionButtons } from './types'; /** * Class to provide case information related API's */ declare class CaseInfo { readonly c11nEnv: C11nEnv; constructor(c11nEnv: C11nEnv); /** * Fetch case stages details for a given case id * @example In this example, the API returns the stages of the case with id "OPB1HW-SPACE-WORK RA-43001". * const stages = getPConnect().getCaseInfo().getCaseStages(OPB1HW-SPACE-WORK RA-43001); * @param caseID The id of the case whose stages are to be fetched
* @param contextName The current context where to render * @returns Case stages details of given case id */ getCaseStages(caseID: string, contextName: string): Promise; /** * Obtains the name of the case type. * * @example In this example, the API returns the name of the case type. * const caseTypeName = getPConnect().getCaseInfo().getCaseTypeName(); * * @returns Case type name *

* Eg: Registration */ getCaseTypeName(): string; /** * Returns Case name * * @example Example for getName() * const caseName = getPConnect().getCaseInfo().getName(); * * @returns Case name *

* Eg: Registration */ getName(): string; /** * Returns Case class name * * @example Example for getClassName() * const className = getPConnect().getCaseInfo().getClassName(); * * @returns Case class name *

* Eg: ON8TTL-C11nGall-Work-CreateStageTest */ getClassName(): string; /** * Fetch available processes for a case * @example Example for getAvailableProcesses()". * const availableProcesses = getPConnect().getCaseInfo().getAvailableProcesses(); * @returns - returns available processes *
* Eg: [ * { * "name": "Vendor Addition", * "links": { * "add": { * "rel": "self", * "href": "/cases/ON8TTL-GALLERY-WORK PC-99001/processes/VendorAddition_Flow", * "type": "POST", * "title": "add case optional process" * } * }, * "ID": "VendorAddition_Flow", * "type": "Case" * } * ] */ getAvailableProcesses(): any[]; /** * Returns Case key * * @example Example for getKey() * const caseKey = getPConnect().getCaseInfo().getKey(); * * @returns Case key *

* Eg: ON8TTL-GALLERY-WORK CST-1 */ getKey(): string; /** * Returns Case ID * * @example Example for getID() * const caseKey = getPConnect().getCaseInfo().getID(); * * @returns - Case ID *

* Eg: CST-1 */ getID(): string | undefined; /** * Returns Assignment ID * * @example Example for getAssignmentID() * const assignmentID = getPConnect().getCaseInfo().getAssignmentID(); * * @returns Assignment ID *

* Eg: ASSIGN-WORKLIST ON8TTL-GALLERY-WORK CST-51001!CREATEFORM_DEFAULT */ getAssignmentID(): string; /** * Returns Case actions info * * @example Example for getActions() * const actions = getPConnect().getCaseInfo().getActions(); * * * @returns Case actions info *
* Eg: { * "secondary": [ * { * "jsAction": "cancelAssignment", * "name": "Cancel", * "actionID": "cancel" * } * ], * "main": [ * { * "jsAction": "finishAssignment", * "name": "Next ", * "actionID": "next" * } * ] * } */ getActions(): ActionButtons; /** * Returns current flow action ID that is rendered. * * @example Example for getActiveFlowActionID() * const activeFlowActionID = getPConnect().getCaseInfo().getActiveFlowActionID(); * * @returns Current flow action ID *

* Eg: MyFlowAction1 */ getActiveFlowActionID(): string; /** * Returns parent case info when the current assignment is in child case. * * @example Example for getParentCaseInfo() * const parentCaseInfo = getPConnect().getCaseInfo().getParentCaseInfo(); * * @returns Parent Case details of current child Case. *

* Eg: * { * "hasMoreAncestors":"false", * "name":"Parent case", * "links":{ * "open":{ * "rel":"other", * "href":"/cases/APP-FOOD-WORK P-13002", * "type":"GET", * "title":"open parent case" * } * }, * "ID":"APP-FOOD-WORK P-13002", * "content":{ * "pyStatusWork":"New", * "classID":"APP-Food-Work-ParentCase", * "pxUpdatedOperatorAndDateTime":"Gallery less than a minute ago", * "pxUrgencyWork":"10", * "pxCreateOperatorAndDateTime":"Gallery 38 minutes ago" * } * } */ getParentCaseInfo(): any; /** * Returns true if the view is in perform mode else false * * @example Example for isPerform() * const isPerform = getPConnect().getCaseInfo().isPerform(); * * @returns Flag to indicate perform mode or not * */ isPerform(): boolean; /** * Returns true if the view is in review mode else false * * @example Example for isReview() * const isReview = getPConnect().getCaseInfo().isReview(); * * @returns Flag to indicate review mode or not * */ isReview(): boolean; /** * Checks and returns true if the current assignment is in create stage. * @private * @returns - Returns true if the current assignment is in create stage else false */ isAssignmentInCreateStage(): boolean; /** * Checks and returns true if the current action is local action. * @private * @returns - Returns true if the current action is local action else false */ isLocalAction(): boolean; /** * Obtains the name of the current assignment's view in a case. * * @example Example for getCurrentAssignmentViewName() * const viewName = getPConnect().getCaseInfo().getCurrentAssignmentViewName(); * * @returns View name *

* Eg: EmployeeDetails */ getCurrentAssignmentViewName(): string | null; /** * Returns the refresh condition of current active case action * * @example Example for getActionRefreshConditions() * const refreshConditions = getPConnect().getCaseInfo().getActionRefreshConditions(); * * @returns Refresh Conditions *

* Eg: refreshConditions: [{field: ".Datetime",event: "Changes"}, {field: ".Checkbox",event: "Changes"}] * @private */ getActionRefreshConditions(): any; /** * Returns Business ID * @example Example for getBusinessID() * const caseKey = getPConnect().getCaseInfo().getBusinessID(); * * @returns Business ID *

* Eg: CST-1 */ getBusinessID(): string; getAssignments(): any; getChildAssignments(): any; isCaseWideLocalAction: () => boolean; getAllAssignments(): any; getActiveCaseActionName(): any; getFirstCaseActionName(): any; hasAssignments(): boolean; hasMessages: () => boolean; hasGetNextWorkLinks(): boolean; } export default CaseInfo;