From 1383e28c0482ba0d0e1fdabeaede6f600a345d78 Mon Sep 17 00:00:00 2001 From: Dallin Sevy Date: Tue, 28 Apr 2026 13:50:31 -0600 Subject: [PATCH] feat: Add config-manager pull iga-workflows command --- .../config-manager-pull-iga-workflows.ts | 55 + .../config-manager-pull.ts | 2 + src/cli/config/config-export.ts | 2 + src/cli/config/config-import.ts | 3 + .../FrConfigIgaWorkflowsOps.ts | 70 + src/ops/ConfigOps.ts | 5 + src/utils/Config.ts | 1 + ...-manager-export-iga-workflows.test.js.snap | 29 + ...onfig-manager-export-iga-workflows.test.js | 10 + ...ager-export-iga-workflows.e2e.test.js.snap | 33409 ++++++++++++++++ ...g-manager-export-iga-workflows.e2e.test.js | 78 + .../am_1076162899/recording.har | 312 + .../environment_1072573434/recording.har | 125 + .../iga_2664973160/recording.har | 147 + .../oauth2_393036114/recording.har | 146 + .../openidm_3290118515/recording.har | 310 + .../am_1076162899/recording.har | 312 + .../environment_1072573434/recording.har | 125 + .../iga_2664973160/recording.har | 147 + .../oauth2_393036114/recording.har | 146 + .../openidm_3290118515/recording.har | 310 + .../am_1076162899/recording.har | 312 + .../environment_1072573434/recording.har | 125 + .../iga_2664973160/recording.har | 147 + .../oauth2_393036114/recording.har | 146 + .../openidm_3290118515/recording.har | 310 + test/e2e/utils/TestConfig.js | 11 + 27 files changed, 36795 insertions(+) create mode 100644 src/cli/config-manager/config-manager-pull/config-manager-pull-iga-workflows.ts create mode 100644 src/configManagerOps/FrConfigIgaWorkflowsOps.ts create mode 100644 test/client_cli/en/__snapshots__/config-manager-export-iga-workflows.test.js.snap create mode 100644 test/client_cli/en/config-manager-export-iga-workflows.test.js create mode 100644 test/e2e/__snapshots__/config-manager-export-iga-workflows.e2e.test.js.snap create mode 100644 test/e2e/config-manager-export-iga-workflows.e2e.test.js create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/am_1076162899/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/environment_1072573434/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/iga_2664973160/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/oauth2_393036114/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/openidm_3290118515/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/am_1076162899/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/environment_1072573434/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/iga_2664973160/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/oauth2_393036114/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/openidm_3290118515/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/am_1076162899/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/environment_1072573434/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/iga_2664973160/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/oauth2_393036114/recording.har create mode 100644 test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/openidm_3290118515/recording.har diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull-iga-workflows.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull-iga-workflows.ts new file mode 100644 index 000000000..7d13ce33d --- /dev/null +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull-iga-workflows.ts @@ -0,0 +1,55 @@ +import { frodo } from '@rockcarver/frodo-lib'; +import { Option } from 'commander'; + +import { configManagerExportIgaWorkflows } from '../../../configManagerOps/FrConfigIgaWorkflowsOps'; +import { getTokens } from '../../../ops/AuthenticateOps'; +import { verboseMessage } from '../../../utils/Console'; +import { FrodoCommand } from '../../FrodoCommand'; + +const { CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY } = + frodo.utils.constants; +const deploymentTypes = [ + CLOUD_DEPLOYMENT_TYPE_KEY, + FORGEOPS_DEPLOYMENT_TYPE_KEY, +]; + +export default function setup() { + const program = new FrodoCommand( + 'frodo config-manager pull iga-workflows', + [], + deploymentTypes + ); + program + .description('Export iga-workflows.') + .addOption( + new Option( + '-n, --name ', + 'Workflow name. Only export the workflow with this name.' + ) + ) + .addOption( + new Option('-i, --include-immutable ', 'Include immutable IGA workflows.') + ) + .action(async (host, realm, user, password, options, command) => { + command.handleDefaultArgsAndOpts( + host, + realm, + user, + password, + options, + command + ); + if (options.realm) { + realm = options.realm; + } + if (await getTokens(false, true, deploymentTypes)) { + verboseMessage('Exporting config entity iga-workflows'); + const outcome = await configManagerExportIgaWorkflows( + options.name, + options.includeImmutable + ); + if (!outcome) process.exitCode = 1; + } + }); + return program; +} diff --git a/src/cli/config-manager/config-manager-pull/config-manager-pull.ts b/src/cli/config-manager/config-manager-pull/config-manager-pull.ts index fb9327378..cc5701a31 100644 --- a/src/cli/config-manager/config-manager-pull/config-manager-pull.ts +++ b/src/cli/config-manager/config-manager-pull/config-manager-pull.ts @@ -14,6 +14,7 @@ import CustomNodes from './config-manager-pull-custom-nodes'; import EmailProvider from './config-manager-pull-email-provider'; import EmailTemplates from './config-manager-pull-email-templates'; import Endpoints from './config-manager-pull-endpoints'; +import IgaWorkflows from './config-manager-pull-iga-workflows'; import InternalRoles from './config-manager-pull-internal-roles'; import Journeys from './config-manager-pull-journeys'; import Kba from './config-manager-pull-kba'; @@ -79,6 +80,7 @@ export default function setup() { program.addCommand(Test().name('test')); program.addCommand(UiConfig().name('ui-config')); program.addCommand(Variables().name('variables')); + program.addCommand(IgaWorkflows().name('iga-workflows')); return program; } diff --git a/src/cli/config/config-export.ts b/src/cli/config/config-export.ts index f3ab91426..2831da927 100644 --- a/src/cli/config/config-export.ts +++ b/src/cli/config/config-export.ts @@ -170,6 +170,7 @@ export default function setup() { includeReadOnly: options.readOnly, onlyRealm: options.realmOnly, onlyGlobal: options.globalOnly, + includeNonCustom: false, } ); if (!outcome) process.exitCode = 1; @@ -202,6 +203,7 @@ export default function setup() { includeReadOnly: options.readOnly, onlyRealm: options.realmOnly, onlyGlobal: options.globalOnly, + includeNonCustom: false, } ); if (!outcome) process.exitCode = 1; diff --git a/src/cli/config/config-import.ts b/src/cli/config/config-import.ts index a999b50c3..5615b55f4 100644 --- a/src/cli/config/config-import.ts +++ b/src/cli/config/config-import.ts @@ -129,6 +129,7 @@ export default function setup() { includeDefault: options.default, includeActiveValues: options.includeActiveValues, source: options.source, + includeNonCustom: false, }); if (!outcome) process.exitCode = 1; } @@ -152,6 +153,7 @@ export default function setup() { includeDefault: options.default, includeActiveValues: options.includeActiveValues, source: options.source, + includeNonCustom: false, }); if (!outcome) process.exitCode = 1; } @@ -169,6 +171,7 @@ export default function setup() { includeDefault: options.default, includeActiveValues: options.includeActiveValues, source: options.source, + includeNonCustom: false, } ); if (!outcome) process.exitCode = 1; diff --git a/src/configManagerOps/FrConfigIgaWorkflowsOps.ts b/src/configManagerOps/FrConfigIgaWorkflowsOps.ts new file mode 100644 index 000000000..47ca4d3ad --- /dev/null +++ b/src/configManagerOps/FrConfigIgaWorkflowsOps.ts @@ -0,0 +1,70 @@ +import { frodo } from '@rockcarver/frodo-lib'; + +import { extractFrConfigDataToFile } from '../utils/Config'; +import { printError } from '../utils/Console'; +import { safeFileName } from '../utils/FrConfig'; + +const { saveJsonToFile, getFilePath } = frodo.utils; +const { readWorkflows } = frodo.cloud.iga.workflow; + +/** + * Export IGA workflows in fr-config-manager format. + * @param {string} name optional workflow name to filter by + * @param {boolean} includeImmutable if true, also export immutable workflows + * @returns {Promise} a promise that resolves to true if successful, false otherwise + */ +export async function configManagerExportIgaWorkflows( + name?: string, + includeImmutable: boolean = false +): Promise { + try { + let workflows = await readWorkflows(); + if (name) { + workflows = workflows.filter((workflow) => workflow.name === name); + } + if (!includeImmutable) { + workflows = workflows.filter((workflow) => workflow.mutable); + } + workflows.forEach((workflow) => { + processIgaWorkflow(workflow, 'iga/workflows'); + }); + return true; + } catch (error) { + printError(error, 'Error exporting iga-workflows to files'); + } + return false; +} + +async function processIgaWorkflow(workflow, fileDir) { + try { + const workflowName = safeFileName(workflow.name); + const workflowPath = `${fileDir}/${workflowName}`; + if (Array.isArray(workflow.steps)) { + const stepsPath = `${workflowPath}/steps`; + workflow.steps.forEach((step) => { + const uniqueId = safeFileName(`${step.displayName} - ${step.name}`); + const stepPath = `${stepsPath}/${uniqueId}`; + const stepBody = step[step.type]; + if ( + stepBody && + typeof stepBody === 'object' && + typeof stepBody.script === 'string' && + stepBody.script.length > 0 + ) { + const scriptFilename = `${uniqueId}.js`; + extractFrConfigDataToFile(stepBody.script, scriptFilename, stepPath); + stepBody.script = { + file: scriptFilename, + }; + } + const stepFileName = `${stepPath}/${uniqueId}.json`; + saveJsonToFile(step, getFilePath(stepFileName, true), false, true); + }); + delete workflow.steps; + } + const fileName = `${workflowPath}/${workflowName}.json`; + saveJsonToFile(workflow, getFilePath(fileName, true), false, true); + } catch (err) { + printError(err); + } +} diff --git a/src/ops/ConfigOps.ts b/src/ops/ConfigOps.ts index 9aae603dd..f09a6ee7c 100644 --- a/src/ops/ConfigOps.ts +++ b/src/ops/ConfigOps.ts @@ -57,6 +57,7 @@ export async function exportEverythingToFile( includeReadOnly: false, onlyRealm: false, onlyGlobal: false, + includeNonCustom: false, } ): Promise { try { @@ -105,6 +106,7 @@ export async function exportEverythingToFiles( includeReadOnly: false, onlyRealm: false, onlyGlobal: false, + includeNonCustom: false, } ): Promise { try { @@ -382,6 +384,7 @@ export async function importEverythingFromFile( includeDefault: false, includeActiveValues: false, source: '', + includeNonCustom: false, } ): Promise { try { @@ -408,6 +411,7 @@ export async function importEverythingFromFiles( includeDefault: false, includeActiveValues: false, source: '', + includeNonCustom: false, } ): Promise { try { @@ -431,6 +435,7 @@ export async function importEntityfromFile( includeDefault: false, includeActiveValues: false, source: '', + includeNonCustom: false, } ): Promise { try { diff --git a/src/utils/Config.ts b/src/utils/Config.ts index 030d9c893..74041abe1 100644 --- a/src/utils/Config.ts +++ b/src/utils/Config.ts @@ -96,6 +96,7 @@ export async function getFullExportConfig( includeReadOnly: true, onlyRealm: false, onlyGlobal: false, + includeNonCustom: false, }, errorHandler ); diff --git a/test/client_cli/en/__snapshots__/config-manager-export-iga-workflows.test.js.snap b/test/client_cli/en/__snapshots__/config-manager-export-iga-workflows.test.js.snap new file mode 100644 index 000000000..91823649a --- /dev/null +++ b/test/client_cli/en/__snapshots__/config-manager-export-iga-workflows.test.js.snap @@ -0,0 +1,29 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CLI help interface for 'config export' should be expected english 1`] = ` +"Usage: frodo config-manager pull iga-workflows [options] [host] [realm] [username] [password] + +[Experimental] Export iga-workflows. + +Arguments: + host AM base URL, e.g.: https://cdk.iam.example.com/am. + To use a connection profile, just specify a unique + substring or alias. + realm Realm. Specify realm as '/' for the root realm or + 'realm' or '/parent/child' otherwise. (default: + "alpha" for Identity Cloud tenants, "/" otherwise.) + username Username to login with. Must be an admin user with + appropriate rights to manage authentication + journeys/trees. + password Password. + +Options: + -i, --include-immutable Include immutable IGA workflows. + -n, --name Workflow name. Only export the workflow with this + name. + -h, --help Help + -hh, --help-more Help with all options. + -hhh, --help-all Help with all options, environment variables, and + usage examples. +" +`; diff --git a/test/client_cli/en/config-manager-export-iga-workflows.test.js b/test/client_cli/en/config-manager-export-iga-workflows.test.js new file mode 100644 index 000000000..958a4ec36 --- /dev/null +++ b/test/client_cli/en/config-manager-export-iga-workflows.test.js @@ -0,0 +1,10 @@ +import cp from 'child_process'; +import { promisify } from 'util'; + +const exec = promisify(cp.exec); +const CMD = 'frodo config-manager pull iga-workflows --help'; +const { stdout } = await exec(CMD); + +test("CLI help interface for 'config export' should be expected english", async () => { + expect(stdout).toMatchSnapshot(); +}); diff --git a/test/e2e/__snapshots__/config-manager-export-iga-workflows.e2e.test.js.snap b/test/e2e/__snapshots__/config-manager-export-iga-workflows.e2e.test.js.snap new file mode 100644 index 000000000..677a0a154 --- /dev/null +++ b/test/e2e/__snapshots__/config-manager-export-iga-workflows.e2e.test.js.snap @@ -0,0 +1,33409 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style" 1`] = `0`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style" 2`] = `""`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style" 3`] = ` +"Experimental feature in use: 'frodo config-manager pull iga-workflows'. This feature may change without notice. +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicApplicationGrant-copy/BasicApplicationGrant-copy.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "BasicApplicationGrant-copy", + "displayName": "BasicApplicationGrant-copy", + "id": "basicApplicationGrantCopy", + "mutable": true, + "name": "BasicApplicationGrant-copy", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 942, + "y": 82, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 683, + "y": 154, + }, + "exclusiveGateway-621c9996676a": { + "x": 454, + "y": 88.015625, + }, + "scriptTask-4e9121fe850a": { + "x": 168, + "y": 140.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicApplicationGrant-copy/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": null, + }, + { + "condition": null, + "outcome": "REJECT", + "step": null, + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicApplicationGrant-copy/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicApplicationGrant-copy/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-621c9996676a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "approvalTask-74cf85c35437", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-621c9996676a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicApplicationGrant-copy/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"try { +var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +} catch (e) { + logger.error(e.message) +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicApplicationGrant-copy/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-621c9996676a", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/BasicEntitlementGrant-copy.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "BasicEntitlementGrant-copy", + "displayName": "BasicEntitlementGrant-copy", + "id": "basicEntitlementGrantCopy", + "mutable": true, + "name": "BasicEntitlementGrant-copy", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2597, + "y": 322, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-48e748c42994": { + "x": 1731, + "y": 88.015625, + }, + "exclusiveGateway-67a954f33919": { + "x": 467, + "y": 121.015625, + }, + "exclusiveGateway-89dc2f9576ee": { + "x": 452, + "y": 488.015625, + }, + "exclusiveGateway-ad04bf17ac62": { + "x": 336, + "y": 306.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 948, + "y": 57.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2255, + "y": 48.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1972, + "y": 119.015625, + }, + "scriptTask-0b56191887de": { + "x": 1979, + "y": 212.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1434, + "y": 95.015625, + }, + "scriptTask-55aced130632": { + "x": 686, + "y": 351.015625, + }, + "scriptTask-91769554db51": { + "x": 2561, + "y": 74.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1441, + "y": 268.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 185, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 716, + "y": 73.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1208, + "y": 30.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Context Gateway - exclusiveGateway-89dc2f9576ee/Custom Context Gateway - exclusiveGateway-89dc2f9576ee.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Context Gateway - exclusiveGateway-89dc2f9576ee/Custom Context Gateway - exclusiveGateway-89dc2f9576ee.json 1`] = ` +{ + "displayName": "Custom Context Gateway", + "name": "exclusiveGateway-89dc2f9576ee", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-55aced130632", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Custom Context Gateway - exclusiveGateway-89dc2f9576ee.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Request Approved - scriptTask-55aced130632/Custom Request Approved - scriptTask-55aced130632.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request type custom auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Request Approved - scriptTask-55aced130632/Custom Request Approved - scriptTask-55aced130632.json 1`] = ` +{ + "displayName": "Custom Request Approved", + "name": "scriptTask-55aced130632", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Custom Request Approved - scriptTask-55aced130632.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + failureReason = "Request Object" + requestObj + ":"; + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason += " Validation failed: Error reading request with id " + requestId + "More detail is content:" + content; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* + * Script Node: Context & Type Check + * Purpose: Reads request context and entitlement type to set routing outcomes. + * Sets: context, skipApproval, entitlementType, entitlementId, userId, failureReason + */ + +logger.info("BasicEntitlementGrant (Custom) - Context & Type Check"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +var entitlementType = null; +var entitlementId = null; +var userId = null; +var failureReason = null; + + // Read request object +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + // --- Context check (admin requests skip approval) --- + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } + // --- User --- + userId = requestObj.request.common.userId; + + // --- Entitlement type routing --- + // The entitlement object on the request exposes a 'type' field. + // Internal/system roles exposed as entitlements should carry type: 'custom'. + if (requestObj.entitlement && requestObj.entitlement.type) { + entitlementType = requestObj.entitlement.type; + entitlementId = requestObj.entitlement.id; + } else { + // Fallback: treat as standard if type is absent + entitlementType = 'standard'; + } + +} catch (e) { + failureReason = 'Context & Type Check failed: ' + e.message; + logger.error(failureReason); +} + +logger.info("Context: " + context + " | EntitlementType: " + entitlementType + " | UserId: " + userId); + +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +execution.setVariable("entitlementType", entitlementType); +execution.setVariable("entitlementId", entitlementId); +execution.setVariable("userId", userId); +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-ad04bf17ac62", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Type Gateway - exclusiveGateway-ad04bf17ac62/Type Gateway - exclusiveGateway-ad04bf17ac62.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Type Gateway - exclusiveGateway-ad04bf17ac62/Type Gateway - exclusiveGateway-ad04bf17ac62.json 1`] = ` +{ + "displayName": "Type Gateway", + "name": "exclusiveGateway-ad04bf17ac62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "entitlementType != 'custom'", + "outcome": "validationSuccess", + "step": "exclusiveGateway-67a954f33919", + }, + { + "condition": "entitlementType == 'custom'", + "outcome": "validationFailure", + "step": "exclusiveGateway-89dc2f9576ee", + }, + ], + "script": { + "file": "Type Gateway - exclusiveGateway-ad04bf17ac62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/BasicEntitlementGrant-copy/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/CreateNonEmployee.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "CreateNonEmployee", + "displayName": "CreateNonEmployee", + "id": "createNonEmployee", + "mutable": true, + "name": "CreateNonEmployee", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1694, + "y": 154, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "script", + "expirationDate": 1, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 716, + "y": 169, + }, + "exclusiveGateway-abbb089758c8": { + "x": 433, + "y": 89.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 986, + "y": 48.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 988, + "y": 222.015625, + }, + "scriptTask-ca9504ae90d8": { + "x": 136, + "y": 112.015625, + }, + "scriptTask-e8842de66fbb": { + "x": 718, + "y": 43.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(1*24*60*60*1000))).toISOString()", + }, + "frequency": 1, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.js 1`] = ` +"logger.info("Create User - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to requester having create user privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.json 1`] = ` +{ + "displayName": "Auto-Approval", + "name": "scriptTask-e8842de66fbb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Auto-Approval - scriptTask-e8842de66fbb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-abbb089758c8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-e8842de66fbb", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-abbb089758c8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Create User - scriptTask-0359a9d77ee2/Create User - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Creating User"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +} +catch (e) { + failureReason = "Creating User: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var payload = requestObj.request.user.object; + + var comment = {'comment': JSON.stringify(payload)}; + openidm.action('iga/governance/requests/' + requestId, 'POST', comment, queryParams); + } + catch (e) { + failureReason = "Creating user failed: Error during creation of user " + payload.userName + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Create User - scriptTask-0359a9d77ee2/Create User - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Create User", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create User - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// create a user. If so, it will skip any approval process and directly move to create the new user. + +logger.info("Create User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a normal managed user, check that the user has permissions to create a user + var userId = requester.id.split('/'); + var user = openidm.action('iga/governance/user', 'GET', {}, {'endUserId': userId[2], 'scopePermission': 'createUser', '_queryFilter': \`id+eq+'\` + userId[2] + \`'\`}) + if(user.result.length > 0){ + skipApproval = true; + } + } + else{ + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-abbb089758c8", + }, + ], + "script": { + "file": "Permission Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Create User - rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateNonEmployee/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateUser - JH/CreateUser - JH.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "CreateUser - JH", + "displayName": "CreateUser - JH", + "id": "createUserJh", + "mutable": true, + "name": "CreateUser - JH", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1694, + "y": 154, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "scriptTask-ca9504ae90d8": { + "x": 136, + "y": 112.015625, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateUser - JH/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// create a user. If so, it will skip any approval process and directly move to create the new user. + +logger.info("Create User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + var comment = { 'comment': JSON.stringify(requestObj) } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/CreateUser - JH/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Permission Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/custom-1-BasicEntitlementGrant.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "custom-1-BasicEntitlementGrant", + "displayName": "custom-1-BasicEntitlementGrant", + "id": "custom1BasicEntitlementGrant", + "mutable": true, + "name": "custom-1-BasicEntitlementGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2597, + "y": 322, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-48e748c42994": { + "x": 1731, + "y": 88.015625, + }, + "exclusiveGateway-67a954f33919": { + "x": 467, + "y": 121.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 948, + "y": 57.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2255, + "y": 48.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1972, + "y": 119.015625, + }, + "scriptTask-0b56191887de": { + "x": 1979, + "y": 212.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1434, + "y": 95.015625, + }, + "scriptTask-91769554db51": { + "x": 2561, + "y": 74.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1441, + "y": 268.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 186, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 716, + "y": 74.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1208, + "y": 30.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Provisioning - scriptTask-0359a9d77ee2/Custom Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var authzRoleId = content.get('authzRoleId'); + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + + + // --- Conditional authzRoles patch for custom/internal role entitlements --- + if (entitlementType === 'custom' && accountAttribute === 'authzRoles') { + try { + openidm.patch( + 'managed/alpha_user/' + request.common.userId, + null, + [{ + "operation": "add", + "field": "/authzRoles/-", + "value": { "_ref": "internal/role/" + authzRoleId } + }] + ); + logger.info("custom-BasicEntitlementGrant - authzRoles patch successful" + + " | userId: " + request.common.userId + + " | entitlementId: " + authzRoleId); + } catch (e) { + failureReason = "Provisioning succeeded but authzRoles patch failed" + + " for user " + request.common.userId + + " and entitlement " + authzRoleId + + ". Error: " + e.message; + logger.error(failureReason); + } + } + + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Provisioning - scriptTask-0359a9d77ee2/Custom Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Custom Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Custom Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Approved - scriptTask-e21178ab80f7/Custom Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +var entitlementType = content.get('entitlementType'); + +try { + var decision = { + "decision": "approved", + } + if(skipApproval && entitlementType == 'custom'){ + decision.comment = "Custom request auto-approved due to request context: " + context; + } + else if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Approved - scriptTask-e21178ab80f7/Custom Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Custom Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Custom Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Context Check - scriptTask-e04f42607ba5/Custom Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* + * Script Node: Context & Type Check + * Purpose: Reads request context and entitlement type to set routing outcomes. + * Sets: context, waits, skipApproval, entitlementType, entitlementId, userId, failureReason, accountAttribute, authzRoleId + */ + +logger.info("custom-BasicEntitlementGrant - Context & Type Check"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +var entitlementType = null; +var entitlementId = null; +var userId = null; +var failureReason = null; +var accountAttribute = null; +var authzRoleId = null; + +// Read request object +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + // --- Context check --- + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + + // --- Wait flags --- + if (requestObj.request.common.startDate) { + enableWait = true; + } + if (requestObj.request.common.endDate) { + enableEndWait = true; + } + + // --- User --- + userId = requestObj.request.common.userId; + + // --- Entitlement ID --- + entitlementId = requestObj.request.common.entitlementId; + + // Entitlement type + if (entitlementId) { + try { + var entitlementObj = openidm.action('iga/governance/entitlement/' + entitlementId, 'GET', {}, {}); + if (entitlementObj + && entitlementObj.glossary + && entitlementObj.glossary.idx + && entitlementObj.glossary.idx['/entitlement'] + && entitlementObj.glossary.idx['/entitlement'].entitlementType) { + + entitlementType = entitlementObj.glossary.idx['/entitlement'].entitlementType; + + } else { + entitlementType = 'standard'; + } + + // --- authzRoleId --- + if (entitlementObj + && entitlementObj.entitlement + && entitlementObj.entitlement._id) { + + authzRoleId = entitlementObj.entitlement._id; + + } + + // --- accountAttribute --- + accountAttribute = (entitlementObj + && entitlementObj.item + && entitlementObj.item.accountAttribute) + ? entitlementObj.item.accountAttribute + : null; + } catch (e) { + logger.warn("Entitlement lookup error: " + e.message); + + entitlementType = 'standard'; + } + } else { + entitlementType = 'standard'; + } + + // --- Log comment to request audit trail --- + try { + var logComment = "Context & Type Check" + + " | userId: " + userId + + " | context: " + context + + " | entitlementId: " + entitlementId + + " | entitlementType: " + entitlementType + + " | skipApproval: " + skipApproval + + " | authzRoleId: " + authzRoleId; + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } + +} catch (e) { + failureReason = 'Context & Type Check failed: ' + e.message; + logger.error(failureReason); +} + +logger.info("Context: " + context + " | EntitlementType: " + entitlementType + " | UserId: " + userId); + +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +execution.setVariable("entitlementType", entitlementType); +execution.setVariable("entitlementId", entitlementId); +execution.setVariable("userId", userId); +execution.setVariable("failureReason", failureReason); +execution.setVariable("accountAttribute", accountAttribute); +execution.setVariable("authzRoleId", authzRoleId); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Context Check - scriptTask-e04f42607ba5/Custom Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Custom Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Custom Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-1-BasicEntitlementGrant/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/custom-BasicEntitlementGrant.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "custom-BasicEntitlementGrant", + "displayName": "custom-BasicEntitlementGrant", + "id": "customBasicEntitlementGrant", + "mutable": true, + "name": "custom-BasicEntitlementGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2873, + "y": 976, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 184, + "y": 470, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 998, + "y": 810, + }, + "exclusiveGateway-26e6b56a6d6b": { + "x": 736, + "y": 231.03125, + }, + "exclusiveGateway-48e748c42994": { + "x": 2007, + "y": 742.015625, + }, + "exclusiveGateway-526a06894733": { + "x": 571, + "y": 458, + }, + "exclusiveGateway-67a954f33919": { + "x": 743, + "y": 775.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 1224, + "y": 711.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2531, + "y": 702.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 2248, + "y": 773.015625, + }, + "scriptTask-0b56191887de": { + "x": 2255, + "y": 866.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1710, + "y": 749.015625, + }, + "scriptTask-6dc428f459a8": { + "x": 1026, + "y": 152.515625, + }, + "scriptTask-91769554db51": { + "x": 2837, + "y": 728.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1717, + "y": 922.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 300, + "y": 472.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 992, + "y": 728.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1484, + "y": 684.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Auto Approval - scriptTask-6dc428f459a8/Custom Auto Approval - scriptTask-6dc428f459a8.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request type custom auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Auto Approval - scriptTask-6dc428f459a8/Custom Auto Approval - scriptTask-6dc428f459a8.json 1`] = ` +{ + "displayName": "Custom Auto Approval", + "name": "scriptTask-6dc428f459a8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Custom Auto Approval - scriptTask-6dc428f459a8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b.json 1`] = ` +{ + "displayName": "Custom Context Gateway", + "name": "exclusiveGateway-26e6b56a6d6b", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-6dc428f459a8", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Custom Context Gateway - exclusiveGateway-26e6b56a6d6b.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* + * Script Node: Context & Type Check + * Purpose: Reads request context and entitlement type to set routing outcomes. + * Sets: context, waits, skipApproval, entitlementType, entitlementId, userId, failureReason, accountAttribute + */ + +logger.info("custom-BasicEntitlementGrant - Context & Type Check"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +var entitlementType = null; +var entitlementId = null; +var userId = null; +var failureReason = null; +var accountAttribute = null; + +// Read request object +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + // Context check (admin requests skip approval) + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + + // Optional Waits + if (requestObj.request.common.startDate) { + enableWait = true; + } + if (requestObj.request.common.endDate) { + enableEndWait = true; + } + + // User + userId = requestObj.request.common.userId; + + // Entitlement ID + entitlementId = requestObj.request.common.entitlementId; + + // Entitlement type + if (entitlementId) { + try { + var entitlementObj = openidm.action('iga/governance/entitlement/' + entitlementId, 'GET', {}, {}); + if (entitlementObj + && entitlementObj.glossary + && entitlementObj.glossary.idx + && entitlementObj.glossary.idx['/entitlement'] + && entitlementObj.glossary.idx['/entitlement'].entitlementType) { + + entitlementType = entitlementObj.glossary.idx['/entitlement'].entitlementType; + + } else { + entitlementType = 'standard'; + } + + // accountAttribute for provisioning node + accountAttribute = (entitlementObj + && entitlementObj.item + && entitlementObj.item.accountAttribute) + ? entitlementObj.item.accountAttribute + : null; + } catch (e) { + logger.warn("Entitlement lookup error: " + e.message); + + entitlementType = 'standard'; + } + } else { + entitlementType = 'standard'; + } + + +} catch (e) { + failureReason = 'Context & Type Check failed: ' + e.message; + logger.error(failureReason); +} + +logger.info("Context: " + context + " | EntitlementType: " + entitlementType + " | UserId: " + userId + " | AuthzRoleId: " + authzRoleId); + +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +execution.setVariable("entitlementType", entitlementType); +execution.setVariable("entitlementId", entitlementId); +execution.setVariable("userId", userId); +execution.setVariable("failureReason", failureReason); +execution.setVariable("accountAttribute", accountAttribute); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-526a06894733", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-526a06894733/Validation Gateway - exclusiveGateway-526a06894733.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-526a06894733/Validation Gateway - exclusiveGateway-526a06894733.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-526a06894733", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "entitlementType == 'custom'", + "outcome": "validationSuccess", + "step": "exclusiveGateway-26e6b56a6d6b", + }, + { + "condition": "entitlementType != 'custom'", + "outcome": "validationFailure", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-526a06894733.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/custom-BasicEntitlementGrant/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/jh-ne-create-test-2.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "jh-ne-create-test-2", + "displayName": "jh-ne-create-test-2", + "id": "jhNeCreateTest2", + "mutable": true, + "name": "jh-ne-create-test-2", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1463, + "y": 262, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-2131bbe3663d", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "approvalTask-6649e6d6f2a3": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 606.3999938964844, + "y": 431.6125030517578, + }, + "emailTask-731854fb34db": { + "x": 1119.3999938964844, + "y": 107.61250305175781, + }, + "exclusiveGateway-69f93dd39054": { + "x": 394.3999938964844, + "y": 252.6125030517578, + }, + "scriptTask-2131bbe3663d": { + "x": 156.39999389648438, + "y": 252.6125030517578, + }, + "scriptTask-c174d2210667": { + "x": 814.3999938964844, + "y": 43.61250305175781, + }, + "scriptTask-f2a2d7eee947": { + "x": 821.3999938964844, + "y": 298.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/%22Create%22 User - scriptTask-f2a2d7eee947/%22Create%22 User - scriptTask-f2a2d7eee947.js 1`] = ` +"logger.info("Creating User"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var request = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + request = requestObj.request; + + + + // var payload = { + // "userName": request.custom.userName, + // "givenName": request.custom.givenName, + // "sn": request.custom.sn, + // "mail": request.custom.mail, + // "password": 'DemoP@ssword1' + // }; + + /** Create new user **/ + // var result = openidm.create('managed/alpha_user', null, payload, queryParams); + + // /** Send new user email **/ + // var body = { + // subject: "Welcome " + payload.givenName + " " + payload.sn + "!", + // to: payload.mail, + // body: "Your new user has been created in the system.\\n\\nUsername: " + payload.userName + "\\nPassword: " + payload.password + "\\n\\nLogin to your account here: https://openam-gov-dev-4.forgeblocks.com/am/XUI/?realm=/alpha#/", + // object: {} + // }; + // openidm.action("external/email", "send", body); + } + catch (e) { + failureReason = "Creating user failed: Error during creation of user " + request.custom.userName + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved', "comment": JSON.stringify(request)}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/%22Create%22 User - scriptTask-f2a2d7eee947/%22Create%22 User - scriptTask-f2a2d7eee947.json 1`] = ` +{ + "displayName": ""Create" User", + "name": "scriptTask-f2a2d7eee947", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-731854fb34db", + }, + ], + "script": { + "file": "%22Create%22 User - scriptTask-f2a2d7eee947.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Account Creation Email - emailTask-731854fb34db/Account Creation Email - emailTask-731854fb34db.json 1`] = ` +{ + "displayName": "Account Creation Email", + "emailTask": { + "bcc": "", + "cc": "", + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": null, + }, + { + "condition": null, + "outcome": "FAILED", + "step": null, + }, + ], + "object": { + "cn": "9959348", + "custom_DisplayName": "Jack Hatton", + "custom_LocationName": "remote", + "custom_siteLocation": "remote", + "manager": "test", + }, + "templateName": "staffNe1AccountCreation", + "to": "jhatton@trivir.com", + }, + "name": "emailTask-731854fb34db", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Approval Task - approvalTask-6649e6d6f2a3/Approval Task - approvalTask-6649e6d6f2a3.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-f2a2d7eee947", + }, + { + "condition": null, + "outcome": "REJECT", + "step": null, + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-6649e6d6f2a3", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Auto Approve Gateway - exclusiveGateway-69f93dd39054/Auto Approve Gateway - exclusiveGateway-69f93dd39054.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Auto Approve Gateway - exclusiveGateway-69f93dd39054/Auto Approve Gateway - exclusiveGateway-69f93dd39054.json 1`] = ` +{ + "displayName": "Auto Approve Gateway", + "name": "exclusiveGateway-69f93dd39054", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-c174d2210667", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-6649e6d6f2a3", + }, + ], + "script": { + "file": "Auto Approve Gateway - exclusiveGateway-69f93dd39054.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Mark Approved - scriptTask-c174d2210667/Mark Approved - scriptTask-c174d2210667.js 1`] = ` +"logger.info("Create User - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { "_action": "update" } + +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to requester having create user privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Mark Approved - scriptTask-c174d2210667/Mark Approved - scriptTask-c174d2210667.json 1`] = ` +{ + "displayName": "Mark Approved", + "name": "scriptTask-c174d2210667", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-731854fb34db", + }, + ], + "script": { + "file": "Mark Approved - scriptTask-c174d2210667.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Permissions Check - scriptTask-2131bbe3663d/Permissions Check - scriptTask-2131bbe3663d.js 1`] = ` +"logger.info("Create User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a normal managed user, check that the user has permissions to create a user + var userId = requester.id.split('/'); + var user = openidm.action('iga/governance/user', 'GET', {}, {'endUserId': userId[2], 'scopePermission': 'createUser', '_queryFilter': \`id+eq+'\` + userId[2] + \`'\`}) + if(user.result.length > 0){ + skipApproval = true; + } + } + else{ + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/jh-ne-create-test-2/steps/Permissions Check - scriptTask-2131bbe3663d/Permissions Check - scriptTask-2131bbe3663d.json 1`] = ` +{ + "displayName": "Permissions Check", + "name": "scriptTask-2131bbe3663d", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-69f93dd39054", + }, + ], + "script": { + "file": "Permissions Check - scriptTask-2131bbe3663d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/pgh-generate-rap.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "pgh-generate-rap", + "displayName": "pgh-generate-rap", + "id": "pghGenerateRap", + "mutable": true, + "name": "pgh-generate-rap", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1156, + "y": 151, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-115d1ab72679", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 70, + "y": 151, + }, + "uiConfig": { + "exclusiveGateway-2d4351f5c77b": { + "x": 451, + "y": 126.5, + }, + "fulfillmentTask-f49f20d19149": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDateType": "duration", + "expirationDateVariable": "", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 683, + "y": 126.5, + }, + "scriptTask-115d1ab72679": { + "x": 208, + "y": 158, + }, + "scriptTask-5a2b73dd9dd2": { + "x": 916, + "y": 80, + }, + "scriptTask-6f260211dc0f": { + "x": 916, + "y": 226, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Auto Approve - scriptTask-5a2b73dd9dd2/Auto Approve - scriptTask-5a2b73dd9dd2.js 1`] = ` +"function updateRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "update" }); +} + +function modifyRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "modify", phaseName: execution.getVariables().get('phaseName') }); +} + +function commentRequest(message, isFail) { + return updateRequest({ comment: message, failure: isFail }); +} + +function approveRequest() { + updateRequest({ + outcome: 'fulfilled', + status: 'complete', + decision: 'approved' + }); +} + +function main() { + try { + modifyRequest({ + common: { + isDraft: false, + context: { + type: "request" + } + }, + custom: { + idPath: execution.getVariables().get('idPath'), + rap: "" + } + }); + approveRequest(); + } catch (e) { + commentRequest("Failure auto-approving RAP request. Error message: " + e.message, true); + } +} + +main(); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Auto Approve - scriptTask-5a2b73dd9dd2/Auto Approve - scriptTask-5a2b73dd9dd2.json 1`] = ` +{ + "displayName": "Auto Approve", + "name": "scriptTask-5a2b73dd9dd2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto Approve - scriptTask-5a2b73dd9dd2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Auto Reject - scriptTask-6f260211dc0f/Auto Reject - scriptTask-6f260211dc0f.js 1`] = ` +"function updateRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "update" }); +} + +function modifyRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "modify", phaseName: execution.getVariables().get('phaseName') }); +} + +function commentRequest(message, isFail) { + return updateRequest({ comment: message, failure: isFail }); +} + +function rejectRequest() { + updateRequest({ + outcome: 'cancelled', + status: 'complete', + decision: 'rejected' + }); +} + +function main() { + try { + modifyRequest({ + common: { + isDraft: false, + context: { + type: "request" + } + }, + custom: { + idPath: execution.getVariables().get('idPath'), + rap: "" + } + }); + rejectRequest(); + } catch (e) { + commentRequest("Failure auto-rejecting RAP request. Error message: " + e.message, true); + } +} + +main(); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Auto Reject - scriptTask-6f260211dc0f/Auto Reject - scriptTask-6f260211dc0f.json 1`] = ` +{ + "displayName": "Auto Reject", + "name": "scriptTask-6f260211dc0f", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto Reject - scriptTask-6f260211dc0f.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Confirm RAP - fulfillmentTask-f49f20d19149/Confirm RAP - fulfillmentTask-f49f20d19149.json 1`] = ` +{ + "displayName": "Confirm RAP", + "fulfillmentTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "approvalMode": "any", + "events": {}, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "scriptTask-5a2b73dd9dd2", + }, + { + "condition": null, + "outcome": "DENY", + "step": "scriptTask-6f260211dc0f", + }, + ], + }, + "name": "fulfillmentTask-f49f20d19149", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Generate RAP - scriptTask-115d1ab72679/Generate RAP - scriptTask-115d1ab72679.js 1`] = ` +"function getPublishedWorkflow(workflowId) { + return openidm.action(\`iga/governance/workflow/\${workflowId}/published\`, 'GET', {}, {}); +} + +function getRequestType(requestTypeId) { + return openidm.action(\`iga/governance/requestTypes/\${requestTypeId}\`, 'GET', {}, {}); +} + +function getRequest() { + var requestId = execution.getVariables().get('id'); + return openidm.action(\`iga/governance/requests/\${requestId}\`, 'GET', {}, {}); +} + +function modifyRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action(\`iga/governance/requests/\${requestId}\`, 'POST', body, { _action: "modify", phaseName: execution.getVariables().get('phaseName') }); +} + +function updateRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action(\`iga/governance/requests/\${requestId}\`, 'POST', body, { _action: "update" }); +} + +function commentRequest(message, isFail) { + return updateRequest({ comment: message, failure: !!isFail }); +} + +function main() { + var isSuccessful = false; + try { + var request = getRequest(); + + // Get user ID + var idPath = request.request.custom.idPath; + var userId = idPath.split('/').pop(); + execution.setVariable("idPath", idPath); + + // Get script ID for the phase name + var requestType = getRequestType(request.requestType); + var workflow = getPublishedWorkflow(requestType.workflow.id); + execution.setVariable("phaseName", workflow.staticNodes.startNode.connections.start); + + // Generate RAP + var response = openidm.action('endpoint/helpdesk-rap/generate/' + userId, 'create', {}, {}); + modifyRequest({ + common: { + isDraft: false, + context: { + type: "request" + } + }, + custom: { + idPath: idPath, + rap: response.rap + } + }); + isSuccessful = true; + } catch (e) { + commentRequest("Error generating RAP. Error message: " + e.message, true); + } finally { + execution.setVariable("isSuccessful", isSuccessful); + } +} + +main(); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Generate RAP - scriptTask-115d1ab72679/Generate RAP - scriptTask-115d1ab72679.json 1`] = ` +{ + "displayName": "Generate RAP", + "name": "scriptTask-115d1ab72679", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-2d4351f5c77b", + }, + ], + "script": { + "file": "Generate RAP - scriptTask-115d1ab72679.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Is Successful - exclusiveGateway-2d4351f5c77b/Is Successful - exclusiveGateway-2d4351f5c77b.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/pgh-generate-rap/steps/Is Successful - exclusiveGateway-2d4351f5c77b/Is Successful - exclusiveGateway-2d4351f5c77b.json 1`] = ` +{ + "displayName": "Is Successful", + "name": "exclusiveGateway-2d4351f5c77b", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "isSuccessful == true", + "outcome": "success", + "step": "fulfillmentTask-f49f20d19149", + }, + { + "condition": "isSuccessful == false", + "outcome": "error", + "step": "scriptTask-6f260211dc0f", + }, + ], + "script": { + "file": "Is Successful - exclusiveGateway-2d4351f5c77b.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/phh-BasicApplicationGrant.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-BasicApplicationGrant", + "displayName": "phh-BasicApplicationGrant", + "id": "phhBasicApplicationGrant", + "mutable": true, + "name": "phh-BasicApplicationGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2822, + "y": 352, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-440960b2744d": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1038.7499923706055, + "y": 469.76562881469727, + }, + "approvalTask-5d1d9c5d8384": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1039.2499923706055, + "y": 334.76562881469727, + }, + "approvalTask-6ad92fcbe998": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1037.2499923706055, + "y": 601.7656288146973, + }, + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 1, + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 682, + "y": 155, + }, + "approvalTask-ffa3a83b9dfd": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1039.9999923706055, + "y": 736.7656288146973, + }, + "exclusiveGateway-5167870154a9": { + "x": 1855, + "y": 84, + }, + "exclusiveGateway-621c9996676a": { + "x": 433, + "y": 117.015625, + }, + "inclusiveGateway-2fbd3e7aa50c": { + "x": 803.3999938964844, + "y": 472.6125030517578, + }, + "inclusiveGateway-7d248125a9bd": { + "x": 2417, + "y": 43.015625, + }, + "inclusiveGateway-a71e67faaad1": { + "x": 1124, + "y": 93.015625, + }, + "scriptTask-0e5b6187ea62": { + "x": 889, + "y": 116.015625, + }, + "scriptTask-14acc58c28dd": { + "x": 2650, + "y": 85.015625, + }, + "scriptTask-3a74557440fb": { + "x": 2144, + "y": 62, + }, + "scriptTask-4e9121fe850a": { + "x": 168, + "y": 140.015625, + }, + "scriptTask-626899b6e99a": { + "x": 1549, + "y": 108, + }, + "scriptTask-744ef6a8b9a2": { + "x": 2151, + "y": 207.015625, + }, + "scriptTask-c444d08a6099": { + "x": 818.3999938964844, + "y": 348.6125030517578, + }, + "scriptTask-c58309b8c470": { + "x": 1554, + "y": 242, + }, + "waitTask-13cf96ebeb37": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + "resumeDateVariable": "startDate", + }, + "x": 1339, + "y": 85.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation - scriptTask-626899b6e99a/Application Grant Validation - scriptTask-626899b6e99a.js 1`] = ` +"logger.info("Running application grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var app = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check the user does not already have application granted +// Note: this is done at request submission time as well, the following is an example of how to check user's accounts +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + failureReason = "Validation failed: User with id " + requestObj.user.id + " already has effective application " + applicationId; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check effective applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation - scriptTask-626899b6e99a/Application Grant Validation - scriptTask-626899b6e99a.json 1`] = ` +{ + "displayName": "Application Grant Validation", + "name": "scriptTask-626899b6e99a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-5167870154a9", + }, + ], + "script": { + "file": "Application Grant Validation - scriptTask-626899b6e99a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation Failure - scriptTask-744ef6a8b9a2/Application Grant Validation Failure - scriptTask-744ef6a8b9a2.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation Failure - scriptTask-744ef6a8b9a2/Application Grant Validation Failure - scriptTask-744ef6a8b9a2.json 1`] = ` +{ + "displayName": "Application Grant Validation Failure", + "name": "scriptTask-744ef6a8b9a2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Application Grant Validation Failure - scriptTask-744ef6a8b9a2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-6ad92fcbe998/Approval Task - approvalTask-6ad92fcbe998.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-6ad92fcbe998", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*1*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-c444d08a6099", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-440960b2744d/Approval Task - approvalTask-440960b2744d.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-440960b2744d", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-ffa3a83b9dfd/Approval Task - approvalTask-ffa3a83b9dfd.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-ffa3a83b9dfd", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Check LOB - scriptTask-c444d08a6099/Check LOB - scriptTask-c444d08a6099.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ + +var content = execution.getVariables(); +var requestId = content.get('id'); +var requestObj = null; +var appId = null; +var appGlossary = null; +var lob = null; +try { +requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +appId = requestObj.application.id; +} +catch (e) { +logger.info("Validation failed: Error reading application grant request with id " + requestId); +} +try { +appGlossary = openidm.action('iga/governance/application/' + appId + '/glossary', 'GET', {}, {}); +lob = appGlossary.lineOfBusiness || "default" +execution.setVariable("lob", lob); +} +catch (e) { +logger.info("Could not retrieve glossary with appId " + appId + " from application grant request ID " + requestId); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Check LOB - scriptTask-c444d08a6099/Check LOB - scriptTask-c444d08a6099.json 1`] = ` +{ + "displayName": "Check LOB", + "name": "scriptTask-c444d08a6099", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-2fbd3e7aa50c", + }, + ], + "script": { + "file": "Check LOB - scriptTask-c444d08a6099.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-621c9996676a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-621c9996676a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Create Removal Request - scriptTask-14acc58c28dd/Create Removal Request - scriptTask-14acc58c28dd.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "applicationId": request.common.applicationId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/applicationRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.info("Create Removal Request failed to create request") + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Create Removal Request - scriptTask-14acc58c28dd/Create Removal Request - scriptTask-14acc58c28dd.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-14acc58c28dd", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-14acc58c28dd.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Has End Date - inclusiveGateway-7d248125a9bd/Has End Date - inclusiveGateway-7d248125a9bd.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Has End Date - inclusiveGateway-7d248125a9bd/Has End Date - inclusiveGateway-7d248125a9bd.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-7d248125a9bd", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-14acc58c28dd", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-7d248125a9bd.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Has Start Date - inclusiveGateway-a71e67faaad1/Has Start Date - inclusiveGateway-a71e67faaad1.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Has Start Date - inclusiveGateway-a71e67faaad1/Has Start Date - inclusiveGateway-a71e67faaad1.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-a71e67faaad1", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-13cf96ebeb37", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-626899b6e99a", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-a71e67faaad1.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/LOB - inclusiveGateway-2fbd3e7aa50c/LOB - inclusiveGateway-2fbd3e7aa50c.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/LOB - inclusiveGateway-2fbd3e7aa50c/LOB - inclusiveGateway-2fbd3e7aa50c.json 1`] = ` +{ + "displayName": "LOB", + "name": "inclusiveGateway-2fbd3e7aa50c", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "lob == "sales"", + "outcome": "sales", + "step": "approvalTask-5d1d9c5d8384", + }, + { + "condition": "lob == "finance"", + "outcome": "finance", + "step": "approvalTask-440960b2744d", + }, + { + "condition": "lob == "hr"", + "outcome": "humanResources", + "step": "approvalTask-6ad92fcbe998", + }, + { + "condition": "lob == "default"", + "outcome": "null", + "step": "approvalTask-ffa3a83b9dfd", + }, + ], + "script": { + "file": "LOB - inclusiveGateway-2fbd3e7aa50c.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Provisioning - scriptTask-3a74557440fb/Provisioning - scriptTask-3a74557440fb.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "applicationId": request.common.applicationId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning account to user " + request.common.userId + " for application " + request.common.applicationId + ". Error message: " + message; + } + + var decision = {'status': 'complete'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Provisioning - scriptTask-3a74557440fb/Provisioning - scriptTask-3a74557440fb.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-3a74557440fb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-7d248125a9bd", + }, + ], + "script": { + "file": "Provisioning - scriptTask-3a74557440fb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if (skipApproval) { + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-0e5b6187ea62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-a71e67faaad1", + }, + ], + "script": { + "file": "Request Approved - scriptTask-0e5b6187ea62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-621c9996676a", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Sales Approver Role - approvalTask-5d1d9c5d8384/Sales Approver Role - approvalTask-5d1d9c5d8384.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Sales Approver Role", + "name": "approvalTask-5d1d9c5d8384", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Validation Gateway - exclusiveGateway-5167870154a9/Validation Gateway - exclusiveGateway-5167870154a9.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Validation Gateway - exclusiveGateway-5167870154a9/Validation Gateway - exclusiveGateway-5167870154a9.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-5167870154a9", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationSuccess", + "step": "scriptTask-3a74557440fb", + }, + { + "condition": "failureReason != null", + "outcome": "validationFailure", + "step": "scriptTask-744ef6a8b9a2", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-5167870154a9.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-BasicApplicationGrant/steps/Wait Task - waitTask-13cf96ebeb37/Wait Task - waitTask-13cf96ebeb37.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-13cf96ebeb37", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-626899b6e99a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/phh-InternalRoleEntitlementGrant.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-InternalRoleEntitlementGrant", + "displayName": "phh-InternalRoleEntitlementGrant", + "id": "phhInternalRoleEntitlementGrant", + "mutable": true, + "name": "phh-InternalRoleEntitlementGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2597, + "y": 322, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-48e748c42994": { + "x": 1731, + "y": 88.015625, + }, + "exclusiveGateway-67a954f33919": { + "x": 467, + "y": 121.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 948, + "y": 57.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2255, + "y": 48.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1972, + "y": 119.015625, + }, + "scriptTask-0b56191887de": { + "x": 1979, + "y": 212.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1434, + "y": 95.015625, + }, + "scriptTask-91769554db51": { + "x": 2561, + "y": 74.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1441, + "y": 268.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 186, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 716, + "y": 74.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1208, + "y": 30.015625, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/phh-birthright-roles-requiring-approval.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-birthright-roles-requiring-approval", + "displayName": "phh-birthright-roles-requiring-approval", + "id": "phhBirthrightRolesRequiringApproval", + "mutable": true, + "name": "phh-birthright-roles-requiring-approval", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1303, + "y": 236, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-0e64ff0c1695", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 70, + "y": 151, + }, + "uiConfig": { + "approvalTask-f4e7324654b5": { + "actors": { + "isExpression": true, + "value": "(function() { +var content = execution.getVariables(); +var requestId = content.get('id'); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var approverId = ''; +if (requestIndex.request.common.blob.after.manager) { approverId = requestIndex.request.common.blob.after.manager.id } +return [{ +"id": "managed/user/" + approverId, +"permissions": { +"approve": true, +"reject": true, +"reassign": true, +"modify": true, +"comment": true +} +}]; +})()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 440, + "y": 126.5, + }, + "scriptTask-0e64ff0c1695": { + "x": 210, + "y": 153, + }, + "scriptTask-792e240778b1": { + "x": 712, + "y": 226, + }, + "scriptTask-ad05a46c2e74": { + "x": 712, + "y": 80, + }, + "scriptTask-aecf833994d2": { + "x": 1032, + "y": 153, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Debug Task - scriptTask-0e64ff0c1695/Debug Task - scriptTask-0e64ff0c1695.js 1`] = ` +"logger.info("Running user update event"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var context = null; +var skipApproval = false; +var userObj = null; +var userId = null; +// Read event user information from request object +try { +var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +logger.error("requestObj "+JSON.stringify(requestObj)); +if (requestObj.request.common.context) { +context = requestObj.request.common.context.type; +if (context == 'admin') { +skipApproval = true; +} +} +userObj = requestObj.request.common.blob.after; +userId = userObj.userId; +} +catch (e) { +failureReason = "Validation failed: Error reading request with id " + requestId; +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Debug Task - scriptTask-0e64ff0c1695/Debug Task - scriptTask-0e64ff0c1695.json 1`] = ` +{ + "displayName": "Debug Task", + "name": "scriptTask-0e64ff0c1695", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "approvalTask-f4e7324654b5", + }, + ], + "script": { + "file": "Debug Task - scriptTask-0e64ff0c1695.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Failure Handler - scriptTask-aecf833994d2/Failure Handler - scriptTask-aecf833994d2.js 1`] = ` +"logger.info("Failure Handler: BirthRight Roles that need Approval "); +var content = execution.getVariables(); +var requestId = content.get('requestId'); +var failureReason = content.get('failureReason'); +// Update event request as final +if (failureReason) { +var decision = {'status': 'complete', 'outcome': 'cancelled', 'decision': 'rejected', 'comment': failureReason, 'failure': true} +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Failure Handler - scriptTask-aecf833994d2/Failure Handler - scriptTask-aecf833994d2.json 1`] = ` +{ + "displayName": "Failure Handler", + "name": "scriptTask-aecf833994d2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Failure Handler - scriptTask-aecf833994d2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Finalize Request on Reject - scriptTask-ad05a46c2e74/Finalize Request on Reject - scriptTask-ad05a46c2e74.js 1`] = ` +"logger.info("Finalize Request:BirthRight Roles that need Approval"); +var content = execution.getVariables(); +var requestId = content.get('requestId'); +var failureState = content.get('failureState'); +if (!failureState) { +try { +// Update event request as final +var decision = {'status': 'complete', 'outcome': 'fulfilled', 'decision': 'rejected'} +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +} +catch (e) { +execution.setVariable("failureState", "Unable to finalize request."); +} +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Finalize Request on Reject - scriptTask-ad05a46c2e74/Finalize Request on Reject - scriptTask-ad05a46c2e74.json 1`] = ` +{ + "displayName": "Finalize Request on Reject", + "name": "scriptTask-ad05a46c2e74", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-aecf833994d2", + }, + ], + "script": { + "file": "Finalize Request on Reject - scriptTask-ad05a46c2e74.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Look Up Roles and Request - scriptTask-792e240778b1/Look Up Roles and Request - scriptTask-792e240778b1.js 1`] = ` +"logger.info("Running user update event"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var userObj = null; +var userId = null; +// +// Read event user information from request object +try { +var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +userObj = requestObj.request.common.blob.after; +userId = userObj.userId; +} +catch (e) { +failureReason = "Validation failed: Error reading request with id " + requestId; +} +///Get Roles from Role Variable +var roleNames = requestObj.request.common.blob.parameters.roleNames.split(','); +logger.error("UpdateRequest with roleNames: " + roleNames); +// Look up roles in catalog +var operand = []; +for (var index in roleNames) { +var role = roleNames[index]; +var roleClean = role.trim(); +operand.push({operator: "EQUALS", operand: { targetName: "role.name", targetValue: roleClean }}) +} +var body = { targetFilter: {operator: "OR", operand: operand}}; +var catalog = openidm.action("iga/governance/catalog/search", "POST", body); +var catalogResults = catalog.result; +// Define request catalogs key +var catalogBody = []; +for (var idx in catalogResults) { +var catalog = catalogResults[idx]; +catalogBody.push({type: "role", id: catalog.id}) +} +// Define request payload +var requestBody = { +priority: "low", +accessModifier: "add", +justification: "Request submitted on user update.", +users: [ userId ], +catalogs: catalogBody, +context: { +type: "NoAdmin" +} +}; +// Create requests +try { +logger.error("DRLCREATING REQUST for "+JSON.stringify(body)); +openidm.action("iga/governance/requests", "POST", requestBody, {_action: "create"}) +} +catch (e) { +failureReason = "Unable to generate requests for roles"; +} +// Update event request as final +var decision = failureReason ? +{'status': 'complete', 'outcome': 'cancelled', 'decision': 'rejected', 'comment': failureReason, 'failure': true} : +{'status': 'complete', 'outcome': 'fulfilled', 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Look Up Roles and Request - scriptTask-792e240778b1/Look Up Roles and Request - scriptTask-792e240778b1.json 1`] = ` +{ + "displayName": "Look Up Roles and Request", + "name": "scriptTask-792e240778b1", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Look Up Roles and Request - scriptTask-792e240778b1.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-birthright-roles-requiring-approval/steps/Manager Approval - approvalTask-f4e7324654b5/Manager Approval - approvalTask-f4e7324654b5.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { +var content = execution.getVariables(); +var requestId = content.get('id'); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var approverId = ''; +if (requestIndex.request.common.blob.after.manager) { approverId = requestIndex.request.common.blob.after.manager.id } +return [{ +"id": "managed/user/" + approverId, +"permissions": { +"approve": true, +"reject": true, +"reassign": true, +"modify": true, +"comment": true +} +}]; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-792e240778b1", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-ad05a46c2e74", + }, + ], + }, + "displayName": "Manager Approval", + "name": "approvalTask-f4e7324654b5", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/phh-delegated-user-disable-workflow.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-delegated-user-disable-workflow", + "displayName": "phh-delegated-user-disable-workflow", + "id": "phhDelegatedUserDisableWorkflow", + "mutable": true, + "name": "phh-delegated-user-disable-workflow", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1563, + "y": 352, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-3d854e98930e", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "approvalTask-bebe49db4dac": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "type": "manager", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1177, + "y": 60.61250305175781, + }, + "exclusiveGateway-26e0a9262468": { + "x": 438.3999938964844, + "y": 232.6125030517578, + }, + "exclusiveGateway-d5b7b2e2a80a": { + "x": 931.7999877929688, + "y": 111.61250305175781, + }, + "scriptTask-38eb13f4deca": { + "x": 648.3999938964844, + "y": 343.6125030517578, + }, + "scriptTask-3d854e98930e": { + "x": 175.39999389648438, + "y": 251.6125030517578, + }, + "scriptTask-449aac6b18b8": { + "x": 1149.3999938964844, + "y": 236.6125030517578, + }, + "scriptTask-4f4b87291099": { + "x": 1442.9999694824219, + "y": 101.61250305175781, + }, + "scriptTask-8e24794e9be4": { + "x": 649.3999938964844, + "y": 132.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Auth Check - exclusiveGateway-26e0a9262468/Auth Check - exclusiveGateway-26e0a9262468.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Auth Check - exclusiveGateway-26e0a9262468/Auth Check - exclusiveGateway-26e0a9262468.json 1`] = ` +{ + "displayName": "Auth Check", + "name": "exclusiveGateway-26e0a9262468", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "hasDelegationAuthority == true", + "outcome": "validationSuccess", + "step": "scriptTask-8e24794e9be4", + }, + { + "condition": "hasDelegationAuthority == false", + "outcome": "validationFailure", + "step": "scriptTask-38eb13f4deca", + }, + ], + "script": { + "file": "Auth Check - exclusiveGateway-26e0a9262468.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - No Authority - scriptTask-38eb13f4deca/Auto-Reject - No Authority - scriptTask-38eb13f4deca.js 1`] = ` +"/* + * Auto-Reject - No Delegation Authority + * Rejects request if user has no direct reports + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +console.log("Auto-rejecting request " + requestId + " - no delegation authority"); + +try { + var decision = { + 'decision': 'rejected', + 'status': 'complete', + 'comment': 'Request automatically rejected: You do not have any direct reports in the system. You cannot submit delegation requests without having direct reports assigned to you.\\n\\nPlease contact your administrator if you believe this is an error.' + }; + + var updateParams = { + '_action': 'update' + }; + + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, updateParams); + + console.log("Request " + requestId + " rejected successfully"); + +} catch (e) { + console.log("Error rejecting request: " + e.message); + throw e; +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - No Authority - scriptTask-38eb13f4deca/Auto-Reject - No Authority - scriptTask-38eb13f4deca.json 1`] = ` +{ + "displayName": "Auto-Reject - No Authority", + "name": "scriptTask-38eb13f4deca", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto-Reject - No Authority - scriptTask-38eb13f4deca.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8.js 1`] = ` +"/* + * Auto-Reject - Validation Failed + * Rejects request with detailed error messages + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); +var validationErrors = content.get('validationErrors') || "Validation failed"; + +console.log("Auto-rejecting request due to validation errors"); + +try { + var decision = { + 'decision': 'rejected', + 'status': 'complete', + 'comment': 'Request automatically rejected due to validation errors:\\n\\n' + validationErrors + '\\n\\nPlease correct the errors and submit a new request.' + }; + + var updateParams = { + '_action': 'update' + }; + + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, updateParams); + + console.log("Request " + requestId + " rejected - validation failed"); + +} catch (e) { + console.log("Error rejecting request: " + e.message); + throw e; +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8.json 1`] = ` +{ + "displayName": "Auto-Reject - Validation Failed", + "name": "scriptTask-449aac6b18b8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto-Reject - Validation Failed - scriptTask-449aac6b18b8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Disable User Account - scriptTask-4f4b87291099/Disable User Account - scriptTask-4f4b87291099.js 1`] = ` +"/* + * Fulfillment - Disable User Account + * Disables the target user's account + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); +var targetUserId = content.get('targetUserId'); +var justification = content.get('justification'); +var actingPrincipalUserName = content.get('actingPrincipalUserName'); + +console.log("=== Fulfillment Start ==="); +console.log("Disabling user ID: " + targetUserId); + +try { + // Read current user state + var targetUser = openidm.read("managed/alpha_user/" + targetUserId); + + if (!targetUser) { + throw new Error("Target user not found: " + targetUserId); + } + + console.log("Current user status: " + (targetUser.accountStatus || "active")); + + // Prepare patch operations to disable the account + var patchOperations = [ + { + "operation": "replace", + "field": "/accountStatus", + "value": "inactive" + } + ]; + + // Add a description/note about the disable action + if (targetUser.description) { + patchOperations.push({ + "operation": "replace", + "field": "/description", + "value": targetUser.description + "\\n[" + new Date().toISOString() + "] Disabled via delegation by " + actingPrincipalUserName + ". Reason: " + justification + }); + } else { + patchOperations.push({ + "operation": "add", + "field": "/description", + "value": "[" + new Date().toISOString() + "] Disabled via delegation by " + actingPrincipalUserName + ". Reason: " + justification + }); + } + + // Execute the patch + var updateResult = openidm.patch("managed/alpha_user/" + targetUserId, null, patchOperations); + + console.log("User " + targetUser.userName + " successfully disabled"); + console.log("Account status set to: inactive"); + + // Set success variables + execution.setVariable("fulfillmentStatus", "completed"); + execution.setVariable("fulfillmentMessage", "User account " + targetUser.userName + " has been successfully disabled"); + + // Update request with completion details + try { + var requestUpdate = { + 'status': 'complete', + 'decision': 'approved' + }; + + openidm.action('iga/governance/requests/' + requestId, 'POST', requestUpdate, {'_action': 'update'}); + } catch (updateError) { + console.log("Could not update request status: " + updateError.message); + } + +} catch (e) { + logger.error("Fulfillment error: " + e.message); + execution.setVariable("fulfillmentStatus", "failed"); + execution.setVariable("fulfillmentMessage", "Error disabling user: " + e.message); + + // Don't throw - let workflow complete but mark as failed + // You might want to send a notification here +} + +console.log("=== Fulfillment Complete ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Disable User Account - scriptTask-4f4b87291099/Disable User Account - scriptTask-4f4b87291099.json 1`] = ` +{ + "displayName": "Disable User Account", + "name": "scriptTask-4f4b87291099", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Disable User Account - scriptTask-4f4b87291099.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Load Delegation Info - scriptTask-3d854e98930e/Load Delegation Info - scriptTask-3d854e98930e.js 1`] = ` +"/* + * Load Delegation Information + * Populates available direct reports for the requester + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +console.log("=== Load Delegation Info Start ==="); +console.log("Request ID: " + requestId); + +try { + // Get the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requesterId = requestObj.requester.id; + var requesterIdOnly = requesterId.replace("managed/user/", ""); + + console.log("Requester ID: " + requesterIdOnly); + + // Query users where current user is the manager + var queryParams = { + "_queryFilter": 'manager._id eq "' + requesterIdOnly + '"', + "_fields": "userName,givenName,sn,_id" + }; + + var results = openidm.query("managed/alpha_user", queryParams); + + // Build a formatted list for display + var directReportsList = ""; + var directReportsCount = 0; + + if (results.resultCount > 0) { + directReportsList = "You can act on behalf of the following users:\\n\\n"; + results.result.forEach(function(user) { + directReportsList += "• " + user.userName + " (" + user.givenName + " " + user.sn + ")\\n"; + }); + directReportsCount = results.resultCount; + logger.info("Found " + directReportsCount + " direct reports"); + } else { + directReportsList = "You do not have any direct reports in the system.\\n\\nYou cannot submit delegation requests without direct reports."; + logger.warn("No direct reports found"); + } + + // Store variables for later use + execution.setVariable("directReportsList", directReportsList); + execution.setVariable("directReportsCount", directReportsCount); + execution.setVariable("hasDelegationAuthority", directReportsCount > 0); + + // Update the request to populate the helper field + // This updates the form display for the user + var updatePayload = { + "request": { + "common": { + "blob": { + "form": { + "availableDirectReports": directReportsList + } + } + } + } + }; + + openidm.patch('iga/governance/requests/' + requestId, null, [ + { + "operation": "add", + "field": "/request/common/blob/form/availableDirectReports", + "value": directReportsList + } + ]); + + console.log("Direct reports list populated in form"); + +} catch (e) { + logger.error("Error loading delegation info: " + e.message); + execution.setVariable("hasDelegationAuthority", false); + execution.setVariable("directReportsCount", 0); + execution.setVariable("directReportsList", "Error loading your direct reports. Please contact your administrator."); +} + +console.log("=== Load Delegation Info Complete ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Load Delegation Info - scriptTask-3d854e98930e/Load Delegation Info - scriptTask-3d854e98930e.json 1`] = ` +{ + "displayName": "Load Delegation Info", + "name": "scriptTask-3d854e98930e", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-26e0a9262468", + }, + ], + "script": { + "file": "Load Delegation Info - scriptTask-3d854e98930e.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Manager Approval - approvalTask-bebe49db4dac/Manager Approval - approvalTask-bebe49db4dac.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "doNothing", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-4f4b87291099", + }, + { + "condition": null, + "outcome": "REJECT", + "step": null, + }, + ], + }, + "displayName": "Manager Approval", + "name": "approvalTask-bebe49db4dac", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Validate Delegation Request - scriptTask-8e24794e9be4/Validate Delegation Request - scriptTask-8e24794e9be4.js 1`] = ` +"/* + * Validate Delegation Request + * Validates all user inputs and delegation authority + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +console.log("=== Validation Start ==="); + +var validationPassed = false; +var validationErrors = []; +var actingPrincipalObject = null; +var targetUserObject = null; + +try { + // Get request object with form data + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + var requesterId = requestObj.requester.id; + var requesterIdOnly = requesterId.replace("managed/user/", ""); + + // Extract form values + var actingPrincipalUsername = requestObj.request.common.blob.form.actingPrincipalId; + var targetUserUsername = requestObj.request.common.blob.form.targetUserId; + var justification = requestObj.request.common.blob.form.justification; + + console.log("Acting Principal Username: " + actingPrincipalUsername); + console.log("Target User Username: " + targetUserUsername); + + // Validate acting principal + if (!actingPrincipalUsername || actingPrincipalUsername.trim() === "") { + validationErrors.push("Acting Principal username is required"); + } else { + try { + var actingPrincipalQuery = { + "_queryFilter": 'userName eq "' + actingPrincipalUsername.trim() + '"' + }; + var actingPrincipalResults = openidm.query("managed/alpha_user", actingPrincipalQuery); + + if (actingPrincipalResults.resultCount === 0) { + validationErrors.push("Acting Principal user not found: " + actingPrincipalUsername); + } else if (actingPrincipalResults.resultCount > 1) { + validationErrors.push("Multiple users found with username: " + actingPrincipalUsername); + } else { + actingPrincipalObject = actingPrincipalResults.result[0]; + + // Verify requester is manager of acting principal + if (!actingPrincipalObject.manager || !actingPrincipalObject.manager._id) { + validationErrors.push("Acting Principal does not have a manager assigned"); + } else if (actingPrincipalObject.manager._id !== requesterIdOnly) { + validationErrors.push("You are not the manager of " + actingPrincipalUsername + ". You can only act on behalf of your direct reports."); + } else { + console.log("Acting Principal validated: " + actingPrincipalObject.userName); + } + } + } catch (e) { + validationErrors.push("Error validating Acting Principal: " + e.message); + } + } + + // Validate target user + if (!targetUserUsername || targetUserUsername.trim() === "") { + validationErrors.push("Target User username is required"); + } else { + try { + var targetUserQuery = { + "_queryFilter": 'userName eq "' + targetUserUsername.trim() + '"' + }; + var targetUserResults = openidm.query("managed/alpha_user", targetUserQuery); + + if (targetUserResults.resultCount === 0) { + validationErrors.push("Target User not found: " + targetUserUsername); + } else if (targetUserResults.resultCount > 1) { + validationErrors.push("Multiple users found with username: " + targetUserUsername); + } else { + targetUserObject = targetUserResults.result[0]; + + // Verify user type is External + if (targetUserObject.userType !== "External") { + validationErrors.push("Target User must be of type 'External'. User " + targetUserUsername + " is type: " + (targetUserObject.userType || "Unknown")); + } else { + console.log("Target User validated: " + targetUserObject.userName); + } + } + } catch (e) { + validationErrors.push("Error validating Target User: " + e.message); + } + } + + // Validate justification + if (!justification || justification.trim() === "") { + validationErrors.push("Justification is required"); + } else if (justification.trim().length < 10) { + validationErrors.push("Justification must be at least 10 characters"); + } + + // Prevent self-disable via delegation + if (actingPrincipalObject && targetUserObject && actingPrincipalObject._id === targetUserObject._id) { + validationErrors.push("Cannot disable the same user you are acting on behalf of"); + } + + // Check if all validations passed + if (validationErrors.length === 0) { + validationPassed = true; + + // Store user details for display in approval + execution.setVariable("actingPrincipalUserName", actingPrincipalObject.userName); + execution.setVariable("actingPrincipalFullName", actingPrincipalObject.givenName + " " + actingPrincipalObject.sn); + execution.setVariable("actingPrincipalId", actingPrincipalObject._id); + + execution.setVariable("targetUserUserName", targetUserObject.userName); + execution.setVariable("targetUserFullName", targetUserObject.givenName + " " + targetUserObject.sn); + execution.setVariable("targetUserId", targetUserObject._id); + + execution.setVariable("justification", justification); + + console.log("All validations passed"); + } else { + console.log("Validation failed: " + validationErrors.join("; ")); + } + +} catch (e) { + validationPassed = false; + validationErrors.push("System error during validation: " + e.message); + console.log("Validation exception: " + e.message); +} + +// Set workflow variables +execution.setVariable("validationPassed", validationPassed); +execution.setVariable("validationErrors", validationErrors.join("\\n")); + +console.log("=== Validation Complete: " + (validationPassed ? "PASSED" : "FAILED") + " ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Validate Delegation Request - scriptTask-8e24794e9be4/Validate Delegation Request - scriptTask-8e24794e9be4.json 1`] = ` +{ + "displayName": "Validate Delegation Request", + "name": "scriptTask-8e24794e9be4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-d5b7b2e2a80a", + }, + ], + "script": { + "file": "Validate Delegation Request - scriptTask-8e24794e9be4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-delegated-user-disable-workflow/steps/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a.json 1`] = ` +{ + "displayName": "Validation Passed?", + "name": "exclusiveGateway-d5b7b2e2a80a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "validationPassed == true", + "outcome": "validationSuccess", + "step": "approvalTask-bebe49db4dac", + }, + { + "condition": "validationPassed == false", + "outcome": "validationFailure", + "step": "scriptTask-449aac6b18b8", + }, + ], + "script": { + "file": "Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-ne-disable/phh-ne-disable.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-ne-disable", + "displayName": "phh-ne-disable", + "id": "phhNeDisable", + "mutable": true, + "name": "phh-ne-disable", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 601, + "y": 255, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-99fdf317c49b", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "scriptTask-99fdf317c49b": { + "x": 270.3999938964844, + "y": 250.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-ne-disable/steps/Load Delegate Sources - scriptTask-99fdf317c49b/Load Delegate Sources - scriptTask-99fdf317c49b.js 1`] = ` +"/* + * Load Delegate Sources + * Queries users the current requester can act on behalf of + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +try { + // Get the request to find requester + var requestObj = openidm.read('iga/governance/requests/' + requestId); + var requesterId = requestObj.requester.id; + var requesterIdOnly = requesterId.replace("managed/user/", ""); + + console.log("=== Loading Delegation Options ==="); + console.log("Requester ID: " + requesterIdOnly); + + // Query users where current user is the manager + var queryParams = { + "_queryFilter": 'manager._id eq "' + requesterIdOnly + '"', + "_fields": "userName,givenName,sn,mail,_id" + }; + + var results = openidm.query("managed/alpha_user", queryParams); + console.log("Results: " + results); + + // Build options array + var options = []; + + if (results.resultCount > 0) { + results.result.forEach(function(user) { + options.push({ + "value": user._id, + "label": user.givenName + " " + user.sn + " (" + user.userName + ")" + }); + }); + + logger.info("Found " + options.length + " delegation options"); + } else { + logger.warn("No direct reports found for requester"); + options.push({ + "value": "", + "label": "No direct reports found" + }); + } + + // Store options as JSON string + execution.setVariable("delegationOptions", JSON.stringify(options)); + execution.setVariable("hasDelegationOptions", results.resultCount > 0); + execution.setVariable("delegationOptionsCount", results.resultCount); + +} catch (e) { + logger.error("Error loading delegation options: " + e.message); + execution.setVariable("delegationOptions", "[]"); + execution.setVariable("hasDelegationOptions", false); + execution.setVariable("delegationOptionsCount", 0); +} + +logger.info("=== Delegation Options Loaded ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-ne-disable/steps/Load Delegate Sources - scriptTask-99fdf317c49b/Load Delegate Sources - scriptTask-99fdf317c49b.json 1`] = ` +{ + "displayName": "Load Delegate Sources", + "name": "scriptTask-99fdf317c49b", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Load Delegate Sources - scriptTask-99fdf317c49b.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/phh-new-user-create.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-new-user-create", + "displayName": "phh-new-user-create", + "id": "phhNewUserCreate", + "mutable": true, + "name": "phh-new-user-create", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1348, + "y": 177.5, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 177.5, + }, + "uiConfig": { + "approvalTask-75cf4247ba1d": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 777, + "y": 226, + }, + "exclusiveGateway-621c9996676a": { + "x": 514, + "y": 153, + }, + "scriptTask-0e5b6187ea62": { + "x": 777, + "y": 80, + }, + "scriptTask-4e9121fe850a": { + "x": 210, + "y": 179.5, + }, + "scriptTask-626899b6e99a": { + "x": 1049, + "y": 97.66666666666667, + }, + "scriptTask-c58309b8c470": { + "x": 1049, + "y": 234.83333333333334, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Approval Task - approvalTask-75cf4247ba1d/Approval Task - approvalTask-75cf4247ba1d.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-626899b6e99a", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-75cf4247ba1d", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-621c9996676a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-75cf4247ba1d", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-621c9996676a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if (skipApproval) { + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-0e5b6187ea62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-626899b6e99a", + }, + ], + "script": { + "file": "Request Approved - scriptTask-0e5b6187ea62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-621c9996676a", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/User Create Validation - scriptTask-626899b6e99a/User Create Validation - scriptTask-626899b6e99a.js 1`] = ` +"logger.info("[phh] Creating User"); +function generateUsername(givenName, surname) { +const usernamePrefix = (givenName[0] + surname[0]).toLowerCase(); +const data = openidm.query("managed/alpha_user", {'_queryFilter': \`userName sw "\${usernamePrefix}"\`}, ["userName"]); +const usernames = data.result.map(user => user.userName); +let i = 1; +while (i<100000 && usernames.includes(usernamePrefix + String(i).padStart(5, '0'))) { +i++; +} +return usernamePrefix + String(i).padStart(5, '0'); +} +function createUser(custom) { +var startDate = new Date(custom.startDate).toISOString(); +var endDate = new Date(custom.endDate).toISOString(); +var payload = { +"userName": custom.userName, +"givenName": custom.givenName, +"sn": custom.sn, +"mail": custom.mail, +"password": custom.password, +"frIndexedDate5":startDate, +"frIndexedDate4":endDate +}; +return openidm.create('managed/alpha_user', null, payload); +} +function process(requestObj) { +var custom = requestObj.request.custom +custom.userName = generateUsername(custom.givenName, custom.sn); +custom.password = 'Password!234'; +const result = createUser(custom); +return { outcome: "provisioned" }; +} +try { +const requestId = execution.getVariables().get("id"); +const requestObj = openidm.action(\`iga/governance/requests/\${requestId}\`, "GET", {}, {}); +let decision = { status: "complete", "decision": "approved" }; +try { +const result = process(requestObj); +Object.assign(decision, result); +} catch (error) { +Object.assign(decision, { outcome: "unknown", comment: \`Error processing request \${requestId}: \${e.message}\`, failure: true }); +} +openidm.action(\`iga/governance/requests/\${requestId}\`, 'POST', decision, { _action: "update"}); +} catch (e) { +logger.error(\`Error reading request \${requestId}: \${e}\`); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phh-new-user-create/steps/User Create Validation - scriptTask-626899b6e99a/User Create Validation - scriptTask-626899b6e99a.json 1`] = ` +{ + "displayName": "User Create Validation", + "name": "scriptTask-626899b6e99a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "User Create Validation - scriptTask-626899b6e99a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/phhCustomWorkflow.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "phhCustomWorkflow", + "displayName": "phhCustomWorkflow", + "id": "phhCustomWorkflow", + "mutable": true, + "name": "phhCustomWorkflow", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 955, + "y": 174, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 448, + "y": 124, + }, + "scriptTask-0e5b6187ea62": { + "x": 683, + "y": 128.015625, + }, + "scriptTask-4e9121fe850a": { + "x": 168, + "y": 140.015625, + }, + "scriptTask-c58309b8c470": { + "x": 688, + "y": 207, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if (skipApproval) { + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-0e5b6187ea62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Request Approved - scriptTask-0e5b6187ea62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhCustomWorkflow/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/phhFlow.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phhFlow", + "displayName": "phhFlow", + "id": "phhFlow", + "mutable": true, + "name": "phhFlow", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 564, + "y": 312, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-10bf48033687", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "approvalTask-bf52ce203a81": { + "actors": { + "isExpression": true, + "value": " +//Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + + + return [{ + "id": "managed/user/" + requestIndex.applicationOwner[0].id, + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})() + + + +( +function(){ +// --- Log comment to request audit trail --- + try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var logComment = "Context Check" + + " | applicationOwner: " + requestObj.applicationOwner[0].id + + " | full dump: " + JSON.stringify(requestObj); + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } + return []; +} +)() +", + }, + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 153.39999389648438, + "y": 268.6125030517578, + }, + "scriptTask-10bf48033687": { + "x": 162.39999389648438, + "y": 140.6125030517578, + }, + "scriptTask-610744f7d369": { + "x": 357.3999938964844, + "y": 370.6125030517578, + }, + "scriptTask-c28119ea007e": { + "x": 360.3999938964844, + "y": 256.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/steps/Approval Task - approvalTask-bf52ce203a81/Approval Task - approvalTask-bf52ce203a81.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": " +//Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + + + return [{ + "id": "managed/user/" + requestIndex.applicationOwner[0].id, + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})() + + + +( +function(){ +// --- Log comment to request audit trail --- + try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var logComment = "Context Check" + + " | applicationOwner: " + requestObj.applicationOwner[0].id + + " | full dump: " + JSON.stringify(requestObj); + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } + return []; +} +)() +", + }, + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-c28119ea007e", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-610744f7d369", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-bf52ce203a81", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/steps/Approve - scriptTask-c28119ea007e/Approve - scriptTask-c28119ea007e.js 1`] = ` +"logger.info("Approving request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info("Execution Content: " + content); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/steps/Approve - scriptTask-c28119ea007e/Approve - scriptTask-c28119ea007e.json 1`] = ` +{ + "displayName": "Approve", + "name": "scriptTask-c28119ea007e", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Approve - scriptTask-c28119ea007e.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/steps/Context Check - scriptTask-10bf48033687/Context Check - scriptTask-10bf48033687.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + } + // --- Log comment to request audit trail --- + try { + var logComment = "Context Check" + + " | full dump: " + JSON.stringify(requestObj); + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } +} +catch (e) { + logger.info("Request Context Check failed "+e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/steps/Context Check - scriptTask-10bf48033687/Context Check - scriptTask-10bf48033687.json 1`] = ` +{ + "displayName": "Context Check", + "name": "scriptTask-10bf48033687", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "approvalTask-bf52ce203a81", + }, + ], + "script": { + "file": "Context Check - scriptTask-10bf48033687.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/steps/Script Task - scriptTask-610744f7d369/Script Task - scriptTask-610744f7d369.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info("Execution Content: " + content); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/phhFlow/steps/Script Task - scriptTask-610744f7d369/Script Task - scriptTask-610744f7d369.json 1`] = ` +{ + "displayName": "Script Task", + "name": "scriptTask-610744f7d369", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Script Task - scriptTask-610744f7d369.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test/steps/Wait Task - waitTask-4d9223fb79c5/Wait Task - waitTask-4d9223fb79c5.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-4d9223fb79c5", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": null, + }, + ], + "resumeDate": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(1*30*24*60*60*1000))).toISOString()", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test/test.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "test", + "displayName": "test", + "id": "test", + "mutable": true, + "name": "test", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 500, + "y": 50, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "waitTask-4d9223fb79c5", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "waitTask-4d9223fb79c5": { + "events": { + "resumeDateNumber": 1, + "resumeDateTimeSpan": "month(s)", + "resumeDateType": "duration", + }, + "x": 285.3999938964844, + "y": 211.22499084472656, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Approval Task - approvalTask-7e33e73d6763/Custom Approval Task - approvalTask-7e33e73d6763.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate1", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate1", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "content.customExpirationDuration", + }, + "notification": "FrodoTestEmailTemplate1", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate1", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(4*30*24*60*60*1000))).toISOString()", + }, + "frequency": 4, + "notification": "FrodoTestEmailTemplate1", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-7fce35a32915", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task", + "name": "approvalTask-7e33e73d6763", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Approval Task 2 - approvalTask-363e32acf981/Custom Approval Task 2 - approvalTask-363e32acf981.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-29a71d4ab8ed", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task 2", + "name": "approvalTask-363e32acf981", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Email Task - emailTask-2068f5d711c8/Custom Email Task - emailTask-2068f5d711c8.json 1`] = ` +{ + "displayName": "Custom Email Task", + "emailTask": { + "bcc": { + "isExpression": true, + "value": "// This is the bcc script +"bcc@email.com";", + }, + "cc": { + "isExpression": true, + "value": "// This is the cc script +"cc@email.com";", + }, + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-b7fc169ca4eb", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": { + "hello": "goodbye", + "hi": "hola", + }, + "templateName": "frodoTestEmailTemplateFour", + "to": { + "isExpression": true, + "value": "// This is the to script +"to@email.com";", + }, + }, + "name": "emailTask-2068f5d711c8", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Email Task 2 - emailTask-881f2975e240/Custom Email Task 2 - emailTask-881f2975e240.json 1`] = ` +{ + "displayName": "Custom Email Task 2", + "emailTask": { + "bcc": "bcc@email.com", + "cc": "cc@email.com", + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-72d593301121", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": {}, + "templateName": "frodoTestEmailTemplateFour", + "to": "to@email.com", + }, + "name": "emailTask-881f2975e240", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Fulfillment Task - fulfillmentTask-7fce35a32915/Custom Fulfillment Task - fulfillmentTask-7fce35a32915.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task", + "fulfillmentTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate2", + }, + "escalation": { + "actors": [ + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate2", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate2", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate2", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(2*30*24*60*60*1000))).toISOString()", + }, + "frequency": 2, + "notification": "FrodoTestEmailTemplate2", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "exclusiveGateway-94bc3d35f3b4", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-7fce35a32915", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task 2", + "fulfillmentTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "content.customExpirationDate", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "emailTask-881f2975e240", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-29a71d4ab8ed", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.json 1`] = ` +{ + "displayName": "Custom Inclusive Gateway", + "name": "inclusiveGateway-a6cf9605ce55", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "// This is outcome 1 +outcome === 1", + "outcome": "outcomeOne", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 2 +outcome === 2", + "outcome": "outcomeTwo", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 3 +outcome === 3", + "outcome": "outcomeThree", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.json 1`] = ` +{ + "displayName": "Custom Script Task", + "name": "scriptTask-493f5ea87636", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-2068f5d711c8", + }, + ], + "script": { + "file": "Custom Script Task - scriptTask-493f5ea87636.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.json 1`] = ` +{ + "displayName": "Custom Validation Gateway", + "name": "exclusiveGateway-94bc3d35f3b4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "// This is a validation success +outcome == true", + "outcome": "validationSuccess", + "step": "inclusiveGateway-a6cf9605ce55", + }, + { + "condition": "// This is a validation failure +outcome == false", + "outcome": "validationFailure", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Violation Task - violationTask-50261d9bc712/Custom Violation Task - violationTask-50261d9bc712.json 1`] = ` +{ + "displayName": "Custom Violation Task", + "name": "violationTask-50261d9bc712", + "type": "violationTask", + "violationTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate3", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*7*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate3", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(8*30*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate3", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate3", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "FrodoTestEmailTemplate3", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Violation Task 2 - violationTask-f8066518b46a/Custom Violation Task 2 - violationTask-f8066518b46a.json 1`] = ` +{ + "displayName": "Custom Violation Task 2", + "name": "violationTask-f8066518b46a", + "type": "violationTask", + "violationTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "approvalMode": "any", + "events": {}, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Wait Task - waitTask-b7fc169ca4eb/Custom Wait Task - waitTask-b7fc169ca4eb.json 1`] = ` +{ + "displayName": "Custom Wait Task", + "name": "waitTask-b7fc169ca4eb", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "approvalTask-363e32acf981", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*30*24*60*60*1000))).toISOString()", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Wait Task 2 - waitTask-72d593301121/Custom Wait Task 2 - waitTask-72d593301121.json 1`] = ` +{ + "displayName": "Custom Wait Task 2", + "name": "waitTask-72d593301121", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "waitTask-b343cc7df7c9", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/steps/Custom Wait Task 3 - waitTask-b343cc7df7c9/Custom Wait Task 3 - waitTask-b343cc7df7c9.json 1`] = ` +{ + "displayName": "Custom Wait Task 3", + "name": "waitTask-b343cc7df7c9", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "violationTask-f8066518b46a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "content.get('resumeDate')", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_1/test_workflow_1.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "test_workflow_1", + "displayName": "test_workflow_1", + "id": "testWorkflow1", + "mutable": true, + "name": "test_workflow_1", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 826, + "y": 50, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "approvalTask-7e33e73d6763", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 20, + "y": 42, + }, + "uiConfig": { + "approvalTask-363e32acf981": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + { + "id": { + "isExpression": false, + "value": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + "type": "role", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "type": "manager", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "type": "roleOwner", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 478.3999938964844, + "y": 195.6125030517578, + }, + "approvalTask-7e33e73d6763": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDuration", + "expirationTimeSpan": "hour(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "reminderDate": 4, + "reminderTimeSpan": "month(s)", + }, + "x": 146.39999389648438, + "y": 15.61250305175781, + }, + "emailTask-2068f5d711c8": { + "x": 150.39999389648438, + "y": 648.812502861023, + }, + "emailTask-881f2975e240": { + "x": 478.3999938964844, + "y": 474.41250228881836, + }, + "exclusiveGateway-94bc3d35f3b4": { + "x": 145.39999389648438, + "y": 274.6125030517578, + }, + "fulfillmentTask-29a71d4ab8ed": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDate", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 479.3999938964844, + "y": 334.41250228881836, + }, + "fulfillmentTask-7fce35a32915": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "hour(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "reminderDate": 2, + "reminderTimeSpan": "month(s)", + }, + "x": 145.39999389648438, + "y": 146.6125030517578, + }, + "inclusiveGateway-a6cf9605ce55": { + "x": 147.39999389648438, + "y": 405.6125030517578, + }, + "scriptTask-493f5ea87636": { + "x": 148.39999389648438, + "y": 570.6125030517578, + }, + "violationTask-50261d9bc712": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "week(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "reminderDate": 3, + "reminderTimeSpan": "hour(s)", + }, + "x": 480.3999938964844, + "y": 13.61250305175781, + }, + "violationTask-f8066518b46a": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationType": "applicationOwner", + "expirationDateType": "variable", + "expirationDateVariable": "taskExpirationDate", + "reassignedActors": [], + }, + "x": 788.3999938964844, + "y": 613.4125022888184, + }, + "waitTask-72d593301121": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 476.3999938964844, + "y": 612.4125022888184, + }, + "waitTask-b343cc7df7c9": { + "events": { + "resumeDateNumber": 1, + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "variable", + "resumeDateVariable": "resumeDate", + }, + "x": 476.3999938964844, + "y": 694.4125022888184, + }, + "waitTask-b7fc169ca4eb": { + "events": { + "resumeDateNumber": 5, + "resumeDateTimeSpan": "month(s)", + "resumeDateType": "duration", + }, + "x": 148.39999389648438, + "y": 779.812502861023, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Approval Task - approvalTask-7e33e73d6763/Custom Approval Task - approvalTask-7e33e73d6763.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate1", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate1", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "content.customExpirationDuration", + }, + "notification": "FrodoTestEmailTemplate1", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate1", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(4*30*24*60*60*1000))).toISOString()", + }, + "frequency": 4, + "notification": "FrodoTestEmailTemplate1", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-7fce35a32915", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task", + "name": "approvalTask-7e33e73d6763", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Approval Task 2 - approvalTask-363e32acf981/Custom Approval Task 2 - approvalTask-363e32acf981.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-29a71d4ab8ed", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task 2", + "name": "approvalTask-363e32acf981", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Email Task - emailTask-2068f5d711c8/Custom Email Task - emailTask-2068f5d711c8.json 1`] = ` +{ + "displayName": "Custom Email Task", + "emailTask": { + "bcc": { + "isExpression": true, + "value": "// This is the bcc script +"bcc@email.com";", + }, + "cc": { + "isExpression": true, + "value": "// This is the cc script +"cc@email.com";", + }, + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-b7fc169ca4eb", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": { + "hello": "goodbye", + "hi": "hola", + }, + "templateName": "frodoTestEmailTemplateFour", + "to": { + "isExpression": true, + "value": "// This is the to script +"to@email.com";", + }, + }, + "name": "emailTask-2068f5d711c8", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Email Task 2 - emailTask-881f2975e240/Custom Email Task 2 - emailTask-881f2975e240.json 1`] = ` +{ + "displayName": "Custom Email Task 2", + "emailTask": { + "bcc": "bcc@email.com", + "cc": "cc@email.com", + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-72d593301121", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": {}, + "templateName": "frodoTestEmailTemplateFour", + "to": "to@email.com", + }, + "name": "emailTask-881f2975e240", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Fulfillment Task - fulfillmentTask-7fce35a32915/Custom Fulfillment Task - fulfillmentTask-7fce35a32915.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task", + "fulfillmentTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate2", + }, + "escalation": { + "actors": [ + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate2", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate2", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate2", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(2*30*24*60*60*1000))).toISOString()", + }, + "frequency": 2, + "notification": "FrodoTestEmailTemplate2", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "exclusiveGateway-94bc3d35f3b4", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-7fce35a32915", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task 2", + "fulfillmentTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "content.customExpirationDate", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "emailTask-881f2975e240", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-29a71d4ab8ed", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.json 1`] = ` +{ + "displayName": "Custom Inclusive Gateway", + "name": "inclusiveGateway-a6cf9605ce55", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "// This is outcome 1 +outcome === 1", + "outcome": "outcomeOne", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 2 +outcome === 2", + "outcome": "outcomeTwo", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 3 +outcome === 3", + "outcome": "outcomeThree", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.json 1`] = ` +{ + "displayName": "Custom Script Task", + "name": "scriptTask-493f5ea87636", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-2068f5d711c8", + }, + ], + "script": { + "file": "Custom Script Task - scriptTask-493f5ea87636.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.json 1`] = ` +{ + "displayName": "Custom Validation Gateway", + "name": "exclusiveGateway-94bc3d35f3b4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "// This is a validation success +outcome == true", + "outcome": "validationSuccess", + "step": "inclusiveGateway-a6cf9605ce55", + }, + { + "condition": "// This is a validation failure +outcome == false", + "outcome": "validationFailure", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Violation Task - violationTask-50261d9bc712/Custom Violation Task - violationTask-50261d9bc712.json 1`] = ` +{ + "displayName": "Custom Violation Task", + "name": "violationTask-50261d9bc712", + "type": "violationTask", + "violationTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate3", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*7*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate3", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(8*30*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate3", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate3", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "FrodoTestEmailTemplate3", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Violation Task 2 - violationTask-f8066518b46a/Custom Violation Task 2 - violationTask-f8066518b46a.json 1`] = ` +{ + "displayName": "Custom Violation Task 2", + "name": "violationTask-f8066518b46a", + "type": "violationTask", + "violationTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "approvalMode": "any", + "events": {}, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Wait Task - waitTask-b7fc169ca4eb/Custom Wait Task - waitTask-b7fc169ca4eb.json 1`] = ` +{ + "displayName": "Custom Wait Task", + "name": "waitTask-b7fc169ca4eb", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "approvalTask-363e32acf981", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*30*24*60*60*1000))).toISOString()", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Wait Task 2 - waitTask-72d593301121/Custom Wait Task 2 - waitTask-72d593301121.json 1`] = ` +{ + "displayName": "Custom Wait Task 2", + "name": "waitTask-72d593301121", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "waitTask-b343cc7df7c9", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/steps/Custom Wait Task 3 - waitTask-b343cc7df7c9/Custom Wait Task 3 - waitTask-b343cc7df7c9.json 1`] = ` +{ + "displayName": "Custom Wait Task 3", + "name": "waitTask-b343cc7df7c9", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "violationTask-f8066518b46a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "content.get('resumeDate')", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/test_workflow_4/test_workflow_4.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "test_workflow_4", + "displayName": "test_workflow_4", + "id": "testWorkflow4", + "mutable": true, + "name": "test_workflow_4", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 826, + "y": 50, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "approvalTask-7e33e73d6763", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 20, + "y": 42, + }, + "uiConfig": { + "approvalTask-363e32acf981": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + { + "id": { + "isExpression": false, + "value": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + "type": "role", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "type": "manager", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "type": "roleOwner", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 478.3999938964844, + "y": 195.6125030517578, + }, + "approvalTask-7e33e73d6763": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDuration", + "expirationTimeSpan": "hour(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "reminderDate": 4, + "reminderTimeSpan": "month(s)", + }, + "x": 146.39999389648438, + "y": 15.61250305175781, + }, + "emailTask-2068f5d711c8": { + "x": 150.39999389648438, + "y": 648.812502861023, + }, + "emailTask-881f2975e240": { + "x": 478.3999938964844, + "y": 474.41250228881836, + }, + "exclusiveGateway-94bc3d35f3b4": { + "x": 145.39999389648438, + "y": 274.6125030517578, + }, + "fulfillmentTask-29a71d4ab8ed": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDate", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 479.3999938964844, + "y": 334.41250228881836, + }, + "fulfillmentTask-7fce35a32915": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "hour(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "reminderDate": 2, + "reminderTimeSpan": "month(s)", + }, + "x": 145.39999389648438, + "y": 146.6125030517578, + }, + "inclusiveGateway-a6cf9605ce55": { + "x": 147.39999389648438, + "y": 405.6125030517578, + }, + "scriptTask-493f5ea87636": { + "x": 148.39999389648438, + "y": 570.6125030517578, + }, + "violationTask-50261d9bc712": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "week(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "reminderDate": 3, + "reminderTimeSpan": "hour(s)", + }, + "x": 480.3999938964844, + "y": 13.61250305175781, + }, + "violationTask-f8066518b46a": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationType": "applicationOwner", + "expirationDateType": "variable", + "expirationDateVariable": "taskExpirationDate", + "reassignedActors": [], + }, + "x": 788.3999938964844, + "y": 613.4125022888184, + }, + "waitTask-72d593301121": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 476.3999938964844, + "y": 612.4125022888184, + }, + "waitTask-b343cc7df7c9": { + "events": { + "resumeDateNumber": 1, + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "variable", + "resumeDateVariable": "resumeDate", + }, + "x": 476.3999938964844, + "y": 694.4125022888184, + }, + "waitTask-b7fc169ca4eb": { + "events": { + "resumeDateNumber": 5, + "resumeDateTimeSpan": "month(s)", + "resumeDateType": "duration", + }, + "x": 148.39999389648438, + "y": 779.812502861023, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Approval Task - approvalTask-63163dc11c1f/Approval Task - approvalTask-63163dc11c1f.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.entitlementOwner[0].id ? "managed/user/" + requestIndex.entitlementOwner[0].id : "managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "frequency": 7, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-5106f7a29d86", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-63163dc11c1f", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Approval - scriptTask-e21178ab80f7/Auto Approval - scriptTask-e21178ab80f7.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var lineItemId = content.get('lineItemId'); +var queryParams = { + "_action": "update" +} +var lineItemParams = { + "_action": "updateRemediationStatus" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to request context: " + context + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); + + +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Approval - scriptTask-e21178ab80f7/Auto Approval - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Auto Approval", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Auto Approval - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Provisioning - scriptTask-0359a9d77ee2/Auto Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Auto-Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Provisioning - scriptTask-0359a9d77ee2/Auto Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Auto Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-63163dc11c1f", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + e.message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Privileged - scriptTask-5106f7a29d86/Entitlement Privileged - scriptTask-5106f7a29d86.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var requestObj = null; +var entId = null; +var entGlossary = null; +var entPriv = null; + +//Check entitlement exists and grab entitlement info +try { + requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + entId = requestObj.assignment.id; +} +catch (e) { + logger.info("Validation failed: Error reading entitlement grant request with id " + requestId); +} +//Check glossary for entitlement exists and grab glossary info +try { + entGlossary = openidm.action('iga/governance/resource/' + entId + '/glossary', 'GET', {}, {}); + // Sets entPriv based on the glossary contents, if present, otherwise defaults to true + entPriv = (entGlossary.hasOwnProperty("isPrivileged")) ? entGlossary.isPrivileged : true; + //Sets entPriv based on glossary contents, if present, otherwise defaults to false + //entPriv = !!entGlossary.isPrivileged; + execution.setVariable("entPriv", entPriv); +} +catch (e) { + logger.info("Could not retrieve glossary with entId " + entId + " from entitlement grant request ID " + requestId); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Privileged - scriptTask-5106f7a29d86/Entitlement Privileged - scriptTask-5106f7a29d86.json 1`] = ` +{ + "displayName": "Entitlement Privileged", + "name": "scriptTask-5106f7a29d86", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-bcb05a148971", + }, + ], + "script": { + "file": "Entitlement Privileged - scriptTask-5106f7a29d86.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Inclusive Gateway - inclusiveGateway-bcb05a148971/Inclusive Gateway - inclusiveGateway-bcb05a148971.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Inclusive Gateway - inclusiveGateway-bcb05a148971/Inclusive Gateway - inclusiveGateway-bcb05a148971.json 1`] = ` +{ + "displayName": "Inclusive Gateway", + "name": "inclusiveGateway-bcb05a148971", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "entPriv == true", + "outcome": "Privileged", + "step": "approvalTask-77691047b28d", + }, + { + "condition": "entPriv == false", + "outcome": "NotPrivileged", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Inclusive Gateway - inclusiveGateway-bcb05a148971.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Manager Approval - approvalTask-77691047b28d/Manager Approval - approvalTask-77691047b28d.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.user.manager._refResourceId", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "frequency": 7, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-3eab1948f1ec", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Manager Approval", + "name": "approvalTask-77691047b28d", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info("Execution Content: " + content); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var skipApproval = false; +var lineItemId = false; +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + lineItemId = requestObj.request.common.context.lineItemId; + if (context == 'admin') { + skipApproval = true; + } + } +} +catch (e) { + logger.info("Request Context Check failed "+e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("lineItemId", lineItemId); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style": igaTestDir01/iga/workflows/wfEntitlementExampleIsPrivileged/wfEntitlementExampleIsPrivileged.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "wfEntitlementExampleIsPrivileged", + "displayName": "wfEntitlementExampleIsPrivileged", + "id": "wfEntitlementExampleIsPrivileged", + "mutable": true, + "name": "wfEntitlementExampleIsPrivileged", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2262, + "y": 220, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 176, + }, + "uiConfig": { + "approvalTask-63163dc11c1f": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.entitlementOwner[0].id ? "managed/user/" + requestIndex.entitlementOwner[0].id : "managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 265, + }, + "approvalTask-77691047b28d": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.user.manager._refResourceId", + }, + "type": "manager", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1219, + "y": 273, + }, + "exclusiveGateway-48e748c42994": { + "x": 1917, + "y": 104, + }, + "exclusiveGateway-67a954f33919": { + "x": 462, + "y": 155, + }, + "inclusiveGateway-bcb05a148971": { + "x": 1216, + "y": 99, + }, + "scriptTask-0359a9d77ee2": { + "x": 1924, + "y": 258.6666666666667, + }, + "scriptTask-0b56191887de": { + "x": 1907, + "y": 367.33333333333337, + }, + "scriptTask-3eab1948f1ec": { + "x": 1532, + "y": 151.66666666666669, + }, + "scriptTask-5106f7a29d86": { + "x": 940, + "y": 210, + }, + "scriptTask-aec6c36b3a45": { + "x": 1567, + "y": 274.33333333333337, + }, + "scriptTask-e04f42607ba5": { + "x": 181, + "y": 178, + }, + "scriptTask-e21178ab80f7": { + "x": 724, + "y": 101, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style" 1`] = `0`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style" 2`] = `""`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style" 3`] = ` +"Experimental feature in use: 'frodo config-manager pull iga-workflows'. This feature may change without notice. +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/BasicApplicationGrant.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "Basic request flow for granting a user an account in an application", + "displayName": "Basic Application Grant", + "id": "BasicApplicationGrant", + "mutable": false, + "name": "BasicApplicationGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2822, + "y": 352, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 682, + "y": 155, + }, + "exclusiveGateway-5167870154a9": { + "x": 1855, + "y": 84, + }, + "exclusiveGateway-621c9996676a": { + "x": 433, + "y": 117.015625, + }, + "inclusiveGateway-7d248125a9bd": { + "x": 2417, + "y": 43.015625, + }, + "inclusiveGateway-a71e67faaad1": { + "x": 1124, + "y": 93.015625, + }, + "scriptTask-0e5b6187ea62": { + "x": 889, + "y": 116.015625, + }, + "scriptTask-14acc58c28dd": { + "x": 2650, + "y": 85.015625, + }, + "scriptTask-3a74557440fb": { + "x": 2144, + "y": 62, + }, + "scriptTask-4e9121fe850a": { + "x": 168, + "y": 140.015625, + }, + "scriptTask-626899b6e99a": { + "x": 1549, + "y": 108, + }, + "scriptTask-744ef6a8b9a2": { + "x": 2151, + "y": 207.015625, + }, + "scriptTask-c58309b8c470": { + "x": 1554, + "y": 242, + }, + "waitTask-13cf96ebeb37": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + "resumeDateVariable": "startDate", + }, + "x": 1339, + "y": 85.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Application Grant Validation - scriptTask-626899b6e99a/Application Grant Validation - scriptTask-626899b6e99a.js 1`] = ` +"logger.info("Running application grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var app = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check the user does not already have application granted +// Note: this is done at request submission time as well, the following is an example of how to check user's accounts +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + failureReason = "Validation failed: User with id " + requestObj.user.id + " already has effective application " + applicationId; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check effective applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Application Grant Validation - scriptTask-626899b6e99a/Application Grant Validation - scriptTask-626899b6e99a.json 1`] = ` +{ + "displayName": "Application Grant Validation", + "name": "scriptTask-626899b6e99a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-5167870154a9", + }, + ], + "script": { + "file": "Application Grant Validation - scriptTask-626899b6e99a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Application Grant Validation Failure - scriptTask-744ef6a8b9a2/Application Grant Validation Failure - scriptTask-744ef6a8b9a2.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Application Grant Validation Failure - scriptTask-744ef6a8b9a2/Application Grant Validation Failure - scriptTask-744ef6a8b9a2.json 1`] = ` +{ + "displayName": "Application Grant Validation Failure", + "name": "scriptTask-744ef6a8b9a2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Application Grant Validation Failure - scriptTask-744ef6a8b9a2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-621c9996676a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-621c9996676a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Create Removal Request - scriptTask-14acc58c28dd/Create Removal Request - scriptTask-14acc58c28dd.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "applicationId": request.common.applicationId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/applicationRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.info("Create Removal Request failed to create request") + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Create Removal Request - scriptTask-14acc58c28dd/Create Removal Request - scriptTask-14acc58c28dd.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-14acc58c28dd", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-14acc58c28dd.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Has End Date - inclusiveGateway-7d248125a9bd/Has End Date - inclusiveGateway-7d248125a9bd.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Has End Date - inclusiveGateway-7d248125a9bd/Has End Date - inclusiveGateway-7d248125a9bd.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-7d248125a9bd", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-14acc58c28dd", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-7d248125a9bd.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Has Start Date - inclusiveGateway-a71e67faaad1/Has Start Date - inclusiveGateway-a71e67faaad1.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Has Start Date - inclusiveGateway-a71e67faaad1/Has Start Date - inclusiveGateway-a71e67faaad1.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-a71e67faaad1", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-13cf96ebeb37", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-626899b6e99a", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-a71e67faaad1.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Provisioning - scriptTask-3a74557440fb/Provisioning - scriptTask-3a74557440fb.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "applicationId": request.common.applicationId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning account to user " + request.common.userId + " for application " + request.common.applicationId + ". Error message: " + message; + } + + var decision = {'status': 'complete'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Provisioning - scriptTask-3a74557440fb/Provisioning - scriptTask-3a74557440fb.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-3a74557440fb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-7d248125a9bd", + }, + ], + "script": { + "file": "Provisioning - scriptTask-3a74557440fb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if (skipApproval) { + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-0e5b6187ea62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-a71e67faaad1", + }, + ], + "script": { + "file": "Request Approved - scriptTask-0e5b6187ea62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-621c9996676a", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Validation Gateway - exclusiveGateway-5167870154a9/Validation Gateway - exclusiveGateway-5167870154a9.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Validation Gateway - exclusiveGateway-5167870154a9/Validation Gateway - exclusiveGateway-5167870154a9.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-5167870154a9", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationSuccess", + "step": "scriptTask-3a74557440fb", + }, + { + "condition": "failureReason != null", + "outcome": "validationFailure", + "step": "scriptTask-744ef6a8b9a2", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-5167870154a9.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant/steps/Wait Task - waitTask-13cf96ebeb37/Wait Task - waitTask-13cf96ebeb37.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-13cf96ebeb37", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-626899b6e99a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant-copy/BasicApplicationGrant-copy.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "BasicApplicationGrant-copy", + "displayName": "BasicApplicationGrant-copy", + "id": "basicApplicationGrantCopy", + "mutable": true, + "name": "BasicApplicationGrant-copy", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 942, + "y": 82, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 683, + "y": 154, + }, + "exclusiveGateway-621c9996676a": { + "x": 454, + "y": 88.015625, + }, + "scriptTask-4e9121fe850a": { + "x": 168, + "y": 140.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant-copy/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": null, + }, + { + "condition": null, + "outcome": "REJECT", + "step": null, + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant-copy/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant-copy/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-621c9996676a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "approvalTask-74cf85c35437", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-621c9996676a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant-copy/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"try { +var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +} catch (e) { + logger.error(e.message) +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationGrant-copy/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-621c9996676a", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/BasicApplicationRemove.json 1`] = ` +{ + "_rev": 8, + "childType": false, + "description": "Basic request flow for removing a user's account in an application", + "displayName": "Basic Application Remove", + "id": "BasicApplicationRemove", + "mutable": false, + "name": "BasicApplicationRemove", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2087, + "y": 210, + }, + "startNode": { + "connections": { + "start": "scriptTask-b80009644545", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 726, + "y": 162, + }, + "exclusiveGateway-2bf686c17905": { + "x": 457, + "y": 95.015625, + }, + "inclusiveGateway-0c53868eeb2a": { + "x": 1125, + "y": 59.015625, + }, + "scriptTask-626899b6e99a": { + "x": 1713, + "y": 102, + }, + "scriptTask-b80009644545": { + "x": 164, + "y": 108.015625, + }, + "scriptTask-ba009484a101": { + "x": 887, + "y": 68.015625, + }, + "scriptTask-c58309b8c470": { + "x": 1714, + "y": 207, + }, + "waitTask-0431eab1902c": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.endDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1352, + "y": 75.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-ba009484a101", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Context Gateway - exclusiveGateway-2bf686c17905/Context Gateway - exclusiveGateway-2bf686c17905.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Context Gateway - exclusiveGateway-2bf686c17905/Context Gateway - exclusiveGateway-2bf686c17905.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-2bf686c17905", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-ba009484a101", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-2bf686c17905.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Deprovisioning - scriptTask-626899b6e99a/Deprovisioning - scriptTask-626899b6e99a.js 1`] = ` +"logger.info("Deprovisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var context = content.get('context'); +var lineItemId = content.get('lineItemId'); + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +} +catch (e) { + failureReason = "Deprovisioning failed: Error reading request with id " + requestId; +} + +// Create object to update final request progress +var decision = { 'status': 'complete', 'decision': 'approved' }; + +if (!failureReason) { + try { + var request = requestObj.request; + var payload = { + "applicationId": request.common.applicationId, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "remove", + "initiatingUser": requestObj.requester.id + } + + logger.info("Removing account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications', 'POST', payload, queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Deprovisioning failed: Error deprovisioning account to user " + request.common.userId + " for application " + request.common.applicationId + ". Error message: " + message; + } +} + +if (context == 'certification') { + // If application removal request is created via certification, update the corresponding certification item with remediation status. + try { + var remediationStatus = failureReason ? "failed" : "complete" + var comment = failureReason ? "Unable to remove the account successfully, remediation failed." : "Account has been removed from user successfully, remediation complete." + var body = { + "remediationStatus": remediationStatus, + "comment": comment + } + var lineItemParams = { + "_action": "updateRemediationStatus" + } + openidm.action('iga/governance/certification/items/' + lineItemId, 'POST', body, lineItemParams); + } + catch (e) { + failureReason = "Unable to update the certification line item " + lineItemId + " with the final remediation status from this request." + } +} + +// Set additional properties on the request progress update +if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; +} +else { + decision.outcome = 'provisioned'; +} + +// Update final request progress +var queryParams = { '_action': 'update' }; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Deprovisioning - scriptTask-626899b6e99a/Deprovisioning - scriptTask-626899b6e99a.json 1`] = ` +{ + "displayName": "Deprovisioning", + "name": "scriptTask-626899b6e99a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Deprovisioning - scriptTask-626899b6e99a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Has End Date - inclusiveGateway-0c53868eeb2a/Has End Date - inclusiveGateway-0c53868eeb2a.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Has End Date - inclusiveGateway-0c53868eeb2a/Has End Date - inclusiveGateway-0c53868eeb2a.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-0c53868eeb2a", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasEndDate", + "step": "waitTask-0431eab1902c", + }, + { + "condition": "enableWait == false", + "outcome": "noEndDate", + "step": "scriptTask-626899b6e99a", + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-0c53868eeb2a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Request Approval - scriptTask-ba009484a101/Request Approval - scriptTask-ba009484a101.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved" + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Request Approval - scriptTask-ba009484a101/Request Approval - scriptTask-ba009484a101.json 1`] = ` +{ + "displayName": "Request Approval", + "name": "scriptTask-ba009484a101", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-0c53868eeb2a", + }, + ], + "script": { + "file": "Request Approval - scriptTask-ba009484a101.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Request Context Check - scriptTask-b80009644545/Request Context Check - scriptTask-b80009644545.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var skipApproval = false; +var lineItemId = null; +var campaignId = null; +var enableWait = false; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + // Set execution variables from the request context + context = requestObj.request.common.context.type; + if (context == 'admin' || context == 'certification') { + skipApproval = true; + } + if (context == 'certification') { + lineItemId = requestObj.request.common.context.lineItemId; + campaignId = requestObj.request.common.context.campaignId + + // Add a comment on the certification item denoting the request ID + var commentResp = openidm.action('/iga/governance/certification/' + campaignId + '/items/comment', 'POST', { "ids": [lineItemId], "comment": "ID of application removal request: " + requestId }, {}) + } + + } + if (requestObj.request.common.endDate){ + enableWait = true; + } +} +catch (e) { + logger.info("Could not validate request context, normal approval process will be followed.") +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("lineItemId", lineItemId); +execution.setVariable("enableWait", enableWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Request Context Check - scriptTask-b80009644545/Request Context Check - scriptTask-b80009644545.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-b80009644545", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-2bf686c17905", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-b80009644545.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicApplicationRemove/steps/Wait Task - waitTask-0431eab1902c/Wait Task - waitTask-0431eab1902c.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0431eab1902c", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-626899b6e99a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.endDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/BasicEntitlementGrant.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "Basic request flow for granting a user an entitlement in an application", + "displayName": "Basic Entitlement Grant", + "id": "BasicEntitlementGrant", + "mutable": false, + "name": "BasicEntitlementGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2597, + "y": 322, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-48e748c42994": { + "x": 1731, + "y": 88.015625, + }, + "exclusiveGateway-67a954f33919": { + "x": 467, + "y": 121.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 948, + "y": 57.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2255, + "y": 48.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1972, + "y": 119.015625, + }, + "scriptTask-0b56191887de": { + "x": 1979, + "y": 212.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1434, + "y": 95.015625, + }, + "scriptTask-91769554db51": { + "x": 2561, + "y": 74.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1441, + "y": 268.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 186, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 716, + "y": 74.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1208, + "y": 30.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/BasicEntitlementGrant-copy.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "BasicEntitlementGrant-copy", + "displayName": "BasicEntitlementGrant-copy", + "id": "basicEntitlementGrantCopy", + "mutable": true, + "name": "BasicEntitlementGrant-copy", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2597, + "y": 322, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-48e748c42994": { + "x": 1731, + "y": 88.015625, + }, + "exclusiveGateway-67a954f33919": { + "x": 467, + "y": 121.015625, + }, + "exclusiveGateway-89dc2f9576ee": { + "x": 452, + "y": 488.015625, + }, + "exclusiveGateway-ad04bf17ac62": { + "x": 336, + "y": 306.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 948, + "y": 57.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2255, + "y": 48.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1972, + "y": 119.015625, + }, + "scriptTask-0b56191887de": { + "x": 1979, + "y": 212.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1434, + "y": 95.015625, + }, + "scriptTask-55aced130632": { + "x": 686, + "y": 351.015625, + }, + "scriptTask-91769554db51": { + "x": 2561, + "y": 74.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1441, + "y": 268.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 185, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 716, + "y": 73.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1208, + "y": 30.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Context Gateway - exclusiveGateway-89dc2f9576ee/Custom Context Gateway - exclusiveGateway-89dc2f9576ee.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Context Gateway - exclusiveGateway-89dc2f9576ee/Custom Context Gateway - exclusiveGateway-89dc2f9576ee.json 1`] = ` +{ + "displayName": "Custom Context Gateway", + "name": "exclusiveGateway-89dc2f9576ee", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-55aced130632", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Custom Context Gateway - exclusiveGateway-89dc2f9576ee.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Request Approved - scriptTask-55aced130632/Custom Request Approved - scriptTask-55aced130632.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request type custom auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Custom Request Approved - scriptTask-55aced130632/Custom Request Approved - scriptTask-55aced130632.json 1`] = ` +{ + "displayName": "Custom Request Approved", + "name": "scriptTask-55aced130632", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Custom Request Approved - scriptTask-55aced130632.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + failureReason = "Request Object" + requestObj + ":"; + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason += " Validation failed: Error reading request with id " + requestId + "More detail is content:" + content; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* + * Script Node: Context & Type Check + * Purpose: Reads request context and entitlement type to set routing outcomes. + * Sets: context, skipApproval, entitlementType, entitlementId, userId, failureReason + */ + +logger.info("BasicEntitlementGrant (Custom) - Context & Type Check"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +var entitlementType = null; +var entitlementId = null; +var userId = null; +var failureReason = null; + + // Read request object +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + // --- Context check (admin requests skip approval) --- + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } + // --- User --- + userId = requestObj.request.common.userId; + + // --- Entitlement type routing --- + // The entitlement object on the request exposes a 'type' field. + // Internal/system roles exposed as entitlements should carry type: 'custom'. + if (requestObj.entitlement && requestObj.entitlement.type) { + entitlementType = requestObj.entitlement.type; + entitlementId = requestObj.entitlement.id; + } else { + // Fallback: treat as standard if type is absent + entitlementType = 'standard'; + } + +} catch (e) { + failureReason = 'Context & Type Check failed: ' + e.message; + logger.error(failureReason); +} + +logger.info("Context: " + context + " | EntitlementType: " + entitlementType + " | UserId: " + userId); + +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +execution.setVariable("entitlementType", entitlementType); +execution.setVariable("entitlementId", entitlementId); +execution.setVariable("userId", userId); +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-ad04bf17ac62", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Type Gateway - exclusiveGateway-ad04bf17ac62/Type Gateway - exclusiveGateway-ad04bf17ac62.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Type Gateway - exclusiveGateway-ad04bf17ac62/Type Gateway - exclusiveGateway-ad04bf17ac62.json 1`] = ` +{ + "displayName": "Type Gateway", + "name": "exclusiveGateway-ad04bf17ac62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "entitlementType != 'custom'", + "outcome": "validationSuccess", + "step": "exclusiveGateway-67a954f33919", + }, + { + "condition": "entitlementType == 'custom'", + "outcome": "validationFailure", + "step": "exclusiveGateway-89dc2f9576ee", + }, + ], + "script": { + "file": "Type Gateway - exclusiveGateway-ad04bf17ac62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementGrant-copy/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/BasicEntitlementRemove.json 1`] = ` +{ + "_rev": 8, + "childType": false, + "description": "Basic request flow for removing an entitlement from a user", + "displayName": "Basic Entitlement Remove", + "id": "BasicEntitlementRemove", + "mutable": false, + "name": "BasicEntitlementRemove", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1883, + "y": 97, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 725, + "y": 59, + }, + "exclusiveGateway-abbb089758c8": { + "x": 433, + "y": 89.015625, + }, + "inclusiveGateway-8803458e3a77": { + "x": 1039, + "y": 54.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1556, + "y": 85.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1561, + "y": 205.015625, + }, + "scriptTask-ca9504ae90d8": { + "x": 136, + "y": 111.015625, + }, + "scriptTask-e8842de66fbb": { + "x": 901, + "y": 243.015625, + }, + "waitTask-b6e654628b18": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.endDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1279, + "y": 94.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e8842de66fbb", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-abbb089758c8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-e8842de66fbb", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-abbb089758c8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Deprovisioning - scriptTask-0359a9d77ee2/Deprovisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Deprovisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var context = content.get('context'); +var lineItemId = content.get('lineItemId'); + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +} +catch (e) { + failureReason = "Deprovisioning failed: Error reading request with id " + requestId; +} + +// Create object to update final request progress +var decision = { 'status': 'complete', 'decision': 'approved' }; + +if (!failureReason) { + try { + // Remove entitlement grant from user + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "remove", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements', 'POST', payload, queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Deprovisioning failed: Error deprovisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } +} + +if (context == 'certification') { + // If entitlement removal request is created via certification, update the corresponding certification item with remediation status. + try { + var remediationStatus = failureReason ? "failed" : "complete" + var comment = failureReason ? "Unable to remove the entitlement successfully, remediation failed." : "Entitlement has been removed from user successfully, remediation complete." + var body = { + "remediationStatus": remediationStatus, + "comment": comment + } + var lineItemParams = { + "_action": "updateRemediationStatus" + } + openidm.action('iga/governance/certification/items/' + lineItemId, 'POST', body, lineItemParams); + } + catch (e) { + failureReason = "Unable to update the certification line item " + lineItemId + " with the final remediation status from this request." + } +} + +// Set additional properties on the request progress update +if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; +} +else { + decision.outcome = 'provisioned'; +} + +// Update final request progress +var queryParams = { '_action': 'update' }; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Deprovisioning - scriptTask-0359a9d77ee2/Deprovisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Deprovisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Deprovisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Has End Date - inclusiveGateway-8803458e3a77/Has End Date - inclusiveGateway-8803458e3a77.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Has End Date - inclusiveGateway-8803458e3a77/Has End Date - inclusiveGateway-8803458e3a77.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-8803458e3a77", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasEndDate", + "step": "waitTask-b6e654628b18", + }, + { + "condition": "enableWait == false", + "outcome": "noEndDate", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-8803458e3a77.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Request Approved - scriptTask-e8842de66fbb/Request Approved - scriptTask-e8842de66fbb.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Request Approved - scriptTask-e8842de66fbb/Request Approved - scriptTask-e8842de66fbb.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e8842de66fbb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-8803458e3a77", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e8842de66fbb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Request Context Check - scriptTask-ca9504ae90d8/Request Context Check - scriptTask-ca9504ae90d8.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var skipApproval = false; +var lineItemId = null; +var campaignId = null; +var enableWait = false; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + // Set execution variables from the request context + context = requestObj.request.common.context.type; + if (context == 'admin' || context == 'certification') { + skipApproval = true; + } + if (context == 'certification') { + lineItemId = requestObj.request.common.context.lineItemId; + campaignId = requestObj.request.common.context.campaignId + + // Add a comment on the certification item denoting the request ID + var commentResp = openidm.action('/iga/governance/certification/' + campaignId + '/items/comment', 'POST', { "ids": [lineItemId], "comment": "ID of entitlement removal request: " + requestId }, {}) + } + + } + if (requestObj.request.common.endDate){ + enableWait = true; + } +} +catch (e) { + logger.info("Could not validate request context, normal approval process will be followed.") +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("lineItemId", lineItemId); +execution.setVariable("enableWait", enableWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Request Context Check - scriptTask-ca9504ae90d8/Request Context Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-abbb089758c8", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicEntitlementRemove/steps/Wait Task - waitTask-b6e654628b18/Wait Task - waitTask-b6e654628b18.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-b6e654628b18", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.endDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/BasicRoleCreate.json 1`] = ` +{ + "_rev": 4, + "childType": false, + "description": "Basic workflow for creating a governance role", + "displayName": "BasicRoleCreate", + "id": "BasicRoleCreate", + "mutable": false, + "name": "BasicRoleCreate", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1170, + "y": 232, + }, + "startNode": { + "connections": { + "start": "scriptTask-3eab1948f1ec", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "exclusiveGateway-05b2e1af4b79": { + "x": 485.6666564941406, + "y": 135.66665649414062, + }, + "scriptTask-0359a9d77ee2": { + "x": 782, + "y": 175.015625, + }, + "scriptTask-0b56191887de": { + "x": 782, + "y": 289.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 216, + "y": 149.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Create Role - scriptTask-3eab1948f1ec/Create Role - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info('Running role create request'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var role = null; +var failureReason = null; +var roleId = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj) { + role = requestObj.request.role; + } else { + failureReason = 'Governance role creation failed: Error reading request with id ' + requestId + ' requestObj: ' + requestObj; + } +} +catch (e) { + failureReason = 'Governance role creation failed: Error reading request with id ' + requestId + ' Error: ' + e.message; +} + +if (role) { + if (!role.object) { + failureReason = 'Governance role creation failed: Request with id: ' + requestId + ' has no role info.'; + } +} else { + failureReason = 'Governance role creation failed: Request with id: ' + requestId + ' has no role object.'; +} + +if (!failureReason) { + try { + var payload = { role: {} }; + payload.role = role.object; + if(role.glossary){ + payload.glossary = role.glossary; + } + payload.updateIdm = true; + var result = openidm.action('iga/governance/role/', 'POST', payload); + roleId = result.role.id + } + catch (e) { + failureReason = 'Governance role creation failed: Error message: ' + e.message; + } +} + +if (failureReason) { + logger.info('Governance role creation failed: ' + failureReason); +} +execution.setVariable('failureReason', failureReason); +execution.setVariable('roleId', roleId); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Create Role - scriptTask-3eab1948f1ec/Create Role - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Create Role", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-05b2e1af4b79", + }, + ], + "script": { + "file": "Create Role - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Role Create Validation Failure - scriptTask-0b56191887de/Role Create Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'cancelled', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Role Create Validation Failure - scriptTask-0b56191887de/Role Create Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Role Create Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Role Create Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Update Request - scriptTask-0359a9d77ee2/Update Request - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info('Creating Governance Role'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var roleId = content.get('roleId'); +var decision = { + 'status': 'complete', + 'decision': 'approved', + 'outcome': 'fulfilled', + 'comment': 'Role ID: ' + roleId +}; + +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info('Request ' + requestId + ' completed.'); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Update Request - scriptTask-0359a9d77ee2/Update Request - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Update Request", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Update Request - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Validation Gateway - exclusiveGateway-05b2e1af4b79/Validation Gateway - exclusiveGateway-05b2e1af4b79.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleCreate/steps/Validation Gateway - exclusiveGateway-05b2e1af4b79/Validation Gateway - exclusiveGateway-05b2e1af4b79.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-05b2e1af4b79", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "createSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "createFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-05b2e1af4b79.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/BasicRoleDelete.json 1`] = ` +{ + "_rev": 4, + "childType": false, + "description": "Basic workflow for deleting a governance role", + "displayName": "BasicRoleDelete", + "id": "BasicRoleDelete", + "mutable": false, + "name": "BasicRoleDelete", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1806, + "y": 273, + }, + "startNode": { + "connections": { + "start": "scriptTask-3eab1948f1ec", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + return [{ + "id": content.get('roleOwner'), + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "script", + "expirationDate": 1, + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 948, + "y": 198, + }, + "exclusiveGateway-48e748c42994": { + "x": 511, + "y": 126.015625, + }, + "exclusiveGateway-b16f45452faa": { + "x": 753.6666564941406, + "y": 34.666656494140625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1286, + "y": 107.015625, + }, + "scriptTask-0b56191887de": { + "x": 1011, + "y": 529.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 197, + "y": 142.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1195, + "y": 346.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + return [{ + "id": content.get('roleOwner'), + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/b89b1128-52a3-4cac-a04d-56cad0f14203", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*1*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [ + { + "id": "managed/user/b89b1128-52a3-4cac-a04d-56cad0f14203", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(1*24*60*60*1000))).toISOString()", + }, + "frequency": 1, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "EXPIRATION", + "step": null, + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Auto Approval Gateway - exclusiveGateway-b16f45452faa/Auto Approval Gateway - exclusiveGateway-b16f45452faa.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Auto Approval Gateway - exclusiveGateway-b16f45452faa/Auto Approval Gateway - exclusiveGateway-b16f45452faa.json 1`] = ` +{ + "displayName": "Auto Approval Gateway", + "name": "exclusiveGateway-b16f45452faa", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Auto Approval Gateway - exclusiveGateway-b16f45452faa.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Delete Role - scriptTask-0359a9d77ee2/Delete Role - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info('Deleting Governance Role'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); +var decision = {}; +var request = null; + +if(!failureReason) { + try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info('requestObj: ' + requestObj); + request = requestObj.request; + } + catch (e) { + failureReason = 'Governance role deletion failed: Error reading request with id ' + requestId; + } + + if(!failureReason) { + try { + openidm.action('iga/governance/role/' + request.role.roleId + '/' + request.role.status, 'DELETE', {}, {}); + } + catch (e) { + failureReason = 'Governance role deletion failed: Error deleting role ' + request.role.roleId + ', status: ' + request.role.status + '. Error message: ' + e.message; + } + + decision = { + 'status': 'complete', + 'decision': 'approved', + 'outcome': 'fulfilled' + }; + } +} + +if(failureReason) { + decision = { + 'status': 'complete', + 'decision': 'approved', + 'outcome': 'cancelled', + 'failure': true, + 'comment': failureReason + }; + logger.info('Delete failed: ' + failureReason); +} + +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info('Request ' + requestId + ' completed.'); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Delete Role - scriptTask-0359a9d77ee2/Delete Role - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Delete Role", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Delete Role - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info('Rejecting request'); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info('Execution Content: ' + content); + +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Role Delete Validation Failure - scriptTask-0b56191887de/Role Delete Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'cancelled', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Role Delete Validation Failure - scriptTask-0b56191887de/Role Delete Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Role Delete Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Role Delete Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Role Validation and Status Check - scriptTask-3eab1948f1ec/Role Validation and Status Check - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info('Running role delete request validation'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var skipApproval = false; +var role = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj) { + role = requestObj.request.role; + } else { + failureReason = 'Validation failed: Error reading request with id ' + requestId + ' requestObj: ' + requestObj; + } +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId + ' Error: ' + e.message; +} + +// Validation - Check original role and role owner exists +if (!failureReason) { + try { + var result = openidm.action('iga/governance/role/' + role.roleId + '/' + role.status, 'GET', {}, {}); + if (!result) { + failureReason = 'Validation failed: Cannot find role with id ' + role.roleId + ', status: ' + role.status; + } else { + if (role.status != 'active') { + skipApproval = true; + } else { + try { + execution.setVariable('roleOwner', role.glossary.idx['/role'].roleOwner); + } catch(e) { + failureReason = 'Validation failed: No role owner set for role with id ' + roleId + ', status: draft'; + } + } + } + } + catch (e) { + failureReason = 'Validation failed: Error reading role with id ' + role.roleId + ', status: ' + role.status + '. Error message: ' + e.message; + } +} + +if (failureReason) { + logger.info('Validation failed: ' + failureReason); +} +execution.setVariable('failureReason', failureReason); +execution.setVariable('skipApproval', skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Role Validation and Status Check - scriptTask-3eab1948f1ec/Role Validation and Status Check - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Role Validation and Status Check", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Role Validation and Status Check - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleDelete/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "exclusiveGateway-b16f45452faa", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/BasicRoleGrant.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "Basic request flow for adding a user to a role", + "displayName": "Basic Role Grant", + "id": "BasicRoleGrant", + "mutable": false, + "name": "BasicRoleGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2889, + "y": 467, + }, + "startNode": { + "connections": { + "start": "scriptTask-d76490953517", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-c7867dd2593a": { + "actors": [ + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "type": "roleOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 727, + "y": 144.015625, + }, + "exclusiveGateway-48e748c42994": { + "x": 1694, + "y": 23.015625, + }, + "exclusiveGateway-8cd9decab2e4": { + "x": 453, + "y": 120.015625, + }, + "inclusiveGateway-57e9b96eb570": { + "x": 939, + "y": 39.015625, + }, + "inclusiveGateway-d18d59004c0c": { + "x": 2288, + "y": 68.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1941, + "y": 65.015625, + }, + "scriptTask-0b56191887de": { + "x": 1939, + "y": 149.015625, + }, + "scriptTask-32dada3fc9f9": { + "x": 2551, + "y": 102.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1428, + "y": 56.015625, + }, + "scriptTask-8506123e6208": { + "x": 721, + "y": 41.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1399, + "y": 325.015625, + }, + "scriptTask-d76490953517": { + "x": 161, + "y": 142.015625, + }, + "waitTask-4e25b1ee7a14": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1165, + "y": 13.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Approval Task - approvalTask-c7867dd2593a/Approval Task - approvalTask-c7867dd2593a.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-8506123e6208", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-c7867dd2593a", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Context Gateway - exclusiveGateway-8cd9decab2e4/Context Gateway - exclusiveGateway-8cd9decab2e4.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Context Gateway - exclusiveGateway-8cd9decab2e4/Context Gateway - exclusiveGateway-8cd9decab2e4.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-8cd9decab2e4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-8506123e6208", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-c7867dd2593a", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-8cd9decab2e4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Create Removal Request - scriptTask-32dada3fc9f9/Create Removal Request - scriptTask-32dada3fc9f9.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + + if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "roleId": request.common.roleId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/roleRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.info('Create Removal Request creation failed') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Create Removal Request - scriptTask-32dada3fc9f9/Create Removal Request - scriptTask-32dada3fc9f9.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-32dada3fc9f9", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-32dada3fc9f9.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Has End Date - inclusiveGateway-d18d59004c0c/Has End Date - inclusiveGateway-d18d59004c0c.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Has End Date - inclusiveGateway-d18d59004c0c/Has End Date - inclusiveGateway-d18d59004c0c.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-d18d59004c0c", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-32dada3fc9f9", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-d18d59004c0c.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Has Start Date - inclusiveGateway-57e9b96eb570/Has Start Date - inclusiveGateway-57e9b96eb570.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Has Start Date - inclusiveGateway-57e9b96eb570/Has Start Date - inclusiveGateway-57e9b96eb570.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-57e9b96eb570", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-4e25b1ee7a14", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-57e9b96eb570.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "roleId": request.common.roleId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/roles' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning role to user " + request.common.userId + " for role " + request.common.roleId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-d18d59004c0c", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Request Approved - scriptTask-8506123e6208/Request Approved - scriptTask-8506123e6208.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved" + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Request Approved - scriptTask-8506123e6208/Request Approved - scriptTask-8506123e6208.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-8506123e6208", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-57e9b96eb570", + }, + ], + "script": { + "file": "Request Approved - scriptTask-8506123e6208.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Request Context Check - scriptTask-d76490953517/Request Context Check - scriptTask-d76490953517.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var skipApproval = false; +var enableWait = false; +var enableEndWait = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if(requestObj.request.common.startDate){ + enableWait = true; + } + if(requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("skipApproval", skipApproval); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Request Context Check - scriptTask-d76490953517/Request Context Check - scriptTask-d76490953517.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-d76490953517", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-8cd9decab2e4", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-d76490953517.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Role Grant Validation - scriptTask-3eab1948f1ec/Role Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running role grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var roleId = null; +var role = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + roleId = requestObj.role.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check role exists +if (!failureReason) { + try { + role = openidm.read('managed/alpha_role/' + roleId); + if (!role) { + failureReason = "Validation failed: Cannot find role with id " + roleId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading role with id " + roleId + ". Error message: " + e.message; + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Role Grant Validation - scriptTask-3eab1948f1ec/Role Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Role Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Role Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Role Grant Validation Failure - scriptTask-0b56191887de/Role Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Role Grant Validation Failure - scriptTask-0b56191887de/Role Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Role Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Role Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleGrant/steps/Wait Until Start Date - waitTask-4e25b1ee7a14/Wait Until Start Date - waitTask-4e25b1ee7a14.json 1`] = ` +{ + "displayName": "Wait Until Start Date", + "name": "waitTask-4e25b1ee7a14", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/BasicRoleModify.json 1`] = ` +{ + "_rev": 4, + "childType": false, + "description": "Basic workflow for modifying a governance role", + "displayName": "BasicRoleModify", + "id": "BasicRoleModify", + "mutable": false, + "name": "BasicRoleModify", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1806, + "y": 273, + }, + "startNode": { + "connections": { + "start": "scriptTask-3eab1948f1ec", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + return [{ + "id": content.get('roleOwner'), + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "script", + "expirationDate": 1, + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 963, + "y": 204, + }, + "exclusiveGateway-48e748c42994": { + "x": 511, + "y": 126.015625, + }, + "exclusiveGateway-b16f45452faa": { + "x": 753.6666564941406, + "y": 31.666656494140625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1328, + "y": 120.015625, + }, + "scriptTask-0b56191887de": { + "x": 1011, + "y": 529.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 193, + "y": 146.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1195, + "y": 346.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + return [{ + "id": content.get('roleOwner'), + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/b89b1128-52a3-4cac-a04d-56cad0f14203", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*1*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [ + { + "id": "managed/user/b89b1128-52a3-4cac-a04d-56cad0f14203", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(1*24*60*60*1000))).toISOString()", + }, + "frequency": 1, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "EXPIRATION", + "step": null, + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Auto Approval Gateway - exclusiveGateway-b16f45452faa/Auto Approval Gateway - exclusiveGateway-b16f45452faa.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Auto Approval Gateway - exclusiveGateway-b16f45452faa/Auto Approval Gateway - exclusiveGateway-b16f45452faa.json 1`] = ` +{ + "displayName": "Auto Approval Gateway", + "name": "exclusiveGateway-b16f45452faa", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Auto Approval Gateway - exclusiveGateway-b16f45452faa.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Modify Role - scriptTask-0359a9d77ee2/Modify Role - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info('Modifying Governance Role'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); +var comment = content.get('comment'); +var decision = {}; +var request = null; + +if(!failureReason) { + try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info('requestObj: ' + requestObj); + request = requestObj.request; + } + catch (e) { + failureReason = 'Governance role modification failed: Error reading request with id ' + requestId; + } + + if(!failureReason) { + try { + var payload = {}; + payload.role = request.role.object; + payload.role.status = request.role.status; + if(request.role.glossary){ + payload.glossary = request.role.glossary; + } + var result = openidm.action('iga/governance/role/' + request.role.roleId + '/' + request.role.status, 'PUT', payload); + } + catch (e) { + failureReason = 'Governance role modification failed: Error modifying role ' + request.role.roleId + ', status: ' + request.role.status + '. Error message: ' + e.message; + } + + decision = { + 'status': 'complete', + 'decision': 'approved', + 'outcome': 'fulfilled', + 'comment': comment + }; + } +} + +if(failureReason) { + decision = { + 'status': 'complete', + 'decision': 'approved', + 'outcome': 'cancelled', + 'failure': true, + 'comment': failureReason + }; + logger.info('Modifying failed: ' + failureReason); +} + +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info('Request ' + requestId + ' completed.'); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Modify Role - scriptTask-0359a9d77ee2/Modify Role - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Modify Role", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Modify Role - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info('Rejecting request'); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info('Execution Content: ' + content); + +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Role Modify Validation Failure - scriptTask-0b56191887de/Role Modify Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'cancelled', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Role Modify Validation Failure - scriptTask-0b56191887de/Role Modify Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Role Modify Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Role Modify Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Role Validation and Status Check - scriptTask-3eab1948f1ec/Role Validation and Status Check - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info('Running role modify request validation'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var skipApproval = false; +var role = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj) { + role = requestObj.request.role; + } else { + failureReason = 'Validation failed: Error reading request with id ' + requestId + ' requestObj: ' + requestObj; + } +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId + ' Error: ' + e.message; +} + +// Validation - Check original role and role owner exists +if (!failureReason) { + try { + var result = openidm.action('iga/governance/role/' + role.roleId + '/' + role.status, 'GET', {}, {}); + if (!result) { + failureReason = 'Validation failed: Cannot find role with id ' + role.roleId + ', status: ' + role.status; + } else { + if (role.status != 'active') { + skipApproval = true; + } else { + try { + execution.setVariable('roleOwner', role.glossary.idx['/role'].roleOwner); + } catch(e) { + failureReason = 'Validation failed: No role owner set for role with id ' + roleId + ', status: draft'; + } + } + } + } + catch (e) { + failureReason = 'Validation failed: Error reading role with id ' + role.roleId + ', status: ' + role.status + '. Error message: ' + e.message; + } +} + +if (failureReason) { + logger.info('Validation failed: ' + failureReason); +} +execution.setVariable('failureReason', failureReason); +execution.setVariable('skipApproval', skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Role Validation and Status Check - scriptTask-3eab1948f1ec/Role Validation and Status Check - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Role Validation and Status Check", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Role Validation and Status Check - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleModify/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "exclusiveGateway-b16f45452faa", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/BasicRolePublish.json 1`] = ` +{ + "_rev": 4, + "childType": false, + "description": "Basic workflow for publishing a governance role", + "displayName": "BasicRolePublish", + "id": "BasicRolePublish", + "mutable": false, + "name": "BasicRolePublish", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 3022, + "y": 330, + }, + "startNode": { + "connections": { + "start": "scriptTask-3eab1948f1ec", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + return [{ + "id": content.get('roleOwner'), + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "script", + "expirationDate": 1, + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1268, + "y": 104, + }, + "exclusiveGateway-48e748c42994": { + "x": 504, + "y": 119.015625, + }, + "exclusiveGateway-eb351160a59b": { + "x": 2238.999969482422, + "y": 178.66665649414062, + }, + "scriptTask-0359a9d77ee2": { + "x": 1843, + "y": 117.015625, + }, + "scriptTask-0b56191887de": { + "x": 1300, + "y": 422.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 197, + "y": 138.015625, + }, + "scriptTask-7ddf82215dd0": { + "x": 789.6666564941406, + "y": 136.66665649414062, + }, + "scriptTask-a0c9fc54ced2": { + "x": 2487.6666564941406, + "y": 405.6666564941406, + }, + "scriptTask-aec6c36b3a45": { + "x": 1648, + "y": 353.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + return [{ + "id": content.get('roleOwner'), + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/b89b1128-52a3-4cac-a04d-56cad0f14203", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*1*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [ + { + "id": "managed/user/b89b1128-52a3-4cac-a04d-56cad0f14203", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(1*24*60*60*1000))).toISOString()", + }, + "frequency": 1, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "EXPIRATION", + "step": null, + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Change Role Status Back to Draft For Failures - scriptTask-a0c9fc54ced2/Change Role Status Back to Draft For Failures - scriptTask-a0c9fc54ced2.js 1`] = ` +"// Change role status to back to draft +var content = execution.getVariables(); +var roleId = content.get('roleId'); + +try { + var origRole = openidm.action('iga/governance/role/' + roleId + '/pending', 'GET', {}, {}); + var payload = {role: origRole.role}; + payload.role.status = 'draft'; + var result = openidm.action('iga/governance/role/' + roleId + '/pending', 'PUT', payload); +} +catch (e) { + logger.error('Error setting role status to draft. Error message: ' + e.message); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Change Role Status Back to Draft For Failures - scriptTask-a0c9fc54ced2/Change Role Status Back to Draft For Failures - scriptTask-a0c9fc54ced2.json 1`] = ` +{ + "displayName": "Change Role Status Back to Draft For Failures", + "name": "scriptTask-a0c9fc54ced2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Change Role Status Back to Draft For Failures - scriptTask-a0c9fc54ced2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Change Role Status to Pending - scriptTask-7ddf82215dd0/Change Role Status to Pending - scriptTask-7ddf82215dd0.js 1`] = ` +"// Change role status to pending approval +var content = execution.getVariables(); +var roleId = content.get('roleId'); + +try { + var origRole = openidm.action('iga/governance/role/' + roleId + '/draft', 'GET', {}, {}); + var payload = {role: origRole.role}; + payload.role.status = 'pending'; + var result = openidm.action('iga/governance/role/' + roleId + '/draft', 'PUT', payload); +} +catch (e) { + logger.error('Error setting role status to pending. Error message: ' + e.message); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Change Role Status to Pending - scriptTask-7ddf82215dd0/Change Role Status to Pending - scriptTask-7ddf82215dd0.json 1`] = ` +{ + "displayName": "Change Role Status to Pending", + "name": "scriptTask-7ddf82215dd0", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Change Role Status to Pending - scriptTask-7ddf82215dd0.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Publish Governance Role - scriptTask-0359a9d77ee2/Publish Governance Role - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info('Publishing Governance Role'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var roleId = content.get('roleId'); +var addAutoRoleMembers = content.get('addAutoRoleMembers'); +var updateIdm = content.get('updateIdm'); +var failureReason = content.get('failureReason'); +var decision = {}; +var request = null; + +if(!failureReason) { + try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info('requestObj: ' + requestObj); + request = requestObj.request; + } + catch (e) { + failureReason = 'Governance role publishing failed: Error reading request with id ' + requestId; + } + + if(!failureReason) { + try { + var govPayload = { + addAutoRoleMembers, + updateIdm + }; + var result = openidm.action('iga/governance/role/' + roleId + '/pending', 'PATCH', govPayload); + } + catch (e) { + failureReason = 'Governance role publishing failed: Error publishing role ' + roleId + '. Error message: ' + e.message; + } + + decision = { + 'status': 'complete', + 'decision': 'approved', + 'outcome': 'fulfilled' + }; + } +} + +if(failureReason) { + decision = { + 'status': 'complete', + 'decision': 'approved', + 'outcome': 'cancelled', + 'failure': true, + 'comment': failureReason + }; + logger.info('Publish failed: ' + failureReason); +} + +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info('Request ' + requestId + ' completed.'); + +execution.setVariable('failureReason', failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Publish Governance Role - scriptTask-0359a9d77ee2/Publish Governance Role - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Publish Governance Role", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-eb351160a59b", + }, + ], + "script": { + "file": "Publish Governance Role - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info('Rejecting request'); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info('Execution Content: ' + content); + +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-a0c9fc54ced2", + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Role Validation and Status Check - scriptTask-3eab1948f1ec/Role Validation and Status Check - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info('Running governance role publish request validation'); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var roleId = null; +var updateIdm = true; +var addAutoRoleMembers = true; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj) { + roleId = requestObj.request.role.roleId; + addAutoRoleMembers = requestObj.request.role.addAutoRoleMembers ? requestObj.request.role.addAutoRoleMembers: true; + updateIdm = requestObj.request.role.updateIdm ? requestObj.request.role.updateIdm : true; + } else { + failureReason = 'Validation failed: Error reading request with id ' + requestId + ' requestObj: ' + requestObj; + } +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId + ' Error: ' + e.message; +} + +// Validation - Check role and role owner exists +if (!failureReason) { + try { + var role = openidm.action('iga/governance/role/' + roleId + '/draft', 'GET', {}, {}); + if (!role) { + failureReason = 'Validation failed: Cannot find role with id ' + roleId + ', status: draft'; + } else { + try { + execution.setVariable('roleOwner', role.glossary.idx['/role'].roleOwner); + } catch(e) { + failureReason = 'Validation failed: No role owner set for role with id ' + roleId + ', status: draft'; + } + } + } + catch (e) { + failureReason = 'Validation failed: Error reading role with id ' + roleId + ', status: draft' + '. Error message: ' + e.message + 'role: ' + role; + } +} + +if (failureReason) { + logger.info('Validation failed: ' + failureReason); +} +execution.setVariable('failureReason', failureReason); +execution.setVariable('roleId', roleId); +execution.setVariable('updateIdm', updateIdm); +execution.setVariable('addAutoRoleMembers', addAutoRoleMembers); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Role Validation and Status Check - scriptTask-3eab1948f1ec/Role Validation and Status Check - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Role Validation and Status Check", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Role Validation and Status Check - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Validation Failure - scriptTask-0b56191887de/Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'cancelled', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Validation Failure - scriptTask-0b56191887de/Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-7ddf82215dd0", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Validation Gateway - exclusiveGateway-eb351160a59b/Validation Gateway - exclusiveGateway-eb351160a59b.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRolePublish/steps/Validation Gateway - exclusiveGateway-eb351160a59b/Validation Gateway - exclusiveGateway-eb351160a59b.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-eb351160a59b", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationSuccess", + "step": null, + }, + { + "condition": "failureReason != null", + "outcome": "validationFailure", + "step": "scriptTask-a0c9fc54ced2", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-eb351160a59b.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/BasicRoleRemove.json 1`] = ` +{ + "_rev": 8, + "childType": false, + "description": "Basic request flow for removing a user's role membership", + "displayName": "Basic Role Remove", + "id": "BasicRoleRemove", + "mutable": false, + "name": "BasicRoleRemove", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1823, + "y": 205, + }, + "startNode": { + "connections": { + "start": "scriptTask-c99a721d2b93", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "type": "roleOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 694, + "y": 234, + }, + "exclusiveGateway-53007af1f4bf": { + "x": 479, + "y": 57.015625, + }, + "inclusiveGateway-a83e210b90d1": { + "x": 992, + "y": 70.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1498, + "y": 76.015625, + }, + "scriptTask-6dde9c0ec213": { + "x": 785, + "y": 84.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1165, + "y": 285.015625, + }, + "scriptTask-c99a721d2b93": { + "x": 187, + "y": 143.015625, + }, + "waitTask-e65fcbd06a6d": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.endDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1247, + "y": 84.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-6dde9c0ec213", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Context Gateway - exclusiveGateway-53007af1f4bf/Context Gateway - exclusiveGateway-53007af1f4bf.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Context Gateway - exclusiveGateway-53007af1f4bf/Context Gateway - exclusiveGateway-53007af1f4bf.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-53007af1f4bf", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-6dde9c0ec213", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-53007af1f4bf.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Deprovisioning - scriptTask-0359a9d77ee2/Deprovisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Deprovisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var context = content.get('context'); +var lineItemId = content.get('lineItemId'); + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Deprovisioning failed: Error reading request with id " + requestId; +} + +// Create object to update final request progress +var decision = { 'status': 'complete', 'decision': 'approved' }; + +if (!failureReason) { + try { + // Remove role grant from user + var request = requestObj.request; + var payload = { + "roleId": request.common.roleId, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "remove", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/roles', 'POST', payload, queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Deprovisioning failed: Error deprovisioning role to user " + request.common.userId + " for role " + request.common.roleId + ". Error message: " + message; + } +} + +if (context == 'certification') { + // If role removal request is created via certification, update the corresponding certification item with remediation status. + try { + var remediationStatus = failureReason ? "failed" : "complete" + var comment = failureReason ? "Unable to remove the role successfully, remediation failed." : "Role has been removed from user successfully, remediation complete." + var body = { + "remediationStatus": remediationStatus, + "comment": comment + } + var lineItemParams = { + "_action": "updateRemediationStatus" + } + openidm.action('iga/governance/certification/items/' + lineItemId, 'POST', body, lineItemParams); + } + catch (e) { + failureReason = "Unable to update the certification line item " + lineItemId + " with the final remediation status from this request." + } +} + +// Set additional properties on the request progress update +if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; +} +else { + decision.outcome = 'provisioned'; +} + +// Update final request progress +var queryParams = { '_action': 'update' }; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Deprovisioning - scriptTask-0359a9d77ee2/Deprovisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Deprovisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Deprovisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Has End Date - inclusiveGateway-a83e210b90d1/Has End Date - inclusiveGateway-a83e210b90d1.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Has End Date - inclusiveGateway-a83e210b90d1/Has End Date - inclusiveGateway-a83e210b90d1.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-a83e210b90d1", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasEndDate", + "step": "waitTask-e65fcbd06a6d", + }, + { + "condition": "enableWait == false", + "outcome": "noEndDate", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-a83e210b90d1.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Request Approved - scriptTask-6dde9c0ec213/Request Approved - scriptTask-6dde9c0ec213.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Request Approved - scriptTask-6dde9c0ec213/Request Approved - scriptTask-6dde9c0ec213.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-6dde9c0ec213", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-a83e210b90d1", + }, + ], + "script": { + "file": "Request Approved - scriptTask-6dde9c0ec213.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Request Context Check - scriptTask-c99a721d2b93/Request Context Check - scriptTask-c99a721d2b93.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var skipApproval = false; +var lineItemId = null; +var campaignId = null; +var enableWait = false; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + // Set execution variables from the request context + context = requestObj.request.common.context.type; + if (context == 'admin' || context == 'certification') { + skipApproval = true; + } + if (context == 'certification') { + lineItemId = requestObj.request.common.context.lineItemId; + campaignId = requestObj.request.common.context.campaignId + + // Add a comment on the certification item denoting the request ID + var commentResp = openidm.action('/iga/governance/certification/' + campaignId + '/items/comment', 'POST', { "ids": [lineItemId], "comment": "ID of role removal request: " + requestId }, {}) + } + + } + if (requestObj.request.common.endDate){ + enableWait = true; + } +} +catch (e) { + logger.info("Could not validate request context, normal approval process will be followed.") +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("lineItemId", lineItemId); +execution.setVariable("enableWait", enableWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Request Context Check - scriptTask-c99a721d2b93/Request Context Check - scriptTask-c99a721d2b93.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-c99a721d2b93", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-53007af1f4bf", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-c99a721d2b93.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicRoleRemove/steps/Wait Task - waitTask-e65fcbd06a6d/Wait Task - waitTask-e65fcbd06a6d.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-e65fcbd06a6d", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.endDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/BasicViolationProcess.json 1`] = ` +{ + "_rev": 5, + "childType": false, + "description": "Basic violation flow for determining how a policy violation is handled", + "displayName": "Basic Violation Process", + "id": "BasicViolationProcess", + "mutable": false, + "name": "BasicViolationProcess", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1380, + "y": 400, + }, + "startNode": { + "connections": { + "start": "violationTask-df7f65b04ec3", + }, + "id": "startNode", + "x": 60, + "y": 140, + }, + "uiConfig": { + "exclusiveGateway-b1e244b742b5": { + "x": 760, + "y": 90, + }, + "scriptTask-313f487929a4": { + "x": 485, + "y": 80, + }, + "scriptTask-690cd5adc1b6": { + "x": 485, + "y": 164, + }, + "scriptTask-6e8507beca08": { + "x": 1040, + "y": 80.5, + }, + "violationTask-df7f65b04ec3": { + "actors": [ + { + "id": { + "isExpression": true, + "value": "violation.policyRule.violationOwner.id", + }, + "type": "violationOwner", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "script", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 230, + "y": 110, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Allow Violation - scriptTask-313f487929a4/Allow Violation - scriptTask-313f487929a4.js 1`] = ` +"logger.info("Allowing violation"); +var content = execution.getVariables(); +var violationId = content.get('id'); +var phaseName = content.get('phaseName'); +logger.info("Violation to be allowed: " + violationId + " with phase name " + phaseName); + +var failureReason = null; +try { + var allowResponse = openidm.action('iga/governance/violation/' + violationId + '/allow', 'POST', {}); +logger.info("Violation " + violationId + " was allowed successfully.");} catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Failed allowing violation with id " + violationId + ". Error message: " + message; +} + +if (failureReason) { + var update = { "comment": failureReason }; + try { + openidm.action('iga/governance/violation/' + violationId + '/phases/' + phaseName + '/comment', 'POST', update, {}); + } catch (e) { + openidm.action('iga/governance/violation/' + violationId + '/comment', 'POST', update, {}); + } +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Allow Violation - scriptTask-313f487929a4/Allow Violation - scriptTask-313f487929a4.json 1`] = ` +{ + "displayName": "Allow Violation", + "name": "scriptTask-313f487929a4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Allow Violation - scriptTask-313f487929a4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Remediate Violation - scriptTask-690cd5adc1b6/Remediate Violation - scriptTask-690cd5adc1b6.js 1`] = ` +"logger.info("Remediating violation"); + +var content = execution.getVariables(); +var violationId = content.get('id'); +var remediation = content.get('remediation'); +logger.info("Remediating violation - violationId: " + violationId + ', remediation payload: ' + remediation); + +var remediationContent = null; + +var remediationResponse = openidm.action('iga/governance/violation/' + violationId + '/remediate', 'POST', remediation); +logger.info("Remediating response: " + remediationResponse); + +remediationContent = remediationResponse.decision.remediation; +execution.setVariable("remediation", remediationContent); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Remediate Violation - scriptTask-690cd5adc1b6/Remediate Violation - scriptTask-690cd5adc1b6.json 1`] = ` +{ + "displayName": "Remediate Violation", + "name": "scriptTask-690cd5adc1b6", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-b1e244b742b5", + }, + ], + "script": { + "file": "Remediate Violation - scriptTask-690cd5adc1b6.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Remediation Validation - exclusiveGateway-b1e244b742b5/Remediation Validation - exclusiveGateway-b1e244b742b5.js 1`] = ` +"logger.info("This is exclusive gateway to validate remediation"); +var content = execution.getVariables(); +var remediationResult = content.get('remediation'); +logger.info("The remediation result is: " + remediationResult); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Remediation Validation - exclusiveGateway-b1e244b742b5/Remediation Validation - exclusiveGateway-b1e244b742b5.json 1`] = ` +{ + "displayName": "Remediation Validation", + "name": "exclusiveGateway-b1e244b742b5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "remediation.remediationOptionId == "grantRemoval"", + "outcome": "removeGrants", + "step": "scriptTask-6e8507beca08", + }, + { + "condition": "!remediation || !remediation.remediationOptionId || remediation.remediationOptionId !== "grantRemoval"", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Remediation Validation - exclusiveGateway-b1e244b742b5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Remove Grants Auto - scriptTask-6e8507beca08/Remove Grants Auto - scriptTask-6e8507beca08.js 1`] = ` +"logger.info("Removing grants automatically"); + +var content = execution.getVariables(); +var violationId = content.get('id'); +var failureReason = null; +var phaseName = content.get('phaseName'); +var violationObj; + +logger.info("Removing grants for violation " + violationId + " with phase name " + phaseName); + +try { + violationObj = openidm.action('iga/governance/violation/lookup/' + violationId, 'GET', {}, {}); +} +catch (e) { + failureReason = "Removing grants failed: Error reading violation with id " + violationId + ". Error message: " + e.message; +} + +if (!failureReason) { + var remediation = violationObj.decision.remediation; + var failedDeprovisioning = false; + var deprovisionedIds = []; + for(var grant of violationObj.violatingAccess) { + if (!remediation.grantIds.includes(grant.compositeId)) { + continue; + } + + var userId = violationObj.user.id; + logger.info("Removing grant: " + grant.compositeId + ", user: " + userId + ", violation: " + violationId + ", type: " + grant.item.type); + var resourceInfo; + var resourcePath; + if (grant.item.type === 'ResourceGrant' || grant.item.type === 'entitlementGrant') { + resourceInfo = { "resourceKey": "entitlementId", "resourceValue": grant.assignment.id }; + resourcePath = "entitlements"; + } + else if (grant.item.type === 'AccountGrant' || grant.item.type === 'accountGrant') { + var accountId = grant.account.id; + + } + else if (grant.item.type === 'roleMembership') { + resourceInfo = { "resourceKey": "roleId", "resourceValue": grant.role.id }; + resourcePath = "roles"; + } + + try { + var payload = { + "grantType": "request" + }; + payload[resourceInfo.resourceKey] = resourceInfo.resourceValue; + + logger.info('Payload to remove grant: ' + JSON.stringify(payload)); + + var queryParams = { + "_action": "remove" + } + + var result = openidm.action('iga/governance/user/' + userId + '/' + resourcePath , 'POST', payload,queryParams); + execution.setVariables(result); + + logger.info("Grant removed " + grant.compositeId + " successfully, user " + userId + ", violation: " + violationId + ", type: " + grant.item.type + ", resource info: " + JSON.stringify(resourceInfo) + ", result: " + JSON.stringify(result)); + deprovisionedIds.push(grant.compositeId); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = failureReason + ". Removing grants failed: Error deprovisioning " + resourcePath + " to user " + userId + " for " + resourceInfo + ". Error message: " + message + "."; + failedDeprovisioning = true; + } + } + + if (!failedDeprovisioning) { + openidm.action('iga/governance/violation/' + violationId + '/remediation/status/complete', 'POST', {}); + } else { + failureReason = failureReason + ". Grants removed: " + deprovisionedIds; + } +} + +if (failureReason) { + var update = { 'comment': failureReason }; + try { + openidm.action('iga/governance/violation/' + violationId + '/phases/' + phaseName + '/comment', 'POST', update, {}); + } catch (e) { + openidm.action('iga/governance/violation/' + violationId + '/comment', 'POST', update, {}); + } +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Remove Grants Auto - scriptTask-6e8507beca08/Remove Grants Auto - scriptTask-6e8507beca08.json 1`] = ` +{ + "displayName": "Remove Grants Auto", + "name": "scriptTask-6e8507beca08", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Remove Grants Auto - scriptTask-6e8507beca08.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/BasicViolationProcess/steps/Start Violation Task - violationTask-df7f65b04ec3/Start Violation Task - violationTask-df7f65b04ec3.json 1`] = ` +{ + "displayName": "Start Violation Task", + "name": "violationTask-df7f65b04ec3", + "type": "violationTask", + "violationTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": "violation.policyRule.violationOwner.id", + }, + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "violationAssigned", + }, + "escalation": { + "actors": [ + { + "id": { + "isExpression": true, + "value": "violation.policyRule.violationOwner.id", + }, + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(8*1*24*60*60*1000))).toISOString()", + }, + "frequency": 8, + "notification": "violationEscalated", + }, + "expiration": { + "action": { + "isExpression": true, + "value": "violation.policyRule.violationLifecycle.expiration.expires ? violation.policyRule.violationLifecycle.expiration.action : null", + }, + "actors": [], + "date": { + "isExpression": true, + "value": "violation.policyRule.violationLifecycle.expiration.expires ? (new Date(new Date().getTime()+(violation.policyRule.violationLifecycle.expiration.duration*24*60*60*1000))).toISOString() : null", + }, + "notification": "violationExpired", + }, + "reassign": { + "notification": "violationReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "violationReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": "scriptTask-690cd5adc1b6", + }, + { + "condition": null, + "outcome": "ALLOW", + "step": "scriptTask-313f487929a4", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/CreateEntitlement.json 1`] = ` +{ + "_rev": 6, + "childType": false, + "description": "Basic request flow for creating a new entitlement", + "displayName": "Create Entitlement", + "id": "CreateEntitlement", + "mutable": false, + "name": "CreateEntitlement", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1357, + "y": 209, + }, + "startNode": { + "connections": { + "start": "scriptTask-c59ee376a37c", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-67a954f33919": { + "x": 445, + "y": 120.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1018, + "y": 58.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1014, + "y": 226.015625, + }, + "scriptTask-c59ee376a37c": { + "x": 194, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 743, + "y": 56.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Auto Approval - scriptTask-e21178ab80f7/Auto Approval - scriptTask-e21178ab80f7.js 1`] = ` +"logger.info("Creating Entitlement - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to user having create privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Auto Approval - scriptTask-e21178ab80f7/Auto Approval - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Auto Approval", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Auto Approval - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Create Entitlement - scriptTask-0359a9d77ee2/Create Entitlement - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Create Entitlement - creating entitlement"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create entitlement failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + // Call IGA API for creating entitlement + var payload = requestObj.request.entitlement; + var params = { '_action': 'create', 'initiatingUser': requestObj.requester.id}; + openidm.action('iga/governance/entitlement', 'POST', payload, params); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Create entitlement failed: Error creating " + payload.objectType + " entitlement for application " + payload.applicationId + ". Error message: " + message; + } +} + +// Build the payload to update the request object with the final status, decision, and outcome +var decision = {'status': 'complete', 'decision': 'approved'}; +if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; +} +else { + decision.outcome = 'provisioned'; +} + +// Update request +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Create Entitlement - scriptTask-0359a9d77ee2/Create Entitlement - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Create Entitlement", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Entitlement - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Permission Check - scriptTask-c59ee376a37c/Permission Check - scriptTask-c59ee376a37c.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// create an entitlement for the application which they are requesting. If so, it will +// skip any approval process and directly move to create the entitlement. + +logger.info("Creating Entitlement - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a managed user, check that the user has permissions to + // create entitlements for the requested application + var entitlementObj = requestObj.request.entitlement; + var userId = requester.id.split('/') + var entitlement = openidm.action('iga/governance/application/' + entitlementObj.applicationId, 'GET', {}, {'endUserId': userId[2]}) + if (entitlement.permissions.createEntitlement) { + skipApproval = true; + } + } + else { + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Permission Check - scriptTask-c59ee376a37c/Permission Check - scriptTask-c59ee376a37c.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-c59ee376a37c", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Permission Check - scriptTask-c59ee376a37c.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Permission Gateway - exclusiveGateway-67a954f33919/Permission Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Permission Gateway - exclusiveGateway-67a954f33919/Permission Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Permission Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Permission Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Create entitlement - rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateEntitlement/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/CreateNonEmployee.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "CreateNonEmployee", + "displayName": "CreateNonEmployee", + "id": "createNonEmployee", + "mutable": true, + "name": "CreateNonEmployee", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1694, + "y": 154, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "script", + "expirationDate": 1, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 716, + "y": 169, + }, + "exclusiveGateway-abbb089758c8": { + "x": 433, + "y": 89.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 986, + "y": 48.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 988, + "y": 222.015625, + }, + "scriptTask-ca9504ae90d8": { + "x": 136, + "y": 112.015625, + }, + "scriptTask-e8842de66fbb": { + "x": 718, + "y": 43.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(1*24*60*60*1000))).toISOString()", + }, + "frequency": 1, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.js 1`] = ` +"logger.info("Create User - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to requester having create user privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.json 1`] = ` +{ + "displayName": "Auto-Approval", + "name": "scriptTask-e8842de66fbb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Auto-Approval - scriptTask-e8842de66fbb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-abbb089758c8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-e8842de66fbb", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-abbb089758c8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Create User - scriptTask-0359a9d77ee2/Create User - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Creating User"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +} +catch (e) { + failureReason = "Creating User: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var payload = requestObj.request.user.object; + + var comment = {'comment': JSON.stringify(payload)}; + openidm.action('iga/governance/requests/' + requestId, 'POST', comment, queryParams); + } + catch (e) { + failureReason = "Creating user failed: Error during creation of user " + payload.userName + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Create User - scriptTask-0359a9d77ee2/Create User - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Create User", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create User - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// create a user. If so, it will skip any approval process and directly move to create the new user. + +logger.info("Create User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a normal managed user, check that the user has permissions to create a user + var userId = requester.id.split('/'); + var user = openidm.action('iga/governance/user', 'GET', {}, {'endUserId': userId[2], 'scopePermission': 'createUser', '_queryFilter': \`id+eq+'\` + userId[2] + \`'\`}) + if(user.result.length > 0){ + skipApproval = true; + } + } + else{ + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-abbb089758c8", + }, + ], + "script": { + "file": "Permission Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Create User - rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateNonEmployee/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser - JH/CreateUser - JH.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "CreateUser - JH", + "displayName": "CreateUser - JH", + "id": "createUserJh", + "mutable": true, + "name": "CreateUser - JH", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1694, + "y": 154, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "scriptTask-ca9504ae90d8": { + "x": 136, + "y": 112.015625, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser - JH/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// create a user. If so, it will skip any approval process and directly move to create the new user. + +logger.info("Create User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + var comment = { 'comment': JSON.stringify(requestObj) } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser - JH/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Permission Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/CreateUser.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "Basic request flow for creating a new user", + "displayName": "Create User", + "id": "CreateUser", + "mutable": false, + "name": "CreateUser", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1694, + "y": 154, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action('iga/commons/config/iga_access_request', 'GET', {}, {}); + return systemSettings.defaultApprover; +})()", + }, + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 732, + "y": 172, + }, + "exclusiveGateway-abbb089758c8": { + "x": 433, + "y": 89.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 928, + "y": 53.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 963, + "y": 223.015625, + }, + "scriptTask-ca9504ae90d8": { + "x": 136, + "y": 112.015625, + }, + "scriptTask-e8842de66fbb": { + "x": 718, + "y": 43.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action('iga/commons/config/iga_access_request', 'GET', {}, {}); + return systemSettings.defaultApprover; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.js 1`] = ` +"logger.info("Create User - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to requester having create user privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.json 1`] = ` +{ + "displayName": "Auto-Approval", + "name": "scriptTask-e8842de66fbb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Auto-Approval - scriptTask-e8842de66fbb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-abbb089758c8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-e8842de66fbb", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-abbb089758c8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Create User - scriptTask-0359a9d77ee2/Create User - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Creating User"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +} +catch (e) { + failureReason = "Creating User: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var payload = requestObj.request.user.object; + + /** Create new user **/ + var result = openidm.create('managed/alpha_user', null, payload, queryParams); + logger.info("User created with userName " + result.userName + " and _id " + result._id + ".") + + /** Send new user email **/ + var body = { + subject: "Welcome " + payload.givenName + " " + payload.sn + "!", + to: payload.mail, + body: "Your new user has been created.\\n\\nUsername: " + payload.userName, + object: {} + }; + + if(payload.manager && payload.manager._ref){ + logger.info("Getting manager information for " + payload.userName + " create user welcome email.") + try { + var managerResult = openidm.read(payload.manager._ref); + body.cc = managerResult.mail; + } catch (e) { + logger.info("Unable to read manager information for " + payload.userName + " create user welcome email. " + e.message) + } + } + openidm.action("external/email", "send", body); + } + catch (e) { + failureReason = "Creating user failed: Error during creation of user " + payload.userName + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Create User - scriptTask-0359a9d77ee2/Create User - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Create User", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create User - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// create a user. If so, it will skip any approval process and directly move to create the new user. + +logger.info("Create User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a normal managed user, check that the user has permissions to create a user + var userId = requester.id.split('/'); + var user = openidm.action('iga/governance/user', 'GET', {}, {'endUserId': userId[2], 'scopePermission': 'createUser', '_queryFilter': \`id+eq+'\` + userId[2] + \`'\`}) + if(user.result.length > 0){ + skipApproval = true; + } + } + else{ + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-abbb089758c8", + }, + ], + "script": { + "file": "Permission Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Create User - rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/CreateUser/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/DeleteUser.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "Basic Request flow to delete a user", + "displayName": "Delete User", + "id": "DeleteUser", + "mutable": false, + "name": "DeleteUser", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1378, + "y": 118, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action('iga/commons/config/iga_access_request', 'GET', {}, {}); + return systemSettings.defaultApprover; +})()", + }, + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 713, + "y": 169, + }, + "exclusiveGateway-abbb089758c8": { + "x": 433, + "y": 89.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 993, + "y": 31.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 994, + "y": 237.015625, + }, + "scriptTask-ca9504ae90d8": { + "x": 135, + "y": 111.015625, + }, + "scriptTask-e8842de66fbb": { + "x": 708, + "y": 26.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action('iga/commons/config/iga_access_request', 'GET', {}, {}); + return systemSettings.defaultApprover; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.js 1`] = ` +"logger.info("Delete User - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to user having delete user privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.json 1`] = ` +{ + "displayName": "Auto-Approval", + "name": "scriptTask-e8842de66fbb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Auto-Approval - scriptTask-e8842de66fbb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-abbb089758c8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-e8842de66fbb", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-abbb089758c8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Delete User - scriptTask-0359a9d77ee2/Delete User - scriptTask-0359a9d77ee2.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +logger.info("Deleting User - request id " + requestId); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +} +catch (e) { + failureReason = "User Deletion: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + + /** Delete user **/ + var result = openidm.delete('managed/alpha_user/' + request.user.userId, null); + logger.info("Deleted user " + request.user.userId + " for request id " + requestId + ".") + } + catch (e) { + failureReason = "Deleting user failed: Error during deletion of user " + request.user.userId + " for request id " + requestId + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Delete User - scriptTask-0359a9d77ee2/Delete User - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Delete User", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Delete User - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// delete users. If so, it will skip any approval process and directly move to delete the user. + +logger.info("Delete User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a managed user, check that the user has permissions to + // create entitlements for the requested application + var userId = requestObj.request.user.userId; + var requesterId = requester.id.split('/'); + var user = openidm.action('iga/governance/user', 'GET', {}, {'endUserId': requesterId[2], 'scopePermission': 'deleteUser', '_queryFilter': \`id+eq+'\` + userId + \`'\`}) + if(user.result[0].permissions.deleteUser){ + skipApproval = true; + } + } + else{ + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-abbb089758c8", + }, + ], + "script": { + "file": "Permission Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Delete User - rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/DeleteUser/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/ModifyEntitlement.json 1`] = ` +{ + "_rev": 6, + "childType": false, + "description": "Basic request flow for modifying an existing entitlement", + "displayName": "Modify Entitlement", + "id": "ModifyEntitlement", + "mutable": false, + "name": "ModifyEntitlement", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1774, + "y": 221, + }, + "startNode": { + "connections": { + "start": "scriptTask-365b50ab00a7", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.entitlementOwner[0].id ? "managed/user/" + requestIndex.entitlementOwner[0].id : "managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 1, + }, + "x": 1128, + "y": 260, + }, + "exclusiveGateway-abbb089758c8": { + "x": 847, + "y": 164.015625, + }, + "exclusiveGateway-c82a357d8c38": { + "x": 306, + "y": 87.015625, + }, + "fulfillmentTask-cce84a670745": { + "actors": { + "isExpression": true, + "value": "// Returns the certifier +(function() { + var content = execution.getVariables(); + var certifierId = content.get('certifierId'); + + return [{ + "id": "managed/user/" + certifierId, + "permissions": { + "fulfill": true, + "deny": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})() +", + }, + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 595, + "y": 46.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1413, + "y": 291.015625, + }, + "scriptTask-365b50ab00a7": { + "x": 95, + "y": 106.015625, + }, + "scriptTask-87ad089a5484": { + "x": 591, + "y": 224.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1412, + "y": 118.015625, + }, + "scriptTask-e8842de66fbb": { + "x": 1124, + "y": 169.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.js 1`] = ` +"logger.info("Modify Entitlement - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to user having modify privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.json 1`] = ` +{ + "displayName": "Auto-Approval", + "name": "scriptTask-e8842de66fbb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Auto-Approval - scriptTask-e8842de66fbb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Certifier Modifications - fulfillmentTask-cce84a670745/Certifier Modifications - fulfillmentTask-cce84a670745.json 1`] = ` +{ + "displayName": "Certifier Modifications", + "fulfillmentTask": { + "actors": { + "isExpression": true, + "value": "// Returns the certifier +(function() { + var content = execution.getVariables(); + var certifierId = content.get('certifierId'); + + return [{ + "id": "managed/user/" + certifierId, + "permissions": { + "fulfill": true, + "deny": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})() +", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "scriptTask-87ad089a5484", + }, + { + "condition": null, + "outcome": "DENY", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "name": "fulfillmentTask-cce84a670745", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Check Certification - exclusiveGateway-c82a357d8c38/Check Certification - exclusiveGateway-c82a357d8c38.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Check Certification - exclusiveGateway-c82a357d8c38/Check Certification - exclusiveGateway-c82a357d8c38.json 1`] = ` +{ + "displayName": "Check Certification", + "name": "exclusiveGateway-c82a357d8c38", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "certification == true", + "outcome": "isCertification", + "step": "fulfillmentTask-cce84a670745", + }, + { + "condition": "certification == false", + "outcome": "isNotCertification", + "step": "scriptTask-87ad089a5484", + }, + ], + "script": { + "file": "Check Certification - exclusiveGateway-c82a357d8c38.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Context Check - scriptTask-365b50ab00a7/Context Check - scriptTask-365b50ab00a7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var certification = false; +var certifierId = null; +var isCertifierOwnerSame = false; +var entitlementOwnerId = null; +let isTenantAdmin = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'certification') { + certification = true; + if(requestObj && requestObj.entitlementOwner && requestObj.entitlementOwner.length){ + entitlementOwnerId = requestObj.entitlementOwner[0].id + } + const campaignId = requestObj.request.common.context.campaignId; + const lineItemId = requestObj.request.common.context.lineItemId; + + // Add a comment on the certification item denoting the request ID + var commentResp = openidm.action('/iga/governance/certification/' + campaignId + '/items/comment', 'POST', { "ids": [lineItemId], "comment": "ID of modify entitlement request: " + requestId }, {}); + + var lineItemRespObj = openidm.action('/iga/governance/certification/' + campaignId + '/items/' + lineItemId, 'GET', {}, {"isAdmin":true}); + if (lineItemRespObj.result[0]) { + const decisionById = lineItemRespObj.result[0].decision.certification.decisionBy.id; + const primaryReviewerId = lineItemRespObj.result[0].decision.certification.primaryReviewer.id + let isTenantAdmin = false; + + if (decisionById === 'SYSTEM') { + isTenantAdmin = true; + } else { + isTenantAdmin = decisionById.split('/')[1] === 'teammember'; + } + + if (isTenantAdmin) { + certifierId = primaryReviewerId.split('/')[2]; + } else { + certifierId = decisionById.split('/')[2]; + } + isCertifierOwnerSame = entitlementOwnerId === certifierId; + } + } + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} + +execution.setVariable("context", context); +execution.setVariable("certification", certification); +execution.setVariable("certifierId", certifierId); +execution.setVariable("isCertifierOwnerSame", isCertifierOwnerSame); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Context Check - scriptTask-365b50ab00a7/Context Check - scriptTask-365b50ab00a7.json 1`] = ` +{ + "displayName": "Context Check", + "name": "scriptTask-365b50ab00a7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-c82a357d8c38", + }, + ], + "script": { + "file": "Context Check - scriptTask-365b50ab00a7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Modify Entitlement - scriptTask-0359a9d77ee2/Modify Entitlement - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Modify Entitlement - updating entitlement"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var entitlementId = null; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + entitlementId = requestObj.request.entitlement.entitlementId; + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Modify entitlement failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + // Call IGA API for modifying entitlement + var payload = requestObj.request.entitlement; + var queryParams = { + "_action": "update", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/entitlement/' + entitlementId , 'PUT', payload, queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Modify entitlement failed: Error updating entitlement " + payload.entitlementId + ". Error message: " + message; + } +} + +// Build the payload to update the request object with the final status, decision, and outcome +var decision = {'status': 'complete', 'decision': 'approved'}; +if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; +} +else { + decision.outcome = 'provisioned'; +} + +// Update request +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Modify Entitlement - scriptTask-0359a9d77ee2/Modify Entitlement - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Modify Entitlement", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Modify Entitlement - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Permission Check - scriptTask-87ad089a5484/Permission Check - scriptTask-87ad089a5484.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// modify the entitlement for which they are requesting. If so, it will +// skip any approval process and directly move to modify the entitlement. + +logger.info("Modify Entitlement - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var isCertifierOwnerSame = String(content.get('isCertifierOwnerSame')) === 'true'; +var skipApproval = true; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a managed user, check that the user has permissions to + // create entitlements for the requested application + var entitlementObj = requestObj.request.entitlement; + var userId = requester.id.split('/'); + var entitlement = openidm.action('iga/governance/entitlement/' + entitlementObj.entitlementId, 'GET', {}, {'endUserId': userId[2]}) + if(!entitlement.permissions.modifyEntitlement || !isCertifierOwnerSame){ + skipApproval = false; + } + } + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'certification' && !isCertifierOwnerSame) { + skipApproval = false; + } + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Permission Check - scriptTask-87ad089a5484/Permission Check - scriptTask-87ad089a5484.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-87ad089a5484", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-abbb089758c8", + }, + ], + "script": { + "file": "Permission Check - scriptTask-87ad089a5484.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Permission Gateway - exclusiveGateway-abbb089758c8/Permission Gateway - exclusiveGateway-abbb089758c8.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Permission Gateway - exclusiveGateway-abbb089758c8/Permission Gateway - exclusiveGateway-abbb089758c8.json 1`] = ` +{ + "displayName": "Permission Gateway", + "name": "exclusiveGateway-abbb089758c8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-e8842de66fbb", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Permission Gateway - exclusiveGateway-abbb089758c8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Modify entitlement - rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyEntitlement/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/ModifyUser.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "Basic Request flow to modify a user", + "displayName": "Modify User", + "id": "ModifyUser", + "mutable": false, + "name": "ModifyUser", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1223, + "y": 156, + }, + "startNode": { + "connections": { + "start": "scriptTask-ca9504ae90d8", + }, + "id": "startNode", + "x": 12, + "y": 110, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action('iga/commons/config/iga_access_request', 'GET', {}, {}); + return systemSettings.defaultApprover; +})()", + }, + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 691, + "y": 168, + }, + "exclusiveGateway-abbb089758c8": { + "x": 434, + "y": 89.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 946, + "y": 78.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 936, + "y": 242.015625, + }, + "scriptTask-ca9504ae90d8": { + "x": 136, + "y": 111.015625, + }, + "scriptTask-e8842de66fbb": { + "x": 693, + "y": 79.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action('iga/commons/config/iga_access_request', 'GET', {}, {}); + return systemSettings.defaultApprover; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0359a9d77ee2", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +logger.info("Modify Entitlement request id " + requestId + " - marking request as auto approved."); + +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to user having modify privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request id " + requestId + ". Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Auto-Approval - scriptTask-e8842de66fbb/Auto-Approval - scriptTask-e8842de66fbb.json 1`] = ` +{ + "displayName": "Auto-Approval", + "name": "scriptTask-e8842de66fbb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0359a9d77ee2", + }, + ], + "script": { + "file": "Auto-Approval - scriptTask-e8842de66fbb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Context Gateway - exclusiveGateway-abbb089758c8/Context Gateway - exclusiveGateway-abbb089758c8.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-abbb089758c8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-e8842de66fbb", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-abbb089758c8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.js 1`] = ` +"// This permission check script will check that the requester has proper privileges to +// modify the user for which they are requesting. If so, it will +// skip any approval process and directly move to modify the user. + +var content = execution.getVariables(); +var requestId = content.get('id'); +logger.info("Modify User - Permission check - request id " + requestId); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a managed user, check that the user has permissions to + var userId = requestObj.request.user.userId; + var requesterId = requester.id.split('/'); + var userResponse = openidm.action('iga/governance/user/', 'GET', {}, {'endUserId': requesterId[2], 'scopePermission': 'modifyUser', '_queryFilter': \`id+eq+'\` + userId + \`'\`}) + if(userResponse.result[0].permissions.modifyUser){ + skipApproval = true; + } + } + else{ + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed - request id " + requestId + ": " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Permission Check - scriptTask-ca9504ae90d8/Permission Check - scriptTask-ca9504ae90d8.json 1`] = ` +{ + "displayName": "Permission Check", + "name": "scriptTask-ca9504ae90d8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-abbb089758c8", + }, + ], + "script": { + "file": "Permission Check - scriptTask-ca9504ae90d8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Modify User - rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Update User - scriptTask-0359a9d77ee2/Update User - scriptTask-0359a9d77ee2.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +logger.info("Modify User request id " + requestId + " - modifying user"); + +var failureReason = null; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +} +catch (e) { + failureReason = "Modify user failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + var modifiedAttributes = requestObj.request.user.object; + var userId = requestObj.request.user.userId; + try { + var payload = []; + + for(var key in modifiedAttributes) { + payload.push({ + "operation": "replace", + "field": "/" + key, + "value": modifiedAttributes[key] + }) + } + + var result = openidm.patch('managed/alpha_user/' + userId , null, payload); + } + catch (e) { + failureReason = "Modify user failed - request id " + requestId + ": Error updating user " + userId + ". Error message: " + e.message; + logger.warn(failureReason); + } +} + +// Build the payload to update the request object with the final status, decision, and outcome +var decision = {'status': 'complete', 'decision': 'approved'}; +if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; +} +else { + decision.outcome = 'provisioned'; +} + +// Update request +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/ModifyUser/steps/Update User - scriptTask-0359a9d77ee2/Update User - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Update User", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Update User - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/custom-1-BasicEntitlementGrant.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "custom-1-BasicEntitlementGrant", + "displayName": "custom-1-BasicEntitlementGrant", + "id": "custom1BasicEntitlementGrant", + "mutable": true, + "name": "custom-1-BasicEntitlementGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2597, + "y": 322, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-48e748c42994": { + "x": 1731, + "y": 88.015625, + }, + "exclusiveGateway-67a954f33919": { + "x": 467, + "y": 121.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 948, + "y": 57.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2255, + "y": 48.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1972, + "y": 119.015625, + }, + "scriptTask-0b56191887de": { + "x": 1979, + "y": 212.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1434, + "y": 95.015625, + }, + "scriptTask-91769554db51": { + "x": 2561, + "y": 74.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1441, + "y": 268.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 186, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 716, + "y": 74.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1208, + "y": 30.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Provisioning - scriptTask-0359a9d77ee2/Custom Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var authzRoleId = content.get('authzRoleId'); + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + + + // --- Conditional authzRoles patch for custom/internal role entitlements --- + if (entitlementType === 'custom' && accountAttribute === 'authzRoles') { + try { + openidm.patch( + 'managed/alpha_user/' + request.common.userId, + null, + [{ + "operation": "add", + "field": "/authzRoles/-", + "value": { "_ref": "internal/role/" + authzRoleId } + }] + ); + logger.info("custom-BasicEntitlementGrant - authzRoles patch successful" + + " | userId: " + request.common.userId + + " | entitlementId: " + authzRoleId); + } catch (e) { + failureReason = "Provisioning succeeded but authzRoles patch failed" + + " for user " + request.common.userId + + " and entitlement " + authzRoleId + + ". Error: " + e.message; + logger.error(failureReason); + } + } + + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Provisioning - scriptTask-0359a9d77ee2/Custom Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Custom Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Custom Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Approved - scriptTask-e21178ab80f7/Custom Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +var entitlementType = content.get('entitlementType'); + +try { + var decision = { + "decision": "approved", + } + if(skipApproval && entitlementType == 'custom'){ + decision.comment = "Custom request auto-approved due to request context: " + context; + } + else if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Approved - scriptTask-e21178ab80f7/Custom Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Custom Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Custom Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Context Check - scriptTask-e04f42607ba5/Custom Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* + * Script Node: Context & Type Check + * Purpose: Reads request context and entitlement type to set routing outcomes. + * Sets: context, waits, skipApproval, entitlementType, entitlementId, userId, failureReason, accountAttribute, authzRoleId + */ + +logger.info("custom-BasicEntitlementGrant - Context & Type Check"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +var entitlementType = null; +var entitlementId = null; +var userId = null; +var failureReason = null; +var accountAttribute = null; +var authzRoleId = null; + +// Read request object +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + // --- Context check --- + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + + // --- Wait flags --- + if (requestObj.request.common.startDate) { + enableWait = true; + } + if (requestObj.request.common.endDate) { + enableEndWait = true; + } + + // --- User --- + userId = requestObj.request.common.userId; + + // --- Entitlement ID --- + entitlementId = requestObj.request.common.entitlementId; + + // Entitlement type + if (entitlementId) { + try { + var entitlementObj = openidm.action('iga/governance/entitlement/' + entitlementId, 'GET', {}, {}); + if (entitlementObj + && entitlementObj.glossary + && entitlementObj.glossary.idx + && entitlementObj.glossary.idx['/entitlement'] + && entitlementObj.glossary.idx['/entitlement'].entitlementType) { + + entitlementType = entitlementObj.glossary.idx['/entitlement'].entitlementType; + + } else { + entitlementType = 'standard'; + } + + // --- authzRoleId --- + if (entitlementObj + && entitlementObj.entitlement + && entitlementObj.entitlement._id) { + + authzRoleId = entitlementObj.entitlement._id; + + } + + // --- accountAttribute --- + accountAttribute = (entitlementObj + && entitlementObj.item + && entitlementObj.item.accountAttribute) + ? entitlementObj.item.accountAttribute + : null; + } catch (e) { + logger.warn("Entitlement lookup error: " + e.message); + + entitlementType = 'standard'; + } + } else { + entitlementType = 'standard'; + } + + // --- Log comment to request audit trail --- + try { + var logComment = "Context & Type Check" + + " | userId: " + userId + + " | context: " + context + + " | entitlementId: " + entitlementId + + " | entitlementType: " + entitlementType + + " | skipApproval: " + skipApproval + + " | authzRoleId: " + authzRoleId; + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } + +} catch (e) { + failureReason = 'Context & Type Check failed: ' + e.message; + logger.error(failureReason); +} + +logger.info("Context: " + context + " | EntitlementType: " + entitlementType + " | UserId: " + userId); + +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +execution.setVariable("entitlementType", entitlementType); +execution.setVariable("entitlementId", entitlementId); +execution.setVariable("userId", userId); +execution.setVariable("failureReason", failureReason); +execution.setVariable("accountAttribute", accountAttribute); +execution.setVariable("authzRoleId", authzRoleId); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Custom Request Context Check - scriptTask-e04f42607ba5/Custom Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Custom Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Custom Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-1-BasicEntitlementGrant/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/custom-BasicEntitlementGrant.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "custom-BasicEntitlementGrant", + "displayName": "custom-BasicEntitlementGrant", + "id": "customBasicEntitlementGrant", + "mutable": true, + "name": "custom-BasicEntitlementGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2873, + "y": 976, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 184, + "y": 470, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 998, + "y": 810, + }, + "exclusiveGateway-26e6b56a6d6b": { + "x": 736, + "y": 231.03125, + }, + "exclusiveGateway-48e748c42994": { + "x": 2007, + "y": 742.015625, + }, + "exclusiveGateway-526a06894733": { + "x": 571, + "y": 458, + }, + "exclusiveGateway-67a954f33919": { + "x": 743, + "y": 775.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 1224, + "y": 711.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2531, + "y": 702.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 2248, + "y": 773.015625, + }, + "scriptTask-0b56191887de": { + "x": 2255, + "y": 866.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1710, + "y": 749.015625, + }, + "scriptTask-6dc428f459a8": { + "x": 1026, + "y": 152.515625, + }, + "scriptTask-91769554db51": { + "x": 2837, + "y": 728.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1717, + "y": 922.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 300, + "y": 472.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 992, + "y": 728.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1484, + "y": 684.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Auto Approval - scriptTask-6dc428f459a8/Custom Auto Approval - scriptTask-6dc428f459a8.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request type custom auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Auto Approval - scriptTask-6dc428f459a8/Custom Auto Approval - scriptTask-6dc428f459a8.json 1`] = ` +{ + "displayName": "Custom Auto Approval", + "name": "scriptTask-6dc428f459a8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Custom Auto Approval - scriptTask-6dc428f459a8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b/Custom Context Gateway - exclusiveGateway-26e6b56a6d6b.json 1`] = ` +{ + "displayName": "Custom Context Gateway", + "name": "exclusiveGateway-26e6b56a6d6b", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-6dc428f459a8", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Custom Context Gateway - exclusiveGateway-26e6b56a6d6b.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* + * Script Node: Context & Type Check + * Purpose: Reads request context and entitlement type to set routing outcomes. + * Sets: context, waits, skipApproval, entitlementType, entitlementId, userId, failureReason, accountAttribute + */ + +logger.info("custom-BasicEntitlementGrant - Context & Type Check"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +var entitlementType = null; +var entitlementId = null; +var userId = null; +var failureReason = null; +var accountAttribute = null; + +// Read request object +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + // Context check (admin requests skip approval) + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + + // Optional Waits + if (requestObj.request.common.startDate) { + enableWait = true; + } + if (requestObj.request.common.endDate) { + enableEndWait = true; + } + + // User + userId = requestObj.request.common.userId; + + // Entitlement ID + entitlementId = requestObj.request.common.entitlementId; + + // Entitlement type + if (entitlementId) { + try { + var entitlementObj = openidm.action('iga/governance/entitlement/' + entitlementId, 'GET', {}, {}); + if (entitlementObj + && entitlementObj.glossary + && entitlementObj.glossary.idx + && entitlementObj.glossary.idx['/entitlement'] + && entitlementObj.glossary.idx['/entitlement'].entitlementType) { + + entitlementType = entitlementObj.glossary.idx['/entitlement'].entitlementType; + + } else { + entitlementType = 'standard'; + } + + // accountAttribute for provisioning node + accountAttribute = (entitlementObj + && entitlementObj.item + && entitlementObj.item.accountAttribute) + ? entitlementObj.item.accountAttribute + : null; + } catch (e) { + logger.warn("Entitlement lookup error: " + e.message); + + entitlementType = 'standard'; + } + } else { + entitlementType = 'standard'; + } + + +} catch (e) { + failureReason = 'Context & Type Check failed: ' + e.message; + logger.error(failureReason); +} + +logger.info("Context: " + context + " | EntitlementType: " + entitlementType + " | UserId: " + userId + " | AuthzRoleId: " + authzRoleId); + +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +execution.setVariable("entitlementType", entitlementType); +execution.setVariable("entitlementId", entitlementId); +execution.setVariable("userId", userId); +execution.setVariable("failureReason", failureReason); +execution.setVariable("accountAttribute", accountAttribute); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-526a06894733", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-526a06894733/Validation Gateway - exclusiveGateway-526a06894733.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Validation Gateway - exclusiveGateway-526a06894733/Validation Gateway - exclusiveGateway-526a06894733.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-526a06894733", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "entitlementType == 'custom'", + "outcome": "validationSuccess", + "step": "exclusiveGateway-26e6b56a6d6b", + }, + { + "condition": "entitlementType != 'custom'", + "outcome": "validationFailure", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-526a06894733.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/custom-BasicEntitlementGrant/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/extendGrantEndDate.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "Basic Workflow to extend a grant end date", + "displayName": "Basic Grant End date Extension", + "id": "extendGrantEndDate", + "mutable": false, + "name": "extendGrantEndDate", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2087, + "y": 210, + }, + "startNode": { + "connections": { + "start": "scriptTask-b80009644545", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var userId = null; + const grantType = requestIndex.request.common.grantType; + if (grantType == 'roleMembership') { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + userId = requestIndex.roleOwner[0].id; + } + else if (systemSettings && systemSettings.defaultApprover) { + var approver = systemSettings.defaultApprover; + return approver; + } + } else if (grantType == 'entitlementGrant') { + userId = (requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id; + } else if (grantType == 'accountGrant') { + userId = requestIndex.applicationOwner[0].id + } + return [{ + "id": "managed/user/" + userId , + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 724, + "y": 277, + }, + "exclusiveGateway-2bf686c17905": { + "x": 457, + "y": 95.015625, + }, + "scriptTask-0c9ab2d8fd7f": { + "x": 1518, + "y": 114.015625, + }, + "scriptTask-b80009644545": { + "x": 164, + "y": 108.015625, + }, + "scriptTask-ba009484a101": { + "x": 1035, + "y": 114.015625, + }, + "scriptTask-c58309b8c470": { + "x": 1320, + "y": 373, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var userId = null; + const grantType = requestIndex.request.common.grantType; + if (grantType == 'roleMembership') { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + userId = requestIndex.roleOwner[0].id; + } + else if (systemSettings && systemSettings.defaultApprover) { + var approver = systemSettings.defaultApprover; + return approver; + } + } else if (grantType == 'entitlementGrant') { + userId = (requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id; + } else if (grantType == 'accountGrant') { + userId = requestIndex.applicationOwner[0].id + } + return [{ + "id": "managed/user/" + userId , + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-ba009484a101", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Context Gateway - exclusiveGateway-2bf686c17905/Context Gateway - exclusiveGateway-2bf686c17905.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Context Gateway - exclusiveGateway-2bf686c17905/Context Gateway - exclusiveGateway-2bf686c17905.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-2bf686c17905", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-ba009484a101", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-2bf686c17905.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Request Approval - scriptTask-ba009484a101/Request Approval - scriptTask-ba009484a101.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved" + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Request Approval - scriptTask-ba009484a101/Request Approval - scriptTask-ba009484a101.json 1`] = ` +{ + "displayName": "Request Approval", + "name": "scriptTask-ba009484a101", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-0c9ab2d8fd7f", + }, + ], + "script": { + "file": "Request Approval - scriptTask-ba009484a101.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Request Context Check - scriptTask-b80009644545/Request Context Check - scriptTask-b80009644545.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var skipApproval = false; +var lineItemId = null; +var campaignId = null; +var enableWait = false; + +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + // Set execution variables from the request context + context = requestObj.request.common.context.type; + if (context == 'admin' || context == 'certification') { + skipApproval = true; + } + if (context == 'certification') { + lineItemId = requestObj.request.common.context.lineItemId; + campaignId = requestObj.request.common.context.campaignId + + // Add a comment on the certification item denoting the request ID + var commentResp = openidm.action('/iga/governance/certification/' + campaignId + '/items/comment', 'POST', { "ids": [lineItemId], "comment": "ID of application removal request: " + requestId }, {}) + } + + } + if (requestObj.request.common.endDate){ + enableWait = true; + } +} +catch (e) { + logger.info("Could not validate request context, normal approval process will be followed.") +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("lineItemId", lineItemId); +execution.setVariable("enableWait", enableWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/Request Context Check - scriptTask-b80009644545/Request Context Check - scriptTask-b80009644545.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-b80009644545", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-2bf686c17905", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-b80009644545.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/UpdateRevokeRequest - scriptTask-0c9ab2d8fd7f/UpdateRevokeRequest - scriptTask-0c9ab2d8fd7f.js 1`] = ` +"logger.info("Update existing revoke request with new extended end date"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var extendRequest = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (!extendRequest || !extendRequest.request || !extendRequest.request.common) { + throw new Error("Invalid extendRequest structure"); + } + logger.info("extendRequestObj: " + extendRequest); + + var catalogFieldMapper = { + "roleMembership": "roleId", + "accountGrant": "applicationId", + "entitlementGrant": "entitlementId" + } + + var grantType = extendRequest.request.common.grantType; + + if (!catalogFieldMapper[grantType]) { + throw new Error("Unsupported grantType: " + grantType); + } + var body = { + "targetFilter": { + "operand": [{ + "operator": "EQUALS", + "operand": { "targetName": "decision.status", "targetValue": "suspended" } + }, { + "operator": "EQUALS", + "operand": { "targetName": "request.common.userId", "targetValue": extendRequest.request.common.userId } + }, { + "operator": "EQUALS", + "operand": { "targetName": "request.common." + catalogFieldMapper[grantType], "targetValue": extendRequest.request.common.grantId } + }], + "operator": "AND" + } + } + logger.info('suspended request search body'+ JSON.stringify(body)); + var suspendedRequest = openidm.action('iga/governance/requests/search/', 'POST', body, {}); + if (suspendedRequest && suspendedRequest.result && suspendedRequest.result.length > 0) { + var suspendedReq = suspendedRequest.result[0]; + logger.info("found existing suspendedRequest: " + suspendedReq); + + if (!suspendedReq.decision || !suspendedReq.decision.phases || suspendedReq.decision.phases.length === 0) { + throw new Error("No decision phases found for suspended request " + suspendedReq.id); + } + + let queryParams = { + '_action': "changeResumeDate" + } + + let payload = { + "resumeDate": extendRequest.request.common.endDate + } + + var updateResult = openidm.action('iga/governance/requests/' + suspendedReq.id, 'POST', payload, queryParams) + logger.info("Successfully updated existing suspendedRequest: " + updateResult); + } + else { + // create a new revoke request with updated end date + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "userId": extendRequest.request.common.userId, + "endDate": extendRequest.request.common.endDate, + "sourceRequestId": requestId, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + newRequestPayload.common[catalogFieldMapper[grantType]] = extendRequest.request.common.grantId; + logger.info("newRequestPayload" + JSON.stringify(newRequestPayload)); + var queryParam = { + '_action': "publish" + } + const removeEndpoint = { + "roleMembership": "roleRemove", + "accountGrant": "applicationRemove", + "entitlementGrant": "entitlementRemove" + } + + var createResult = openidm.action('iga/governance/requests/'+ removeEndpoint[grantType], 'POST', newRequestPayload, queryParam) + logger.info("Successfully created new revoke request with an end date: " + createResult); + } + + var decision = {'outcome': 'fulfilled', 'status': 'complete'}; + var queryParams = { '_action': 'update'}; + logger.info("before updating workflow extend request" + decision); + var updateRes = openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("after updating workflow extend request" + updateRes); +} +catch (e) { + failureReason = "Update Revoke Request with extended end date failed: Error request with id " + e; + logger.info(failureReason); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/extendGrantEndDate/steps/UpdateRevokeRequest - scriptTask-0c9ab2d8fd7f/UpdateRevokeRequest - scriptTask-0c9ab2d8fd7f.json 1`] = ` +{ + "displayName": "UpdateRevokeRequest", + "name": "scriptTask-0c9ab2d8fd7f", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "UpdateRevokeRequest - scriptTask-0c9ab2d8fd7f.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/jh-ne-create-test-2.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "jh-ne-create-test-2", + "displayName": "jh-ne-create-test-2", + "id": "jhNeCreateTest2", + "mutable": true, + "name": "jh-ne-create-test-2", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1463, + "y": 262, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-2131bbe3663d", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "approvalTask-6649e6d6f2a3": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 606.3999938964844, + "y": 431.6125030517578, + }, + "emailTask-731854fb34db": { + "x": 1119.3999938964844, + "y": 107.61250305175781, + }, + "exclusiveGateway-69f93dd39054": { + "x": 394.3999938964844, + "y": 252.6125030517578, + }, + "scriptTask-2131bbe3663d": { + "x": 156.39999389648438, + "y": 252.6125030517578, + }, + "scriptTask-c174d2210667": { + "x": 814.3999938964844, + "y": 43.61250305175781, + }, + "scriptTask-f2a2d7eee947": { + "x": 821.3999938964844, + "y": 298.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/%22Create%22 User - scriptTask-f2a2d7eee947/%22Create%22 User - scriptTask-f2a2d7eee947.js 1`] = ` +"logger.info("Creating User"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var request = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + request = requestObj.request; + + + + // var payload = { + // "userName": request.custom.userName, + // "givenName": request.custom.givenName, + // "sn": request.custom.sn, + // "mail": request.custom.mail, + // "password": 'DemoP@ssword1' + // }; + + /** Create new user **/ + // var result = openidm.create('managed/alpha_user', null, payload, queryParams); + + // /** Send new user email **/ + // var body = { + // subject: "Welcome " + payload.givenName + " " + payload.sn + "!", + // to: payload.mail, + // body: "Your new user has been created in the system.\\n\\nUsername: " + payload.userName + "\\nPassword: " + payload.password + "\\n\\nLogin to your account here: https://openam-gov-dev-4.forgeblocks.com/am/XUI/?realm=/alpha#/", + // object: {} + // }; + // openidm.action("external/email", "send", body); + } + catch (e) { + failureReason = "Creating user failed: Error during creation of user " + request.custom.userName + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved', "comment": JSON.stringify(request)}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/%22Create%22 User - scriptTask-f2a2d7eee947/%22Create%22 User - scriptTask-f2a2d7eee947.json 1`] = ` +{ + "displayName": ""Create" User", + "name": "scriptTask-f2a2d7eee947", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-731854fb34db", + }, + ], + "script": { + "file": "%22Create%22 User - scriptTask-f2a2d7eee947.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Account Creation Email - emailTask-731854fb34db/Account Creation Email - emailTask-731854fb34db.json 1`] = ` +{ + "displayName": "Account Creation Email", + "emailTask": { + "bcc": "", + "cc": "", + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": null, + }, + { + "condition": null, + "outcome": "FAILED", + "step": null, + }, + ], + "object": { + "cn": "9959348", + "custom_DisplayName": "Jack Hatton", + "custom_LocationName": "remote", + "custom_siteLocation": "remote", + "manager": "test", + }, + "templateName": "staffNe1AccountCreation", + "to": "jhatton@trivir.com", + }, + "name": "emailTask-731854fb34db", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Approval Task - approvalTask-6649e6d6f2a3/Approval Task - approvalTask-6649e6d6f2a3.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6a2d0e09-a9ac-41ca-af24-8af052c480f2", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-f2a2d7eee947", + }, + { + "condition": null, + "outcome": "REJECT", + "step": null, + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-6649e6d6f2a3", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Auto Approve Gateway - exclusiveGateway-69f93dd39054/Auto Approve Gateway - exclusiveGateway-69f93dd39054.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Auto Approve Gateway - exclusiveGateway-69f93dd39054/Auto Approve Gateway - exclusiveGateway-69f93dd39054.json 1`] = ` +{ + "displayName": "Auto Approve Gateway", + "name": "exclusiveGateway-69f93dd39054", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApprove", + "step": "scriptTask-c174d2210667", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-6649e6d6f2a3", + }, + ], + "script": { + "file": "Auto Approve Gateway - exclusiveGateway-69f93dd39054.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Mark Approved - scriptTask-c174d2210667/Mark Approved - scriptTask-c174d2210667.js 1`] = ` +"logger.info("Create User - marking request as auto approved."); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var queryParams = { "_action": "update" } + +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to requester having create user privileges." + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Mark Approved - scriptTask-c174d2210667/Mark Approved - scriptTask-c174d2210667.json 1`] = ` +{ + "displayName": "Mark Approved", + "name": "scriptTask-c174d2210667", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-731854fb34db", + }, + ], + "script": { + "file": "Mark Approved - scriptTask-c174d2210667.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Permissions Check - scriptTask-2131bbe3663d/Permissions Check - scriptTask-2131bbe3663d.js 1`] = ` +"logger.info("Create User - Permission check"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var skipApproval = false; + +try { + // Read the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requester = requestObj.requester + + if(requester.id.startsWith('managed/user/')){ + // If requester is a normal managed user, check that the user has permissions to create a user + var userId = requester.id.split('/'); + var user = openidm.action('iga/governance/user', 'GET', {}, {'endUserId': userId[2], 'scopePermission': 'createUser', '_queryFilter': \`id+eq+'\` + userId[2] + \`'\`}) + if(user.result.length > 0){ + skipApproval = true; + } + } + else{ + // Tenant admins and system requests + skipApproval = true; + } +} +catch (e) { + logger.info("Request permission check failed: " + e.message); +} + +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/jh-ne-create-test-2/steps/Permissions Check - scriptTask-2131bbe3663d/Permissions Check - scriptTask-2131bbe3663d.json 1`] = ` +{ + "displayName": "Permissions Check", + "name": "scriptTask-2131bbe3663d", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-69f93dd39054", + }, + ], + "script": { + "file": "Permissions Check - scriptTask-2131bbe3663d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/pgh-generate-rap.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "pgh-generate-rap", + "displayName": "pgh-generate-rap", + "id": "pghGenerateRap", + "mutable": true, + "name": "pgh-generate-rap", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1156, + "y": 151, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-115d1ab72679", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 70, + "y": 151, + }, + "uiConfig": { + "exclusiveGateway-2d4351f5c77b": { + "x": 451, + "y": 126.5, + }, + "fulfillmentTask-f49f20d19149": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDateType": "duration", + "expirationDateVariable": "", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 683, + "y": 126.5, + }, + "scriptTask-115d1ab72679": { + "x": 208, + "y": 158, + }, + "scriptTask-5a2b73dd9dd2": { + "x": 916, + "y": 80, + }, + "scriptTask-6f260211dc0f": { + "x": 916, + "y": 226, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Auto Approve - scriptTask-5a2b73dd9dd2/Auto Approve - scriptTask-5a2b73dd9dd2.js 1`] = ` +"function updateRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "update" }); +} + +function modifyRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "modify", phaseName: execution.getVariables().get('phaseName') }); +} + +function commentRequest(message, isFail) { + return updateRequest({ comment: message, failure: isFail }); +} + +function approveRequest() { + updateRequest({ + outcome: 'fulfilled', + status: 'complete', + decision: 'approved' + }); +} + +function main() { + try { + modifyRequest({ + common: { + isDraft: false, + context: { + type: "request" + } + }, + custom: { + idPath: execution.getVariables().get('idPath'), + rap: "" + } + }); + approveRequest(); + } catch (e) { + commentRequest("Failure auto-approving RAP request. Error message: " + e.message, true); + } +} + +main(); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Auto Approve - scriptTask-5a2b73dd9dd2/Auto Approve - scriptTask-5a2b73dd9dd2.json 1`] = ` +{ + "displayName": "Auto Approve", + "name": "scriptTask-5a2b73dd9dd2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto Approve - scriptTask-5a2b73dd9dd2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Auto Reject - scriptTask-6f260211dc0f/Auto Reject - scriptTask-6f260211dc0f.js 1`] = ` +"function updateRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "update" }); +} + +function modifyRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action('iga/governance/requests/' + requestId, 'POST', body, { _action: "modify", phaseName: execution.getVariables().get('phaseName') }); +} + +function commentRequest(message, isFail) { + return updateRequest({ comment: message, failure: isFail }); +} + +function rejectRequest() { + updateRequest({ + outcome: 'cancelled', + status: 'complete', + decision: 'rejected' + }); +} + +function main() { + try { + modifyRequest({ + common: { + isDraft: false, + context: { + type: "request" + } + }, + custom: { + idPath: execution.getVariables().get('idPath'), + rap: "" + } + }); + rejectRequest(); + } catch (e) { + commentRequest("Failure auto-rejecting RAP request. Error message: " + e.message, true); + } +} + +main(); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Auto Reject - scriptTask-6f260211dc0f/Auto Reject - scriptTask-6f260211dc0f.json 1`] = ` +{ + "displayName": "Auto Reject", + "name": "scriptTask-6f260211dc0f", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto Reject - scriptTask-6f260211dc0f.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Confirm RAP - fulfillmentTask-f49f20d19149/Confirm RAP - fulfillmentTask-f49f20d19149.json 1`] = ` +{ + "displayName": "Confirm RAP", + "fulfillmentTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "approvalMode": "any", + "events": {}, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "scriptTask-5a2b73dd9dd2", + }, + { + "condition": null, + "outcome": "DENY", + "step": "scriptTask-6f260211dc0f", + }, + ], + }, + "name": "fulfillmentTask-f49f20d19149", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Generate RAP - scriptTask-115d1ab72679/Generate RAP - scriptTask-115d1ab72679.js 1`] = ` +"function getPublishedWorkflow(workflowId) { + return openidm.action(\`iga/governance/workflow/\${workflowId}/published\`, 'GET', {}, {}); +} + +function getRequestType(requestTypeId) { + return openidm.action(\`iga/governance/requestTypes/\${requestTypeId}\`, 'GET', {}, {}); +} + +function getRequest() { + var requestId = execution.getVariables().get('id'); + return openidm.action(\`iga/governance/requests/\${requestId}\`, 'GET', {}, {}); +} + +function modifyRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action(\`iga/governance/requests/\${requestId}\`, 'POST', body, { _action: "modify", phaseName: execution.getVariables().get('phaseName') }); +} + +function updateRequest(body) { + var requestId = execution.getVariables().get('id'); + return openidm.action(\`iga/governance/requests/\${requestId}\`, 'POST', body, { _action: "update" }); +} + +function commentRequest(message, isFail) { + return updateRequest({ comment: message, failure: !!isFail }); +} + +function main() { + var isSuccessful = false; + try { + var request = getRequest(); + + // Get user ID + var idPath = request.request.custom.idPath; + var userId = idPath.split('/').pop(); + execution.setVariable("idPath", idPath); + + // Get script ID for the phase name + var requestType = getRequestType(request.requestType); + var workflow = getPublishedWorkflow(requestType.workflow.id); + execution.setVariable("phaseName", workflow.staticNodes.startNode.connections.start); + + // Generate RAP + var response = openidm.action('endpoint/helpdesk-rap/generate/' + userId, 'create', {}, {}); + modifyRequest({ + common: { + isDraft: false, + context: { + type: "request" + } + }, + custom: { + idPath: idPath, + rap: response.rap + } + }); + isSuccessful = true; + } catch (e) { + commentRequest("Error generating RAP. Error message: " + e.message, true); + } finally { + execution.setVariable("isSuccessful", isSuccessful); + } +} + +main(); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Generate RAP - scriptTask-115d1ab72679/Generate RAP - scriptTask-115d1ab72679.json 1`] = ` +{ + "displayName": "Generate RAP", + "name": "scriptTask-115d1ab72679", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-2d4351f5c77b", + }, + ], + "script": { + "file": "Generate RAP - scriptTask-115d1ab72679.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Is Successful - exclusiveGateway-2d4351f5c77b/Is Successful - exclusiveGateway-2d4351f5c77b.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/pgh-generate-rap/steps/Is Successful - exclusiveGateway-2d4351f5c77b/Is Successful - exclusiveGateway-2d4351f5c77b.json 1`] = ` +{ + "displayName": "Is Successful", + "name": "exclusiveGateway-2d4351f5c77b", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "isSuccessful == true", + "outcome": "success", + "step": "fulfillmentTask-f49f20d19149", + }, + { + "condition": "isSuccessful == false", + "outcome": "error", + "step": "scriptTask-6f260211dc0f", + }, + ], + "script": { + "file": "Is Successful - exclusiveGateway-2d4351f5c77b.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/phh-BasicApplicationGrant.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-BasicApplicationGrant", + "displayName": "phh-BasicApplicationGrant", + "id": "phhBasicApplicationGrant", + "mutable": true, + "name": "phh-BasicApplicationGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2822, + "y": 352, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-440960b2744d": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1038.7499923706055, + "y": 469.76562881469727, + }, + "approvalTask-5d1d9c5d8384": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1039.2499923706055, + "y": 334.76562881469727, + }, + "approvalTask-6ad92fcbe998": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1037.2499923706055, + "y": 601.7656288146973, + }, + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 1, + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 682, + "y": 155, + }, + "approvalTask-ffa3a83b9dfd": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1039.9999923706055, + "y": 736.7656288146973, + }, + "exclusiveGateway-5167870154a9": { + "x": 1855, + "y": 84, + }, + "exclusiveGateway-621c9996676a": { + "x": 433, + "y": 117.015625, + }, + "inclusiveGateway-2fbd3e7aa50c": { + "x": 803.3999938964844, + "y": 472.6125030517578, + }, + "inclusiveGateway-7d248125a9bd": { + "x": 2417, + "y": 43.015625, + }, + "inclusiveGateway-a71e67faaad1": { + "x": 1124, + "y": 93.015625, + }, + "scriptTask-0e5b6187ea62": { + "x": 889, + "y": 116.015625, + }, + "scriptTask-14acc58c28dd": { + "x": 2650, + "y": 85.015625, + }, + "scriptTask-3a74557440fb": { + "x": 2144, + "y": 62, + }, + "scriptTask-4e9121fe850a": { + "x": 168, + "y": 140.015625, + }, + "scriptTask-626899b6e99a": { + "x": 1549, + "y": 108, + }, + "scriptTask-744ef6a8b9a2": { + "x": 2151, + "y": 207.015625, + }, + "scriptTask-c444d08a6099": { + "x": 818.3999938964844, + "y": 348.6125030517578, + }, + "scriptTask-c58309b8c470": { + "x": 1554, + "y": 242, + }, + "waitTask-13cf96ebeb37": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + "resumeDateVariable": "startDate", + }, + "x": 1339, + "y": 85.015625, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation - scriptTask-626899b6e99a/Application Grant Validation - scriptTask-626899b6e99a.js 1`] = ` +"logger.info("Running application grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var app = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check the user does not already have application granted +// Note: this is done at request submission time as well, the following is an example of how to check user's accounts +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + failureReason = "Validation failed: User with id " + requestObj.user.id + " already has effective application " + applicationId; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check effective applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation - scriptTask-626899b6e99a/Application Grant Validation - scriptTask-626899b6e99a.json 1`] = ` +{ + "displayName": "Application Grant Validation", + "name": "scriptTask-626899b6e99a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-5167870154a9", + }, + ], + "script": { + "file": "Application Grant Validation - scriptTask-626899b6e99a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation Failure - scriptTask-744ef6a8b9a2/Application Grant Validation Failure - scriptTask-744ef6a8b9a2.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Application Grant Validation Failure - scriptTask-744ef6a8b9a2/Application Grant Validation Failure - scriptTask-744ef6a8b9a2.json 1`] = ` +{ + "displayName": "Application Grant Validation Failure", + "name": "scriptTask-744ef6a8b9a2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Application Grant Validation Failure - scriptTask-744ef6a8b9a2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-6ad92fcbe998/Approval Task - approvalTask-6ad92fcbe998.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-6ad92fcbe998", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*1*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-c444d08a6099", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-440960b2744d/Approval Task - approvalTask-440960b2744d.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-440960b2744d", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Approval Task - approvalTask-ffa3a83b9dfd/Approval Task - approvalTask-ffa3a83b9dfd.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-ffa3a83b9dfd", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Check LOB - scriptTask-c444d08a6099/Check LOB - scriptTask-c444d08a6099.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ + +var content = execution.getVariables(); +var requestId = content.get('id'); +var requestObj = null; +var appId = null; +var appGlossary = null; +var lob = null; +try { +requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +appId = requestObj.application.id; +} +catch (e) { +logger.info("Validation failed: Error reading application grant request with id " + requestId); +} +try { +appGlossary = openidm.action('iga/governance/application/' + appId + '/glossary', 'GET', {}, {}); +lob = appGlossary.lineOfBusiness || "default" +execution.setVariable("lob", lob); +} +catch (e) { +logger.info("Could not retrieve glossary with appId " + appId + " from application grant request ID " + requestId); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Check LOB - scriptTask-c444d08a6099/Check LOB - scriptTask-c444d08a6099.json 1`] = ` +{ + "displayName": "Check LOB", + "name": "scriptTask-c444d08a6099", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-2fbd3e7aa50c", + }, + ], + "script": { + "file": "Check LOB - scriptTask-c444d08a6099.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-621c9996676a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-621c9996676a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Create Removal Request - scriptTask-14acc58c28dd/Create Removal Request - scriptTask-14acc58c28dd.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "applicationId": request.common.applicationId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/applicationRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.info("Create Removal Request failed to create request") + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Create Removal Request - scriptTask-14acc58c28dd/Create Removal Request - scriptTask-14acc58c28dd.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-14acc58c28dd", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-14acc58c28dd.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Has End Date - inclusiveGateway-7d248125a9bd/Has End Date - inclusiveGateway-7d248125a9bd.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Has End Date - inclusiveGateway-7d248125a9bd/Has End Date - inclusiveGateway-7d248125a9bd.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-7d248125a9bd", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-14acc58c28dd", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-7d248125a9bd.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Has Start Date - inclusiveGateway-a71e67faaad1/Has Start Date - inclusiveGateway-a71e67faaad1.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Has Start Date - inclusiveGateway-a71e67faaad1/Has Start Date - inclusiveGateway-a71e67faaad1.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-a71e67faaad1", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-13cf96ebeb37", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-626899b6e99a", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-a71e67faaad1.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/LOB - inclusiveGateway-2fbd3e7aa50c/LOB - inclusiveGateway-2fbd3e7aa50c.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/LOB - inclusiveGateway-2fbd3e7aa50c/LOB - inclusiveGateway-2fbd3e7aa50c.json 1`] = ` +{ + "displayName": "LOB", + "name": "inclusiveGateway-2fbd3e7aa50c", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "lob == "sales"", + "outcome": "sales", + "step": "approvalTask-5d1d9c5d8384", + }, + { + "condition": "lob == "finance"", + "outcome": "finance", + "step": "approvalTask-440960b2744d", + }, + { + "condition": "lob == "hr"", + "outcome": "humanResources", + "step": "approvalTask-6ad92fcbe998", + }, + { + "condition": "lob == "default"", + "outcome": "null", + "step": "approvalTask-ffa3a83b9dfd", + }, + ], + "script": { + "file": "LOB - inclusiveGateway-2fbd3e7aa50c.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Provisioning - scriptTask-3a74557440fb/Provisioning - scriptTask-3a74557440fb.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "applicationId": request.common.applicationId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning account to user " + request.common.userId + " for application " + request.common.applicationId + ". Error message: " + message; + } + + var decision = {'status': 'complete'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Provisioning - scriptTask-3a74557440fb/Provisioning - scriptTask-3a74557440fb.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-3a74557440fb", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-7d248125a9bd", + }, + ], + "script": { + "file": "Provisioning - scriptTask-3a74557440fb.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if (skipApproval) { + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-0e5b6187ea62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-a71e67faaad1", + }, + ], + "script": { + "file": "Request Approved - scriptTask-0e5b6187ea62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-621c9996676a", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Sales Approver Role - approvalTask-5d1d9c5d8384/Sales Approver Role - approvalTask-5d1d9c5d8384.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Sales Approver Role", + "name": "approvalTask-5d1d9c5d8384", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Validation Gateway - exclusiveGateway-5167870154a9/Validation Gateway - exclusiveGateway-5167870154a9.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Validation Gateway - exclusiveGateway-5167870154a9/Validation Gateway - exclusiveGateway-5167870154a9.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-5167870154a9", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationSuccess", + "step": "scriptTask-3a74557440fb", + }, + { + "condition": "failureReason != null", + "outcome": "validationFailure", + "step": "scriptTask-744ef6a8b9a2", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-5167870154a9.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-BasicApplicationGrant/steps/Wait Task - waitTask-13cf96ebeb37/Wait Task - waitTask-13cf96ebeb37.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-13cf96ebeb37", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-626899b6e99a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/phh-InternalRoleEntitlementGrant.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-InternalRoleEntitlementGrant", + "displayName": "phh-InternalRoleEntitlementGrant", + "id": "phhInternalRoleEntitlementGrant", + "mutable": true, + "name": "phh-InternalRoleEntitlementGrant", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2597, + "y": 322, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 156, + }, + "exclusiveGateway-48e748c42994": { + "x": 1731, + "y": 88.015625, + }, + "exclusiveGateway-67a954f33919": { + "x": 467, + "y": 121.015625, + }, + "inclusiveGateway-3f85f36eeeef": { + "x": 948, + "y": 57.015625, + }, + "inclusiveGateway-f105ed2b352d": { + "x": 2255, + "y": 48.015625, + }, + "scriptTask-0359a9d77ee2": { + "x": 1972, + "y": 119.015625, + }, + "scriptTask-0b56191887de": { + "x": 1979, + "y": 212.015625, + }, + "scriptTask-3eab1948f1ec": { + "x": 1434, + "y": 95.015625, + }, + "scriptTask-91769554db51": { + "x": 2561, + "y": 74.015625, + }, + "scriptTask-aec6c36b3a45": { + "x": 1441, + "y": 268.015625, + }, + "scriptTask-e04f42607ba5": { + "x": 186, + "y": 143.015625, + }, + "scriptTask-e21178ab80f7": { + "x": 716, + "y": 74.015625, + }, + "waitTask-0d53639996da": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 1208, + "y": 30.015625, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*1*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.js 1`] = ` +"logger.info("Create Removal Request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Create Removal Request failed: Error reading request with id " + requestId; +} + +if(!failureReason){ + try{ + var request = requestObj.request; + var newRequestPayload = { + "common":{ + "context": { + "type": "admin" + }, + "entitlementId": request.common.entitlementId, + "userId": request.common.userId, + "endDate": request.common.endDate, + "justification": "Request submitted automatically to remove access granted by request: " + requestId + } + }; + var queryParam = { + '_action': "publish" + } + openidm.action('iga/governance/requests/entitlementRemove', 'POST', newRequestPayload, queryParam) + }catch(e){ + logger.warn('Create Removal Request failed to create') + } + } +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Create Removal Request - scriptTask-91769554db51/Create Removal Request - scriptTask-91769554db51.json 1`] = ` +{ + "displayName": "Create Removal Request", + "name": "scriptTask-91769554db51", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Create Removal Request - scriptTask-91769554db51.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has End Date - inclusiveGateway-f105ed2b352d/Has End Date - inclusiveGateway-f105ed2b352d.json 1`] = ` +{ + "displayName": "Has End Date", + "name": "inclusiveGateway-f105ed2b352d", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableEndWait == true", + "outcome": "hasEndDate", + "step": "scriptTask-91769554db51", + }, + { + "condition": "enableEndWait == false", + "outcome": "noEndDate", + "step": null, + }, + ], + "script": { + "file": "Has End Date - inclusiveGateway-f105ed2b352d.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Has Start Date - inclusiveGateway-3f85f36eeeef/Has Start Date - inclusiveGateway-3f85f36eeeef.json 1`] = ` +{ + "displayName": "Has Start Date", + "name": "inclusiveGateway-3f85f36eeeef", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "enableWait == true", + "outcome": "hasStartDate", + "step": "waitTask-0d53639996da", + }, + { + "condition": "enableWait == false", + "outcome": "noStartDate", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Has Start Date - inclusiveGateway-3f85f36eeeef.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "auditContext": {}, + "grantType": "request", + "requestId": requestObj.id, + }; + var queryParams = { + "_action": "add", + "initiatingUser": requestObj.requester.id + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + var err = e.javaException; + err = JSON.parse(err.detail); + var message = err && err.body ? err.body.response : e.message; + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + execution.setVariable('enableEndWait', false); + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Provisioning - scriptTask-0359a9d77ee2/Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-f105ed2b352d", + }, + ], + "script": { + "file": "Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if(skipApproval){ + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Approved - scriptTask-e21178ab80f7/Request Approved - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-3f85f36eeeef", + }, + ], + "script": { + "file": "Request Approved - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-InternalRoleEntitlementGrant/steps/Wait Task - waitTask-0d53639996da/Wait Task - waitTask-0d53639996da.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-0d53639996da", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/phh-birthright-roles-requiring-approval.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-birthright-roles-requiring-approval", + "displayName": "phh-birthright-roles-requiring-approval", + "id": "phhBirthrightRolesRequiringApproval", + "mutable": true, + "name": "phh-birthright-roles-requiring-approval", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1303, + "y": 236, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-0e64ff0c1695", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 70, + "y": 151, + }, + "uiConfig": { + "approvalTask-f4e7324654b5": { + "actors": { + "isExpression": true, + "value": "(function() { +var content = execution.getVariables(); +var requestId = content.get('id'); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var approverId = ''; +if (requestIndex.request.common.blob.after.manager) { approverId = requestIndex.request.common.blob.after.manager.id } +return [{ +"id": "managed/user/" + approverId, +"permissions": { +"approve": true, +"reject": true, +"reassign": true, +"modify": true, +"comment": true +} +}]; +})()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 440, + "y": 126.5, + }, + "scriptTask-0e64ff0c1695": { + "x": 210, + "y": 153, + }, + "scriptTask-792e240778b1": { + "x": 712, + "y": 226, + }, + "scriptTask-ad05a46c2e74": { + "x": 712, + "y": 80, + }, + "scriptTask-aecf833994d2": { + "x": 1032, + "y": 153, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Debug Task - scriptTask-0e64ff0c1695/Debug Task - scriptTask-0e64ff0c1695.js 1`] = ` +"logger.info("Running user update event"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var context = null; +var skipApproval = false; +var userObj = null; +var userId = null; +// Read event user information from request object +try { +var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +logger.error("requestObj "+JSON.stringify(requestObj)); +if (requestObj.request.common.context) { +context = requestObj.request.common.context.type; +if (context == 'admin') { +skipApproval = true; +} +} +userObj = requestObj.request.common.blob.after; +userId = userObj.userId; +} +catch (e) { +failureReason = "Validation failed: Error reading request with id " + requestId; +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Debug Task - scriptTask-0e64ff0c1695/Debug Task - scriptTask-0e64ff0c1695.json 1`] = ` +{ + "displayName": "Debug Task", + "name": "scriptTask-0e64ff0c1695", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "approvalTask-f4e7324654b5", + }, + ], + "script": { + "file": "Debug Task - scriptTask-0e64ff0c1695.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Failure Handler - scriptTask-aecf833994d2/Failure Handler - scriptTask-aecf833994d2.js 1`] = ` +"logger.info("Failure Handler: BirthRight Roles that need Approval "); +var content = execution.getVariables(); +var requestId = content.get('requestId'); +var failureReason = content.get('failureReason'); +// Update event request as final +if (failureReason) { +var decision = {'status': 'complete', 'outcome': 'cancelled', 'decision': 'rejected', 'comment': failureReason, 'failure': true} +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Failure Handler - scriptTask-aecf833994d2/Failure Handler - scriptTask-aecf833994d2.json 1`] = ` +{ + "displayName": "Failure Handler", + "name": "scriptTask-aecf833994d2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Failure Handler - scriptTask-aecf833994d2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Finalize Request on Reject - scriptTask-ad05a46c2e74/Finalize Request on Reject - scriptTask-ad05a46c2e74.js 1`] = ` +"logger.info("Finalize Request:BirthRight Roles that need Approval"); +var content = execution.getVariables(); +var requestId = content.get('requestId'); +var failureState = content.get('failureState'); +if (!failureState) { +try { +// Update event request as final +var decision = {'status': 'complete', 'outcome': 'fulfilled', 'decision': 'rejected'} +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +} +catch (e) { +execution.setVariable("failureState", "Unable to finalize request."); +} +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Finalize Request on Reject - scriptTask-ad05a46c2e74/Finalize Request on Reject - scriptTask-ad05a46c2e74.json 1`] = ` +{ + "displayName": "Finalize Request on Reject", + "name": "scriptTask-ad05a46c2e74", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-aecf833994d2", + }, + ], + "script": { + "file": "Finalize Request on Reject - scriptTask-ad05a46c2e74.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Look Up Roles and Request - scriptTask-792e240778b1/Look Up Roles and Request - scriptTask-792e240778b1.js 1`] = ` +"logger.info("Running user update event"); +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var userObj = null; +var userId = null; +// +// Read event user information from request object +try { +var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +userObj = requestObj.request.common.blob.after; +userId = userObj.userId; +} +catch (e) { +failureReason = "Validation failed: Error reading request with id " + requestId; +} +///Get Roles from Role Variable +var roleNames = requestObj.request.common.blob.parameters.roleNames.split(','); +logger.error("UpdateRequest with roleNames: " + roleNames); +// Look up roles in catalog +var operand = []; +for (var index in roleNames) { +var role = roleNames[index]; +var roleClean = role.trim(); +operand.push({operator: "EQUALS", operand: { targetName: "role.name", targetValue: roleClean }}) +} +var body = { targetFilter: {operator: "OR", operand: operand}}; +var catalog = openidm.action("iga/governance/catalog/search", "POST", body); +var catalogResults = catalog.result; +// Define request catalogs key +var catalogBody = []; +for (var idx in catalogResults) { +var catalog = catalogResults[idx]; +catalogBody.push({type: "role", id: catalog.id}) +} +// Define request payload +var requestBody = { +priority: "low", +accessModifier: "add", +justification: "Request submitted on user update.", +users: [ userId ], +catalogs: catalogBody, +context: { +type: "NoAdmin" +} +}; +// Create requests +try { +logger.error("DRLCREATING REQUST for "+JSON.stringify(body)); +openidm.action("iga/governance/requests", "POST", requestBody, {_action: "create"}) +} +catch (e) { +failureReason = "Unable to generate requests for roles"; +} +// Update event request as final +var decision = failureReason ? +{'status': 'complete', 'outcome': 'cancelled', 'decision': 'rejected', 'comment': failureReason, 'failure': true} : +{'status': 'complete', 'outcome': 'fulfilled', 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +logger.info("Request " + requestId + " completed."); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Look Up Roles and Request - scriptTask-792e240778b1/Look Up Roles and Request - scriptTask-792e240778b1.json 1`] = ` +{ + "displayName": "Look Up Roles and Request", + "name": "scriptTask-792e240778b1", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Look Up Roles and Request - scriptTask-792e240778b1.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-birthright-roles-requiring-approval/steps/Manager Approval - approvalTask-f4e7324654b5/Manager Approval - approvalTask-f4e7324654b5.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "(function() { +var content = execution.getVariables(); +var requestId = content.get('id'); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var approverId = ''; +if (requestIndex.request.common.blob.after.manager) { approverId = requestIndex.request.common.blob.after.manager.id } +return [{ +"id": "managed/user/" + approverId, +"permissions": { +"approve": true, +"reject": true, +"reassign": true, +"modify": true, +"comment": true +} +}]; +})()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-792e240778b1", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-ad05a46c2e74", + }, + ], + }, + "displayName": "Manager Approval", + "name": "approvalTask-f4e7324654b5", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/phh-delegated-user-disable-workflow.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-delegated-user-disable-workflow", + "displayName": "phh-delegated-user-disable-workflow", + "id": "phhDelegatedUserDisableWorkflow", + "mutable": true, + "name": "phh-delegated-user-disable-workflow", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 1563, + "y": 352, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-3d854e98930e", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "approvalTask-bebe49db4dac": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "type": "manager", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1177, + "y": 60.61250305175781, + }, + "exclusiveGateway-26e0a9262468": { + "x": 438.3999938964844, + "y": 232.6125030517578, + }, + "exclusiveGateway-d5b7b2e2a80a": { + "x": 931.7999877929688, + "y": 111.61250305175781, + }, + "scriptTask-38eb13f4deca": { + "x": 648.3999938964844, + "y": 343.6125030517578, + }, + "scriptTask-3d854e98930e": { + "x": 175.39999389648438, + "y": 251.6125030517578, + }, + "scriptTask-449aac6b18b8": { + "x": 1149.3999938964844, + "y": 236.6125030517578, + }, + "scriptTask-4f4b87291099": { + "x": 1442.9999694824219, + "y": 101.61250305175781, + }, + "scriptTask-8e24794e9be4": { + "x": 649.3999938964844, + "y": 132.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Auth Check - exclusiveGateway-26e0a9262468/Auth Check - exclusiveGateway-26e0a9262468.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Auth Check - exclusiveGateway-26e0a9262468/Auth Check - exclusiveGateway-26e0a9262468.json 1`] = ` +{ + "displayName": "Auth Check", + "name": "exclusiveGateway-26e0a9262468", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "hasDelegationAuthority == true", + "outcome": "validationSuccess", + "step": "scriptTask-8e24794e9be4", + }, + { + "condition": "hasDelegationAuthority == false", + "outcome": "validationFailure", + "step": "scriptTask-38eb13f4deca", + }, + ], + "script": { + "file": "Auth Check - exclusiveGateway-26e0a9262468.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - No Authority - scriptTask-38eb13f4deca/Auto-Reject - No Authority - scriptTask-38eb13f4deca.js 1`] = ` +"/* + * Auto-Reject - No Delegation Authority + * Rejects request if user has no direct reports + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +console.log("Auto-rejecting request " + requestId + " - no delegation authority"); + +try { + var decision = { + 'decision': 'rejected', + 'status': 'complete', + 'comment': 'Request automatically rejected: You do not have any direct reports in the system. You cannot submit delegation requests without having direct reports assigned to you.\\n\\nPlease contact your administrator if you believe this is an error.' + }; + + var updateParams = { + '_action': 'update' + }; + + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, updateParams); + + console.log("Request " + requestId + " rejected successfully"); + +} catch (e) { + console.log("Error rejecting request: " + e.message); + throw e; +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - No Authority - scriptTask-38eb13f4deca/Auto-Reject - No Authority - scriptTask-38eb13f4deca.json 1`] = ` +{ + "displayName": "Auto-Reject - No Authority", + "name": "scriptTask-38eb13f4deca", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto-Reject - No Authority - scriptTask-38eb13f4deca.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8.js 1`] = ` +"/* + * Auto-Reject - Validation Failed + * Rejects request with detailed error messages + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); +var validationErrors = content.get('validationErrors') || "Validation failed"; + +console.log("Auto-rejecting request due to validation errors"); + +try { + var decision = { + 'decision': 'rejected', + 'status': 'complete', + 'comment': 'Request automatically rejected due to validation errors:\\n\\n' + validationErrors + '\\n\\nPlease correct the errors and submit a new request.' + }; + + var updateParams = { + '_action': 'update' + }; + + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, updateParams); + + console.log("Request " + requestId + " rejected - validation failed"); + +} catch (e) { + console.log("Error rejecting request: " + e.message); + throw e; +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8/Auto-Reject - Validation Failed - scriptTask-449aac6b18b8.json 1`] = ` +{ + "displayName": "Auto-Reject - Validation Failed", + "name": "scriptTask-449aac6b18b8", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto-Reject - Validation Failed - scriptTask-449aac6b18b8.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Disable User Account - scriptTask-4f4b87291099/Disable User Account - scriptTask-4f4b87291099.js 1`] = ` +"/* + * Fulfillment - Disable User Account + * Disables the target user's account + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); +var targetUserId = content.get('targetUserId'); +var justification = content.get('justification'); +var actingPrincipalUserName = content.get('actingPrincipalUserName'); + +console.log("=== Fulfillment Start ==="); +console.log("Disabling user ID: " + targetUserId); + +try { + // Read current user state + var targetUser = openidm.read("managed/alpha_user/" + targetUserId); + + if (!targetUser) { + throw new Error("Target user not found: " + targetUserId); + } + + console.log("Current user status: " + (targetUser.accountStatus || "active")); + + // Prepare patch operations to disable the account + var patchOperations = [ + { + "operation": "replace", + "field": "/accountStatus", + "value": "inactive" + } + ]; + + // Add a description/note about the disable action + if (targetUser.description) { + patchOperations.push({ + "operation": "replace", + "field": "/description", + "value": targetUser.description + "\\n[" + new Date().toISOString() + "] Disabled via delegation by " + actingPrincipalUserName + ". Reason: " + justification + }); + } else { + patchOperations.push({ + "operation": "add", + "field": "/description", + "value": "[" + new Date().toISOString() + "] Disabled via delegation by " + actingPrincipalUserName + ". Reason: " + justification + }); + } + + // Execute the patch + var updateResult = openidm.patch("managed/alpha_user/" + targetUserId, null, patchOperations); + + console.log("User " + targetUser.userName + " successfully disabled"); + console.log("Account status set to: inactive"); + + // Set success variables + execution.setVariable("fulfillmentStatus", "completed"); + execution.setVariable("fulfillmentMessage", "User account " + targetUser.userName + " has been successfully disabled"); + + // Update request with completion details + try { + var requestUpdate = { + 'status': 'complete', + 'decision': 'approved' + }; + + openidm.action('iga/governance/requests/' + requestId, 'POST', requestUpdate, {'_action': 'update'}); + } catch (updateError) { + console.log("Could not update request status: " + updateError.message); + } + +} catch (e) { + logger.error("Fulfillment error: " + e.message); + execution.setVariable("fulfillmentStatus", "failed"); + execution.setVariable("fulfillmentMessage", "Error disabling user: " + e.message); + + // Don't throw - let workflow complete but mark as failed + // You might want to send a notification here +} + +console.log("=== Fulfillment Complete ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Disable User Account - scriptTask-4f4b87291099/Disable User Account - scriptTask-4f4b87291099.json 1`] = ` +{ + "displayName": "Disable User Account", + "name": "scriptTask-4f4b87291099", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Disable User Account - scriptTask-4f4b87291099.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Load Delegation Info - scriptTask-3d854e98930e/Load Delegation Info - scriptTask-3d854e98930e.js 1`] = ` +"/* + * Load Delegation Information + * Populates available direct reports for the requester + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +console.log("=== Load Delegation Info Start ==="); +console.log("Request ID: " + requestId); + +try { + // Get the request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var requesterId = requestObj.requester.id; + var requesterIdOnly = requesterId.replace("managed/user/", ""); + + console.log("Requester ID: " + requesterIdOnly); + + // Query users where current user is the manager + var queryParams = { + "_queryFilter": 'manager._id eq "' + requesterIdOnly + '"', + "_fields": "userName,givenName,sn,_id" + }; + + var results = openidm.query("managed/alpha_user", queryParams); + + // Build a formatted list for display + var directReportsList = ""; + var directReportsCount = 0; + + if (results.resultCount > 0) { + directReportsList = "You can act on behalf of the following users:\\n\\n"; + results.result.forEach(function(user) { + directReportsList += "• " + user.userName + " (" + user.givenName + " " + user.sn + ")\\n"; + }); + directReportsCount = results.resultCount; + logger.info("Found " + directReportsCount + " direct reports"); + } else { + directReportsList = "You do not have any direct reports in the system.\\n\\nYou cannot submit delegation requests without direct reports."; + logger.warn("No direct reports found"); + } + + // Store variables for later use + execution.setVariable("directReportsList", directReportsList); + execution.setVariable("directReportsCount", directReportsCount); + execution.setVariable("hasDelegationAuthority", directReportsCount > 0); + + // Update the request to populate the helper field + // This updates the form display for the user + var updatePayload = { + "request": { + "common": { + "blob": { + "form": { + "availableDirectReports": directReportsList + } + } + } + } + }; + + openidm.patch('iga/governance/requests/' + requestId, null, [ + { + "operation": "add", + "field": "/request/common/blob/form/availableDirectReports", + "value": directReportsList + } + ]); + + console.log("Direct reports list populated in form"); + +} catch (e) { + logger.error("Error loading delegation info: " + e.message); + execution.setVariable("hasDelegationAuthority", false); + execution.setVariable("directReportsCount", 0); + execution.setVariable("directReportsList", "Error loading your direct reports. Please contact your administrator."); +} + +console.log("=== Load Delegation Info Complete ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Load Delegation Info - scriptTask-3d854e98930e/Load Delegation Info - scriptTask-3d854e98930e.json 1`] = ` +{ + "displayName": "Load Delegation Info", + "name": "scriptTask-3d854e98930e", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-26e0a9262468", + }, + ], + "script": { + "file": "Load Delegation Info - scriptTask-3d854e98930e.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Manager Approval - approvalTask-bebe49db4dac/Manager Approval - approvalTask-bebe49db4dac.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "doNothing", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-4f4b87291099", + }, + { + "condition": null, + "outcome": "REJECT", + "step": null, + }, + ], + }, + "displayName": "Manager Approval", + "name": "approvalTask-bebe49db4dac", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Validate Delegation Request - scriptTask-8e24794e9be4/Validate Delegation Request - scriptTask-8e24794e9be4.js 1`] = ` +"/* + * Validate Delegation Request + * Validates all user inputs and delegation authority + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +console.log("=== Validation Start ==="); + +var validationPassed = false; +var validationErrors = []; +var actingPrincipalObject = null; +var targetUserObject = null; + +try { + // Get request object with form data + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + var requesterId = requestObj.requester.id; + var requesterIdOnly = requesterId.replace("managed/user/", ""); + + // Extract form values + var actingPrincipalUsername = requestObj.request.common.blob.form.actingPrincipalId; + var targetUserUsername = requestObj.request.common.blob.form.targetUserId; + var justification = requestObj.request.common.blob.form.justification; + + console.log("Acting Principal Username: " + actingPrincipalUsername); + console.log("Target User Username: " + targetUserUsername); + + // Validate acting principal + if (!actingPrincipalUsername || actingPrincipalUsername.trim() === "") { + validationErrors.push("Acting Principal username is required"); + } else { + try { + var actingPrincipalQuery = { + "_queryFilter": 'userName eq "' + actingPrincipalUsername.trim() + '"' + }; + var actingPrincipalResults = openidm.query("managed/alpha_user", actingPrincipalQuery); + + if (actingPrincipalResults.resultCount === 0) { + validationErrors.push("Acting Principal user not found: " + actingPrincipalUsername); + } else if (actingPrincipalResults.resultCount > 1) { + validationErrors.push("Multiple users found with username: " + actingPrincipalUsername); + } else { + actingPrincipalObject = actingPrincipalResults.result[0]; + + // Verify requester is manager of acting principal + if (!actingPrincipalObject.manager || !actingPrincipalObject.manager._id) { + validationErrors.push("Acting Principal does not have a manager assigned"); + } else if (actingPrincipalObject.manager._id !== requesterIdOnly) { + validationErrors.push("You are not the manager of " + actingPrincipalUsername + ". You can only act on behalf of your direct reports."); + } else { + console.log("Acting Principal validated: " + actingPrincipalObject.userName); + } + } + } catch (e) { + validationErrors.push("Error validating Acting Principal: " + e.message); + } + } + + // Validate target user + if (!targetUserUsername || targetUserUsername.trim() === "") { + validationErrors.push("Target User username is required"); + } else { + try { + var targetUserQuery = { + "_queryFilter": 'userName eq "' + targetUserUsername.trim() + '"' + }; + var targetUserResults = openidm.query("managed/alpha_user", targetUserQuery); + + if (targetUserResults.resultCount === 0) { + validationErrors.push("Target User not found: " + targetUserUsername); + } else if (targetUserResults.resultCount > 1) { + validationErrors.push("Multiple users found with username: " + targetUserUsername); + } else { + targetUserObject = targetUserResults.result[0]; + + // Verify user type is External + if (targetUserObject.userType !== "External") { + validationErrors.push("Target User must be of type 'External'. User " + targetUserUsername + " is type: " + (targetUserObject.userType || "Unknown")); + } else { + console.log("Target User validated: " + targetUserObject.userName); + } + } + } catch (e) { + validationErrors.push("Error validating Target User: " + e.message); + } + } + + // Validate justification + if (!justification || justification.trim() === "") { + validationErrors.push("Justification is required"); + } else if (justification.trim().length < 10) { + validationErrors.push("Justification must be at least 10 characters"); + } + + // Prevent self-disable via delegation + if (actingPrincipalObject && targetUserObject && actingPrincipalObject._id === targetUserObject._id) { + validationErrors.push("Cannot disable the same user you are acting on behalf of"); + } + + // Check if all validations passed + if (validationErrors.length === 0) { + validationPassed = true; + + // Store user details for display in approval + execution.setVariable("actingPrincipalUserName", actingPrincipalObject.userName); + execution.setVariable("actingPrincipalFullName", actingPrincipalObject.givenName + " " + actingPrincipalObject.sn); + execution.setVariable("actingPrincipalId", actingPrincipalObject._id); + + execution.setVariable("targetUserUserName", targetUserObject.userName); + execution.setVariable("targetUserFullName", targetUserObject.givenName + " " + targetUserObject.sn); + execution.setVariable("targetUserId", targetUserObject._id); + + execution.setVariable("justification", justification); + + console.log("All validations passed"); + } else { + console.log("Validation failed: " + validationErrors.join("; ")); + } + +} catch (e) { + validationPassed = false; + validationErrors.push("System error during validation: " + e.message); + console.log("Validation exception: " + e.message); +} + +// Set workflow variables +execution.setVariable("validationPassed", validationPassed); +execution.setVariable("validationErrors", validationErrors.join("\\n")); + +console.log("=== Validation Complete: " + (validationPassed ? "PASSED" : "FAILED") + " ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Validate Delegation Request - scriptTask-8e24794e9be4/Validate Delegation Request - scriptTask-8e24794e9be4.json 1`] = ` +{ + "displayName": "Validate Delegation Request", + "name": "scriptTask-8e24794e9be4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-d5b7b2e2a80a", + }, + ], + "script": { + "file": "Validate Delegation Request - scriptTask-8e24794e9be4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-delegated-user-disable-workflow/steps/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a/Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a.json 1`] = ` +{ + "displayName": "Validation Passed?", + "name": "exclusiveGateway-d5b7b2e2a80a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "validationPassed == true", + "outcome": "validationSuccess", + "step": "approvalTask-bebe49db4dac", + }, + { + "condition": "validationPassed == false", + "outcome": "validationFailure", + "step": "scriptTask-449aac6b18b8", + }, + ], + "script": { + "file": "Validation Passed%3F - exclusiveGateway-d5b7b2e2a80a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-ne-disable/phh-ne-disable.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-ne-disable", + "displayName": "phh-ne-disable", + "id": "phhNeDisable", + "mutable": true, + "name": "phh-ne-disable", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 601, + "y": 255, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-99fdf317c49b", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "scriptTask-99fdf317c49b": { + "x": 270.3999938964844, + "y": 250.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-ne-disable/steps/Load Delegate Sources - scriptTask-99fdf317c49b/Load Delegate Sources - scriptTask-99fdf317c49b.js 1`] = ` +"/* + * Load Delegate Sources + * Queries users the current requester can act on behalf of + */ + +var content = execution.getVariables(); +var requestId = content.get('_id'); + +try { + // Get the request to find requester + var requestObj = openidm.read('iga/governance/requests/' + requestId); + var requesterId = requestObj.requester.id; + var requesterIdOnly = requesterId.replace("managed/user/", ""); + + console.log("=== Loading Delegation Options ==="); + console.log("Requester ID: " + requesterIdOnly); + + // Query users where current user is the manager + var queryParams = { + "_queryFilter": 'manager._id eq "' + requesterIdOnly + '"', + "_fields": "userName,givenName,sn,mail,_id" + }; + + var results = openidm.query("managed/alpha_user", queryParams); + console.log("Results: " + results); + + // Build options array + var options = []; + + if (results.resultCount > 0) { + results.result.forEach(function(user) { + options.push({ + "value": user._id, + "label": user.givenName + " " + user.sn + " (" + user.userName + ")" + }); + }); + + logger.info("Found " + options.length + " delegation options"); + } else { + logger.warn("No direct reports found for requester"); + options.push({ + "value": "", + "label": "No direct reports found" + }); + } + + // Store options as JSON string + execution.setVariable("delegationOptions", JSON.stringify(options)); + execution.setVariable("hasDelegationOptions", results.resultCount > 0); + execution.setVariable("delegationOptionsCount", results.resultCount); + +} catch (e) { + logger.error("Error loading delegation options: " + e.message); + execution.setVariable("delegationOptions", "[]"); + execution.setVariable("hasDelegationOptions", false); + execution.setVariable("delegationOptionsCount", 0); +} + +logger.info("=== Delegation Options Loaded ==="); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-ne-disable/steps/Load Delegate Sources - scriptTask-99fdf317c49b/Load Delegate Sources - scriptTask-99fdf317c49b.json 1`] = ` +{ + "displayName": "Load Delegate Sources", + "name": "scriptTask-99fdf317c49b", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Load Delegate Sources - scriptTask-99fdf317c49b.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/phh-new-user-create.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phh-new-user-create", + "displayName": "phh-new-user-create", + "id": "phhNewUserCreate", + "mutable": true, + "name": "phh-new-user-create", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 1348, + "y": 177.5, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 177.5, + }, + "uiConfig": { + "approvalTask-75cf4247ba1d": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 777, + "y": 226, + }, + "exclusiveGateway-621c9996676a": { + "x": 514, + "y": 153, + }, + "scriptTask-0e5b6187ea62": { + "x": 777, + "y": 80, + }, + "scriptTask-4e9121fe850a": { + "x": 210, + "y": 179.5, + }, + "scriptTask-626899b6e99a": { + "x": 1049, + "y": 97.66666666666667, + }, + "scriptTask-c58309b8c470": { + "x": 1049, + "y": 234.83333333333334, + }, + }, + }, + "status": "published", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Approval Task - approvalTask-75cf4247ba1d/Approval Task - approvalTask-75cf4247ba1d.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/9de92b26-e91e-44b7-ac81-7ae1c6adf9ad", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-626899b6e99a", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-75cf4247ba1d", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Context Gateway - exclusiveGateway-621c9996676a/Context Gateway - exclusiveGateway-621c9996676a.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-621c9996676a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-75cf4247ba1d", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-621c9996676a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if (skipApproval) { + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-0e5b6187ea62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-626899b6e99a", + }, + ], + "script": { + "file": "Request Approved - scriptTask-0e5b6187ea62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-621c9996676a", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/User Create Validation - scriptTask-626899b6e99a/User Create Validation - scriptTask-626899b6e99a.js 1`] = ` +"logger.info("[phh] Creating User"); +function generateUsername(givenName, surname) { +const usernamePrefix = (givenName[0] + surname[0]).toLowerCase(); +const data = openidm.query("managed/alpha_user", {'_queryFilter': \`userName sw "\${usernamePrefix}"\`}, ["userName"]); +const usernames = data.result.map(user => user.userName); +let i = 1; +while (i<100000 && usernames.includes(usernamePrefix + String(i).padStart(5, '0'))) { +i++; +} +return usernamePrefix + String(i).padStart(5, '0'); +} +function createUser(custom) { +var startDate = new Date(custom.startDate).toISOString(); +var endDate = new Date(custom.endDate).toISOString(); +var payload = { +"userName": custom.userName, +"givenName": custom.givenName, +"sn": custom.sn, +"mail": custom.mail, +"password": custom.password, +"frIndexedDate5":startDate, +"frIndexedDate4":endDate +}; +return openidm.create('managed/alpha_user', null, payload); +} +function process(requestObj) { +var custom = requestObj.request.custom +custom.userName = generateUsername(custom.givenName, custom.sn); +custom.password = 'Password!234'; +const result = createUser(custom); +return { outcome: "provisioned" }; +} +try { +const requestId = execution.getVariables().get("id"); +const requestObj = openidm.action(\`iga/governance/requests/\${requestId}\`, "GET", {}, {}); +let decision = { status: "complete", "decision": "approved" }; +try { +const result = process(requestObj); +Object.assign(decision, result); +} catch (error) { +Object.assign(decision, { outcome: "unknown", comment: \`Error processing request \${requestId}: \${e.message}\`, failure: true }); +} +openidm.action(\`iga/governance/requests/\${requestId}\`, 'POST', decision, { _action: "update"}); +} catch (e) { +logger.error(\`Error reading request \${requestId}: \${e}\`); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phh-new-user-create/steps/User Create Validation - scriptTask-626899b6e99a/User Create Validation - scriptTask-626899b6e99a.json 1`] = ` +{ + "displayName": "User Create Validation", + "name": "scriptTask-626899b6e99a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "User Create Validation - scriptTask-626899b6e99a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/phhCustomWorkflow.json 1`] = ` +{ + "_rev": 7, + "childType": false, + "description": "phhCustomWorkflow", + "displayName": "phhCustomWorkflow", + "id": "phhCustomWorkflow", + "mutable": true, + "name": "phhCustomWorkflow", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 955, + "y": 174, + }, + "startNode": { + "connections": { + "start": "scriptTask-4e9121fe850a", + }, + "id": "startNode", + "x": 70, + "y": 140, + }, + "uiConfig": { + "approvalTask-74cf85c35437": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 448, + "y": 124, + }, + "scriptTask-0e5b6187ea62": { + "x": 683, + "y": 128.015625, + }, + "scriptTask-4e9121fe850a": { + "x": 168, + "y": 140.015625, + }, + "scriptTask-c58309b8c470": { + "x": 688, + "y": 207, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/steps/Approval Task - approvalTask-74cf85c35437/Approval Task - approvalTask-74cf85c35437.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/6b21c283-d491-4fd9-8322-898c171c7018", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "expiration": { + "action": "reject", + "actors": [], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-0e5b6187ea62", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-c58309b8c470", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-74cf85c35437", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +// Complete request as rejected +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/steps/Reject Request - scriptTask-c58309b8c470/Reject Request - scriptTask-c58309b8c470.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-c58309b8c470", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-c58309b8c470.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var skipApproval = content.get('skipApproval'); +var queryParams = { + "_action": "update" +} +try { + var decision = { + "decision": "approved", + } + if (skipApproval) { + decision.comment = "Request auto-approved due to request context: " + context; + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = { 'comment': failureReason, 'failure': true }; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/steps/Request Approved - scriptTask-0e5b6187ea62/Request Approved - scriptTask-0e5b6187ea62.json 1`] = ` +{ + "displayName": "Request Approved", + "name": "scriptTask-0e5b6187ea62", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Request Approved - scriptTask-0e5b6187ea62.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var enableWait = false; +var enableEndWait = false; +var skipApproval = false; +try { + // Read request object + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + if (context == 'admin') { + skipApproval = true; + } + } + if (requestObj.request.common.startDate){ + enableWait = true; + } + if (requestObj.request.common.endDate){ + enableEndWait = true; + } +} +catch (e) { + logger.info("Request Context Check failed " + e.message); +} +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("enableWait", enableWait); +execution.setVariable("enableEndWait", enableEndWait); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhCustomWorkflow/steps/Request Context Check - scriptTask-4e9121fe850a/Request Context Check - scriptTask-4e9121fe850a.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-4e9121fe850a", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "approvalTask-74cf85c35437", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-4e9121fe850a.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/phhFlow.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "phhFlow", + "displayName": "phhFlow", + "id": "phhFlow", + "mutable": true, + "name": "phhFlow", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 564, + "y": 312, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "scriptTask-10bf48033687", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "approvalTask-bf52ce203a81": { + "actors": { + "isExpression": true, + "value": " +//Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + + + return [{ + "id": "managed/user/" + requestIndex.applicationOwner[0].id, + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})() + + + +( +function(){ +// --- Log comment to request audit trail --- + try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var logComment = "Context Check" + + " | applicationOwner: " + requestObj.applicationOwner[0].id + + " | full dump: " + JSON.stringify(requestObj); + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } + return []; +} +)() +", + }, + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 153.39999389648438, + "y": 268.6125030517578, + }, + "scriptTask-10bf48033687": { + "x": 162.39999389648438, + "y": 140.6125030517578, + }, + "scriptTask-610744f7d369": { + "x": 357.3999938964844, + "y": 370.6125030517578, + }, + "scriptTask-c28119ea007e": { + "x": 360.3999938964844, + "y": 256.6125030517578, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/steps/Approval Task - approvalTask-bf52ce203a81/Approval Task - approvalTask-bf52ce203a81.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": " +//Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + + + + return [{ + "id": "managed/user/" + requestIndex.applicationOwner[0].id, + "permissions": { + "approve": true, + "reject": true, + "reassign": true, + "modify": true, + "comment": true + } + }]; +})() + + + +( +function(){ +// --- Log comment to request audit trail --- + try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + var logComment = "Context Check" + + " | applicationOwner: " + requestObj.applicationOwner[0].id + + " | full dump: " + JSON.stringify(requestObj); + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } + return []; +} +)() +", + }, + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-c28119ea007e", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-610744f7d369", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-bf52ce203a81", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/steps/Approve - scriptTask-c28119ea007e/Approve - scriptTask-c28119ea007e.js 1`] = ` +"logger.info("Approving request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info("Execution Content: " + content); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/steps/Approve - scriptTask-c28119ea007e/Approve - scriptTask-c28119ea007e.json 1`] = ` +{ + "displayName": "Approve", + "name": "scriptTask-c28119ea007e", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Approve - scriptTask-c28119ea007e.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/steps/Context Check - scriptTask-10bf48033687/Context Check - scriptTask-10bf48033687.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + } + // --- Log comment to request audit trail --- + try { + var logComment = "Context Check" + + " | full dump: " + JSON.stringify(requestObj); + + + openidm.action( + 'iga/governance/requests/' + requestId, + 'POST', + { 'comment': logComment }, + { '_action': 'update' } + ); + } catch (e) { + logger.error("Failed to write log comment: " + e.message); + } +} +catch (e) { + logger.info("Request Context Check failed "+e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/steps/Context Check - scriptTask-10bf48033687/Context Check - scriptTask-10bf48033687.json 1`] = ` +{ + "displayName": "Context Check", + "name": "scriptTask-10bf48033687", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "approvalTask-bf52ce203a81", + }, + ], + "script": { + "file": "Context Check - scriptTask-10bf48033687.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/steps/Script Task - scriptTask-610744f7d369/Script Task - scriptTask-610744f7d369.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info("Execution Content: " + content); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/phhFlow/steps/Script Task - scriptTask-610744f7d369/Script Task - scriptTask-610744f7d369.json 1`] = ` +{ + "displayName": "Script Task", + "name": "scriptTask-610744f7d369", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Script Task - scriptTask-610744f7d369.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test/steps/Wait Task - waitTask-4d9223fb79c5/Wait Task - waitTask-4d9223fb79c5.json 1`] = ` +{ + "displayName": "Wait Task", + "name": "waitTask-4d9223fb79c5", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": null, + }, + ], + "resumeDate": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(1*30*24*60*60*1000))).toISOString()", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test/test.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "test", + "displayName": "test", + "id": "test", + "mutable": true, + "name": "test", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 500, + "y": 50, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "waitTask-4d9223fb79c5", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 50, + "y": 250, + }, + "uiConfig": { + "waitTask-4d9223fb79c5": { + "events": { + "resumeDateNumber": 1, + "resumeDateTimeSpan": "month(s)", + "resumeDateType": "duration", + }, + "x": 285.3999938964844, + "y": 211.22499084472656, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Approval Task - approvalTask-7e33e73d6763/Custom Approval Task - approvalTask-7e33e73d6763.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate1", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate1", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "content.customExpirationDuration", + }, + "notification": "FrodoTestEmailTemplate1", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate1", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(4*30*24*60*60*1000))).toISOString()", + }, + "frequency": 4, + "notification": "FrodoTestEmailTemplate1", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-7fce35a32915", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task", + "name": "approvalTask-7e33e73d6763", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Approval Task 2 - approvalTask-363e32acf981/Custom Approval Task 2 - approvalTask-363e32acf981.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-29a71d4ab8ed", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task 2", + "name": "approvalTask-363e32acf981", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Email Task - emailTask-2068f5d711c8/Custom Email Task - emailTask-2068f5d711c8.json 1`] = ` +{ + "displayName": "Custom Email Task", + "emailTask": { + "bcc": { + "isExpression": true, + "value": "// This is the bcc script +"bcc@email.com";", + }, + "cc": { + "isExpression": true, + "value": "// This is the cc script +"cc@email.com";", + }, + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-b7fc169ca4eb", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": { + "hello": "goodbye", + "hi": "hola", + }, + "templateName": "frodoTestEmailTemplateFour", + "to": { + "isExpression": true, + "value": "// This is the to script +"to@email.com";", + }, + }, + "name": "emailTask-2068f5d711c8", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Email Task 2 - emailTask-881f2975e240/Custom Email Task 2 - emailTask-881f2975e240.json 1`] = ` +{ + "displayName": "Custom Email Task 2", + "emailTask": { + "bcc": "bcc@email.com", + "cc": "cc@email.com", + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-72d593301121", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": {}, + "templateName": "frodoTestEmailTemplateFour", + "to": "to@email.com", + }, + "name": "emailTask-881f2975e240", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Fulfillment Task - fulfillmentTask-7fce35a32915/Custom Fulfillment Task - fulfillmentTask-7fce35a32915.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task", + "fulfillmentTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate2", + }, + "escalation": { + "actors": [ + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate2", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate2", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate2", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(2*30*24*60*60*1000))).toISOString()", + }, + "frequency": 2, + "notification": "FrodoTestEmailTemplate2", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "exclusiveGateway-94bc3d35f3b4", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-7fce35a32915", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task 2", + "fulfillmentTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "content.customExpirationDate", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "emailTask-881f2975e240", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-29a71d4ab8ed", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.json 1`] = ` +{ + "displayName": "Custom Inclusive Gateway", + "name": "inclusiveGateway-a6cf9605ce55", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "// This is outcome 1 +outcome === 1", + "outcome": "outcomeOne", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 2 +outcome === 2", + "outcome": "outcomeTwo", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 3 +outcome === 3", + "outcome": "outcomeThree", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.json 1`] = ` +{ + "displayName": "Custom Script Task", + "name": "scriptTask-493f5ea87636", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-2068f5d711c8", + }, + ], + "script": { + "file": "Custom Script Task - scriptTask-493f5ea87636.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.json 1`] = ` +{ + "displayName": "Custom Validation Gateway", + "name": "exclusiveGateway-94bc3d35f3b4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "// This is a validation success +outcome == true", + "outcome": "validationSuccess", + "step": "inclusiveGateway-a6cf9605ce55", + }, + { + "condition": "// This is a validation failure +outcome == false", + "outcome": "validationFailure", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Violation Task - violationTask-50261d9bc712/Custom Violation Task - violationTask-50261d9bc712.json 1`] = ` +{ + "displayName": "Custom Violation Task", + "name": "violationTask-50261d9bc712", + "type": "violationTask", + "violationTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate3", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*7*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate3", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(8*30*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate3", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate3", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "FrodoTestEmailTemplate3", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Violation Task 2 - violationTask-f8066518b46a/Custom Violation Task 2 - violationTask-f8066518b46a.json 1`] = ` +{ + "displayName": "Custom Violation Task 2", + "name": "violationTask-f8066518b46a", + "type": "violationTask", + "violationTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "approvalMode": "any", + "events": {}, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Wait Task - waitTask-b7fc169ca4eb/Custom Wait Task - waitTask-b7fc169ca4eb.json 1`] = ` +{ + "displayName": "Custom Wait Task", + "name": "waitTask-b7fc169ca4eb", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "approvalTask-363e32acf981", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*30*24*60*60*1000))).toISOString()", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Wait Task 2 - waitTask-72d593301121/Custom Wait Task 2 - waitTask-72d593301121.json 1`] = ` +{ + "displayName": "Custom Wait Task 2", + "name": "waitTask-72d593301121", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "waitTask-b343cc7df7c9", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/steps/Custom Wait Task 3 - waitTask-b343cc7df7c9/Custom Wait Task 3 - waitTask-b343cc7df7c9.json 1`] = ` +{ + "displayName": "Custom Wait Task 3", + "name": "waitTask-b343cc7df7c9", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "violationTask-f8066518b46a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "content.get('resumeDate')", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_1/test_workflow_1.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "test_workflow_1", + "displayName": "test_workflow_1", + "id": "testWorkflow1", + "mutable": true, + "name": "test_workflow_1", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 826, + "y": 50, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "approvalTask-7e33e73d6763", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 20, + "y": 42, + }, + "uiConfig": { + "approvalTask-363e32acf981": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + { + "id": { + "isExpression": false, + "value": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + "type": "role", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "type": "manager", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "type": "roleOwner", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 478.3999938964844, + "y": 195.6125030517578, + }, + "approvalTask-7e33e73d6763": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDuration", + "expirationTimeSpan": "hour(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "reminderDate": 4, + "reminderTimeSpan": "month(s)", + }, + "x": 146.39999389648438, + "y": 15.61250305175781, + }, + "emailTask-2068f5d711c8": { + "x": 150.39999389648438, + "y": 648.812502861023, + }, + "emailTask-881f2975e240": { + "x": 478.3999938964844, + "y": 474.41250228881836, + }, + "exclusiveGateway-94bc3d35f3b4": { + "x": 145.39999389648438, + "y": 274.6125030517578, + }, + "fulfillmentTask-29a71d4ab8ed": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDate", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 479.3999938964844, + "y": 334.41250228881836, + }, + "fulfillmentTask-7fce35a32915": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "hour(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "reminderDate": 2, + "reminderTimeSpan": "month(s)", + }, + "x": 145.39999389648438, + "y": 146.6125030517578, + }, + "inclusiveGateway-a6cf9605ce55": { + "x": 147.39999389648438, + "y": 405.6125030517578, + }, + "scriptTask-493f5ea87636": { + "x": 148.39999389648438, + "y": 570.6125030517578, + }, + "violationTask-50261d9bc712": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "week(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "reminderDate": 3, + "reminderTimeSpan": "hour(s)", + }, + "x": 480.3999938964844, + "y": 13.61250305175781, + }, + "violationTask-f8066518b46a": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationType": "applicationOwner", + "expirationDateType": "variable", + "expirationDateVariable": "taskExpirationDate", + "reassignedActors": [], + }, + "x": 788.3999938964844, + "y": 613.4125022888184, + }, + "waitTask-72d593301121": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 476.3999938964844, + "y": 612.4125022888184, + }, + "waitTask-b343cc7df7c9": { + "events": { + "resumeDateNumber": 1, + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "variable", + "resumeDateVariable": "resumeDate", + }, + "x": 476.3999938964844, + "y": 694.4125022888184, + }, + "waitTask-b7fc169ca4eb": { + "events": { + "resumeDateNumber": 5, + "resumeDateTimeSpan": "month(s)", + "resumeDateType": "duration", + }, + "x": 148.39999389648438, + "y": 779.812502861023, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Approval Task - approvalTask-7e33e73d6763/Custom Approval Task - approvalTask-7e33e73d6763.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate1", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate1", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "content.customExpirationDuration", + }, + "notification": "FrodoTestEmailTemplate1", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate1", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(4*30*24*60*60*1000))).toISOString()", + }, + "frequency": 4, + "notification": "FrodoTestEmailTemplate1", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-7fce35a32915", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task", + "name": "approvalTask-7e33e73d6763", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Approval Task 2 - approvalTask-363e32acf981/Custom Approval Task 2 - approvalTask-363e32acf981.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-29a71d4ab8ed", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task 2", + "name": "approvalTask-363e32acf981", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Email Task - emailTask-2068f5d711c8/Custom Email Task - emailTask-2068f5d711c8.json 1`] = ` +{ + "displayName": "Custom Email Task", + "emailTask": { + "bcc": { + "isExpression": true, + "value": "// This is the bcc script +"bcc@email.com";", + }, + "cc": { + "isExpression": true, + "value": "// This is the cc script +"cc@email.com";", + }, + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-b7fc169ca4eb", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": { + "hello": "goodbye", + "hi": "hola", + }, + "templateName": "frodoTestEmailTemplateFour", + "to": { + "isExpression": true, + "value": "// This is the to script +"to@email.com";", + }, + }, + "name": "emailTask-2068f5d711c8", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Email Task 2 - emailTask-881f2975e240/Custom Email Task 2 - emailTask-881f2975e240.json 1`] = ` +{ + "displayName": "Custom Email Task 2", + "emailTask": { + "bcc": "bcc@email.com", + "cc": "cc@email.com", + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-72d593301121", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": {}, + "templateName": "frodoTestEmailTemplateFour", + "to": "to@email.com", + }, + "name": "emailTask-881f2975e240", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Fulfillment Task - fulfillmentTask-7fce35a32915/Custom Fulfillment Task - fulfillmentTask-7fce35a32915.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task", + "fulfillmentTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate2", + }, + "escalation": { + "actors": [ + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate2", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate2", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate2", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(2*30*24*60*60*1000))).toISOString()", + }, + "frequency": 2, + "notification": "FrodoTestEmailTemplate2", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "exclusiveGateway-94bc3d35f3b4", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-7fce35a32915", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task 2", + "fulfillmentTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "content.customExpirationDate", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "emailTask-881f2975e240", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-29a71d4ab8ed", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.json 1`] = ` +{ + "displayName": "Custom Inclusive Gateway", + "name": "inclusiveGateway-a6cf9605ce55", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "// This is outcome 1 +outcome === 1", + "outcome": "outcomeOne", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 2 +outcome === 2", + "outcome": "outcomeTwo", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 3 +outcome === 3", + "outcome": "outcomeThree", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.json 1`] = ` +{ + "displayName": "Custom Script Task", + "name": "scriptTask-493f5ea87636", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-2068f5d711c8", + }, + ], + "script": { + "file": "Custom Script Task - scriptTask-493f5ea87636.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.json 1`] = ` +{ + "displayName": "Custom Validation Gateway", + "name": "exclusiveGateway-94bc3d35f3b4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "// This is a validation success +outcome == true", + "outcome": "validationSuccess", + "step": "inclusiveGateway-a6cf9605ce55", + }, + { + "condition": "// This is a validation failure +outcome == false", + "outcome": "validationFailure", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Violation Task - violationTask-50261d9bc712/Custom Violation Task - violationTask-50261d9bc712.json 1`] = ` +{ + "displayName": "Custom Violation Task", + "name": "violationTask-50261d9bc712", + "type": "violationTask", + "violationTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate3", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*7*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate3", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(8*30*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate3", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate3", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "FrodoTestEmailTemplate3", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Violation Task 2 - violationTask-f8066518b46a/Custom Violation Task 2 - violationTask-f8066518b46a.json 1`] = ` +{ + "displayName": "Custom Violation Task 2", + "name": "violationTask-f8066518b46a", + "type": "violationTask", + "violationTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "approvalMode": "any", + "events": {}, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Wait Task - waitTask-b7fc169ca4eb/Custom Wait Task - waitTask-b7fc169ca4eb.json 1`] = ` +{ + "displayName": "Custom Wait Task", + "name": "waitTask-b7fc169ca4eb", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "approvalTask-363e32acf981", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*30*24*60*60*1000))).toISOString()", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Wait Task 2 - waitTask-72d593301121/Custom Wait Task 2 - waitTask-72d593301121.json 1`] = ` +{ + "displayName": "Custom Wait Task 2", + "name": "waitTask-72d593301121", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "waitTask-b343cc7df7c9", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/steps/Custom Wait Task 3 - waitTask-b343cc7df7c9/Custom Wait Task 3 - waitTask-b343cc7df7c9.json 1`] = ` +{ + "displayName": "Custom Wait Task 3", + "name": "waitTask-b343cc7df7c9", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "violationTask-f8066518b46a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "content.get('resumeDate')", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/test_workflow_4/test_workflow_4.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "test_workflow_4", + "displayName": "test_workflow_4", + "id": "testWorkflow4", + "mutable": true, + "name": "test_workflow_4", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 826, + "y": 50, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "approvalTask-7e33e73d6763", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 20, + "y": 42, + }, + "uiConfig": { + "approvalTask-363e32acf981": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + { + "id": { + "isExpression": false, + "value": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + "type": "role", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "type": "manager", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "type": "roleOwner", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 478.3999938964844, + "y": 195.6125030517578, + }, + "approvalTask-7e33e73d6763": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDuration", + "expirationTimeSpan": "hour(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "reminderDate": 4, + "reminderTimeSpan": "month(s)", + }, + "x": 146.39999389648438, + "y": 15.61250305175781, + }, + "emailTask-2068f5d711c8": { + "x": 150.39999389648438, + "y": 648.812502861023, + }, + "emailTask-881f2975e240": { + "x": 478.3999938964844, + "y": 474.41250228881836, + }, + "exclusiveGateway-94bc3d35f3b4": { + "x": 145.39999389648438, + "y": 274.6125030517578, + }, + "fulfillmentTask-29a71d4ab8ed": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDate", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 479.3999938964844, + "y": 334.41250228881836, + }, + "fulfillmentTask-7fce35a32915": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "hour(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "reminderDate": 2, + "reminderTimeSpan": "month(s)", + }, + "x": 145.39999389648438, + "y": 146.6125030517578, + }, + "inclusiveGateway-a6cf9605ce55": { + "x": 147.39999389648438, + "y": 405.6125030517578, + }, + "scriptTask-493f5ea87636": { + "x": 148.39999389648438, + "y": 570.6125030517578, + }, + "violationTask-50261d9bc712": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "week(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "reminderDate": 3, + "reminderTimeSpan": "hour(s)", + }, + "x": 480.3999938964844, + "y": 13.61250305175781, + }, + "violationTask-f8066518b46a": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationType": "applicationOwner", + "expirationDateType": "variable", + "expirationDateVariable": "taskExpirationDate", + "reassignedActors": [], + }, + "x": 788.3999938964844, + "y": 613.4125022888184, + }, + "waitTask-72d593301121": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 476.3999938964844, + "y": 612.4125022888184, + }, + "waitTask-b343cc7df7c9": { + "events": { + "resumeDateNumber": 1, + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "variable", + "resumeDateVariable": "resumeDate", + }, + "x": 476.3999938964844, + "y": 694.4125022888184, + }, + "waitTask-b7fc169ca4eb": { + "events": { + "resumeDateNumber": 5, + "resumeDateTimeSpan": "month(s)", + "resumeDateType": "duration", + }, + "x": 148.39999389648438, + "y": 779.812502861023, + }, + }, + }, + "status": "published", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Approval Task - approvalTask-63163dc11c1f/Approval Task - approvalTask-63163dc11c1f.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.entitlementOwner[0].id ? "managed/user/" + requestIndex.entitlementOwner[0].id : "managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "frequency": 7, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-5106f7a29d86", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Approval Task", + "name": "approvalTask-63163dc11c1f", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Approval - scriptTask-e21178ab80f7/Auto Approval - scriptTask-e21178ab80f7.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +var content = execution.getVariables(); +var requestId = content.get('id'); +var context = content.get('context'); +var lineItemId = content.get('lineItemId'); +var queryParams = { + "_action": "update" +} +var lineItemParams = { + "_action": "updateRemediationStatus" +} +try { + var decision = { + "decision": "approved", + "comment": "Request auto-approved due to request context: " + context + } + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +} +catch (e) { + var failureReason = "Failure updating decision on request. Error message: " + e.message; + var update = {'comment': failureReason, 'failure': true}; + openidm.action('iga/governance/requests/' + requestId, 'POST', update, queryParams); + + +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Approval - scriptTask-e21178ab80f7/Auto Approval - scriptTask-e21178ab80f7.json 1`] = ` +{ + "displayName": "Auto Approval", + "name": "scriptTask-e21178ab80f7", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Auto Approval - scriptTask-e21178ab80f7.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Provisioning - scriptTask-0359a9d77ee2/Auto Provisioning - scriptTask-0359a9d77ee2.js 1`] = ` +"logger.info("Auto-Provisioning"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + logger.info("requestObj: " + requestObj); +} +catch (e) { + failureReason = "Provisioning failed: Error reading request with id " + requestId; +} + +if(!failureReason) { + try { + var request = requestObj.request; + var payload = { + "entitlementId": request.common.entitlementId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + var result = openidm.action('iga/governance/user/' + request.common.userId + '/entitlements' , 'POST', payload,queryParams); + } + catch (e) { + failureReason = "Provisioning failed: Error provisioning entitlement to user " + request.common.userId + " for entitlement " + request.common.entitlementId + ". Error message: " + e.message; + } + + var decision = {'status': 'complete', 'decision': 'approved'}; + if (failureReason) { + decision.outcome = 'not provisioned'; + decision.comment = failureReason; + decision.failure = true; + } + else { + decision.outcome = 'provisioned'; + } + + var queryParams = { '_action': 'update'}; + openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); + logger.info("Request " + requestId + " completed."); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Auto Provisioning - scriptTask-0359a9d77ee2/Auto Provisioning - scriptTask-0359a9d77ee2.json 1`] = ` +{ + "displayName": "Auto Provisioning", + "name": "scriptTask-0359a9d77ee2", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Auto Provisioning - scriptTask-0359a9d77ee2.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Context Gateway - exclusiveGateway-67a954f33919/Context Gateway - exclusiveGateway-67a954f33919.json 1`] = ` +{ + "displayName": "Context Gateway", + "name": "exclusiveGateway-67a954f33919", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "skipApproval == true", + "outcome": "AutoApproval", + "step": "scriptTask-e21178ab80f7", + }, + { + "condition": "skipApproval == false", + "outcome": "Approval", + "step": "approvalTask-63163dc11c1f", + }, + ], + "script": { + "file": "Context Gateway - exclusiveGateway-67a954f33919.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.js 1`] = ` +"logger.info("Running entitlement grant request validation"); + +var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = null; +var applicationId = null; +var assignmentId = null; +var app = null; +var assignment = null; +var existingAccount = false; + +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; + assignmentId = requestObj.assignment.id; +} +catch (e) { + failureReason = "Validation failed: Error reading request with id " + requestId; +} + +// Validation 1 - Check application exists +if (!failureReason) { + try { + app = openidm.read('managed/alpha_application/' + applicationId); + if (!app) { + failureReason = "Validation failed: Cannot find application with id " + applicationId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading application with id " + applicationId + ". Error message: " + e.message; + } +} + +// Validation 2 - Check entitlement exists +if (!failureReason) { + try { + assignment = openidm.read('managed/alpha_assignment/' + assignmentId); + if (!assignment) { + failureReason = "Validation failed: Cannot find assignment with id " + assignmentId; + } + } + catch (e) { + failureReason = "Validation failed: Error reading assignment with id " + assignmentId + ". Error message: " + e.message; + } +} + +// Validation 3 - Check the user has application granted +if (!failureReason) { + try { + var user = openidm.read('managed/alpha_user/' + requestObj.user.id, null, [ 'effectiveApplications' ]); + user.effectiveApplications.forEach(effectiveApp => { + if (effectiveApp._id === applicationId) { + existingAccount = true; + } + }) + } + catch (e) { + failureReason = "Validation failed: Unable to check existing applications of user with id " + requestObj.user.id + ". Error message: " + e.message; + } +} + +// Validation 4 - If account does not exist, provision it +if (!failureReason) { + if (!existingAccount) { + try { + var request = requestObj.request; + var payload = { + "applicationId": applicationId, + "startDate": request.common.startDate, + "endDate": request.common.endDate, + "auditContext": {}, + "grantType": "request" + }; + var queryParams = { + "_action": "add" + } + + logger.info("Creating account: " + payload); + var result = openidm.action('iga/governance/user/' + request.common.userId + '/applications' , 'POST', payload,queryParams); + } + catch (e) { + failureReason = "Validation failed: Error provisioning new account to user " + request.common.userId + " for application " + applicationId + ". Error message: " + e.message; + } + } +} + +if (failureReason) { + logger.info("Validation failed: " + failureReason); +} +execution.setVariable("failureReason", failureReason); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation - scriptTask-3eab1948f1ec/Entitlement Grant Validation - scriptTask-3eab1948f1ec.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation", + "name": "scriptTask-3eab1948f1ec", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-48e748c42994", + }, + ], + "script": { + "file": "Entitlement Grant Validation - scriptTask-3eab1948f1ec.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var failureReason = content.get('failureReason'); + +var decision = {'outcome': 'not provisioned', 'status': 'complete', 'comment': failureReason, 'failure': true, 'decision': 'approved'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Grant Validation Failure - scriptTask-0b56191887de/Entitlement Grant Validation Failure - scriptTask-0b56191887de.json 1`] = ` +{ + "displayName": "Entitlement Grant Validation Failure", + "name": "scriptTask-0b56191887de", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Entitlement Grant Validation Failure - scriptTask-0b56191887de.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Privileged - scriptTask-5106f7a29d86/Entitlement Privileged - scriptTask-5106f7a29d86.js 1`] = ` +"var content = execution.getVariables(); +var requestId = content.get('id'); +var requestObj = null; +var entId = null; +var entGlossary = null; +var entPriv = null; + +//Check entitlement exists and grab entitlement info +try { + requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + entId = requestObj.assignment.id; +} +catch (e) { + logger.info("Validation failed: Error reading entitlement grant request with id " + requestId); +} +//Check glossary for entitlement exists and grab glossary info +try { + entGlossary = openidm.action('iga/governance/resource/' + entId + '/glossary', 'GET', {}, {}); + // Sets entPriv based on the glossary contents, if present, otherwise defaults to true + entPriv = (entGlossary.hasOwnProperty("isPrivileged")) ? entGlossary.isPrivileged : true; + //Sets entPriv based on glossary contents, if present, otherwise defaults to false + //entPriv = !!entGlossary.isPrivileged; + execution.setVariable("entPriv", entPriv); +} +catch (e) { + logger.info("Could not retrieve glossary with entId " + entId + " from entitlement grant request ID " + requestId); +} +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Entitlement Privileged - scriptTask-5106f7a29d86/Entitlement Privileged - scriptTask-5106f7a29d86.json 1`] = ` +{ + "displayName": "Entitlement Privileged", + "name": "scriptTask-5106f7a29d86", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "inclusiveGateway-bcb05a148971", + }, + ], + "script": { + "file": "Entitlement Privileged - scriptTask-5106f7a29d86.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Inclusive Gateway - inclusiveGateway-bcb05a148971/Inclusive Gateway - inclusiveGateway-bcb05a148971.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Inclusive Gateway - inclusiveGateway-bcb05a148971/Inclusive Gateway - inclusiveGateway-bcb05a148971.json 1`] = ` +{ + "displayName": "Inclusive Gateway", + "name": "inclusiveGateway-bcb05a148971", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "entPriv == true", + "outcome": "Privileged", + "step": "approvalTask-77691047b28d", + }, + { + "condition": "entPriv == false", + "outcome": "NotPrivileged", + "step": "scriptTask-3eab1948f1ec", + }, + ], + "script": { + "file": "Inclusive Gateway - inclusiveGateway-bcb05a148971.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Manager Approval - approvalTask-77691047b28d/Manager Approval - approvalTask-77691047b28d.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.user.manager._refResourceId", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "assignment": { + "notification": "requestAssigned", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "notification": "requestEscalated", + }, + "expiration": { + "action": "reject", + "actors": [ + { + "id": "managed/user/034484bf-1448-40b8-bdfa-56990ef0cc30", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "frequency": 7, + "notification": "requestExpired", + }, + "reassign": { + "notification": "requestReassigned", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*24*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "requestReminder", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "scriptTask-3eab1948f1ec", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "scriptTask-aec6c36b3a45", + }, + ], + }, + "displayName": "Manager Approval", + "name": "approvalTask-77691047b28d", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.js 1`] = ` +"logger.info("Rejecting request"); + +var content = execution.getVariables(); +var requestId = content.get('id'); + +logger.info("Execution Content: " + content); +var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); +var decision = {'outcome': 'denied', 'status': 'complete', 'decision': 'rejected'}; +var queryParams = { '_action': 'update'}; +openidm.action('iga/governance/requests/' + requestId, 'POST', decision, queryParams); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Reject Request - scriptTask-aec6c36b3a45/Reject Request - scriptTask-aec6c36b3a45.json 1`] = ` +{ + "displayName": "Reject Request", + "name": "scriptTask-aec6c36b3a45", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": null, + }, + ], + "script": { + "file": "Reject Request - scriptTask-aec6c36b3a45.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +var content = execution.getVariables(); +var requestId = content.get('id'); +var context = null; +var skipApproval = false; +var lineItemId = false; +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + if (requestObj.request.common.context) { + context = requestObj.request.common.context.type; + lineItemId = requestObj.request.common.context.lineItemId; + if (context == 'admin') { + skipApproval = true; + } + } +} +catch (e) { + logger.info("Request Context Check failed "+e.message); +} + +logger.info("Context: " + context); +execution.setVariable("context", context); +execution.setVariable("lineItemId", lineItemId); +execution.setVariable("skipApproval", skipApproval); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Request Context Check - scriptTask-e04f42607ba5/Request Context Check - scriptTask-e04f42607ba5.json 1`] = ` +{ + "displayName": "Request Context Check", + "name": "scriptTask-e04f42607ba5", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "exclusiveGateway-67a954f33919", + }, + ], + "script": { + "file": "Request Context Check - scriptTask-e04f42607ba5.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/steps/Validation Gateway - exclusiveGateway-48e748c42994/Validation Gateway - exclusiveGateway-48e748c42994.json 1`] = ` +{ + "displayName": "Validation Gateway", + "name": "exclusiveGateway-48e748c42994", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "failureReason == null", + "outcome": "validationFlowSuccess", + "step": "scriptTask-0359a9d77ee2", + }, + { + "condition": "failureReason != null", + "outcome": "validationFlowFailure", + "step": "scriptTask-0b56191887de", + }, + ], + "script": { + "file": "Validation Gateway - exclusiveGateway-48e748c42994.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir03/iga/workflows/wfEntitlementExampleIsPrivileged/wfEntitlementExampleIsPrivileged.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "wfEntitlementExampleIsPrivileged", + "displayName": "wfEntitlementExampleIsPrivileged", + "id": "wfEntitlementExampleIsPrivileged", + "mutable": true, + "name": "wfEntitlementExampleIsPrivileged", + "staticNodes": { + "endNode": { + "connections": null, + "id": "endNode", + "x": 2262, + "y": 220, + }, + "startNode": { + "connections": { + "start": "scriptTask-e04f42607ba5", + }, + "id": "startNode", + "x": 70, + "y": 176, + }, + "uiConfig": { + "approvalTask-63163dc11c1f": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.entitlementOwner[0].id ? "managed/user/" + requestIndex.entitlementOwner[0].id : "managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "entitlementOwner", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 722, + "y": 265, + }, + "approvalTask-77691047b28d": { + "actors": [ + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.user.manager._refResourceId", + }, + "type": "manager", + }, + ], + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationTimeSpan": "day(s)", + "reminderDate": 3, + "reminderTimeSpan": "day(s)", + }, + "x": 1219, + "y": 273, + }, + "exclusiveGateway-48e748c42994": { + "x": 1917, + "y": 104, + }, + "exclusiveGateway-67a954f33919": { + "x": 462, + "y": 155, + }, + "inclusiveGateway-bcb05a148971": { + "x": 1216, + "y": 99, + }, + "scriptTask-0359a9d77ee2": { + "x": 1924, + "y": 258.6666666666667, + }, + "scriptTask-0b56191887de": { + "x": 1907, + "y": 367.33333333333337, + }, + "scriptTask-3eab1948f1ec": { + "x": 1532, + "y": 151.66666666666669, + }, + "scriptTask-5106f7a29d86": { + "x": 940, + "y": 210, + }, + "scriptTask-aec6c36b3a45": { + "x": 1567, + "y": 274.33333333333337, + }, + "scriptTask-e04f42607ba5": { + "x": 181, + "y": 178, + }, + "scriptTask-e21178ab80f7": { + "x": 724, + "y": 101, + }, + }, + }, + "status": "draft", + "type": "provisioning", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style" 1`] = `0`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style" 2`] = `""`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style" 3`] = ` +"Experimental feature in use: 'frodo config-manager pull iga-workflows'. This feature may change without notice. +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Approval Task - approvalTask-7e33e73d6763/Custom Approval Task - approvalTask-7e33e73d6763.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate1", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate1", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "content.customExpirationDuration", + }, + "notification": "FrodoTestEmailTemplate1", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate1", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(4*30*24*60*60*1000))).toISOString()", + }, + "frequency": 4, + "notification": "FrodoTestEmailTemplate1", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-7fce35a32915", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task", + "name": "approvalTask-7e33e73d6763", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Approval Task 2 - approvalTask-363e32acf981/Custom Approval Task 2 - approvalTask-363e32acf981.json 1`] = ` +{ + "approvalMode": "any", + "approvalTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "APPROVE", + "step": "fulfillmentTask-29a71d4ab8ed", + }, + { + "condition": null, + "outcome": "REJECT", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "displayName": "Custom Approval Task 2", + "name": "approvalTask-363e32acf981", + "type": "approvalTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Email Task - emailTask-2068f5d711c8/Custom Email Task - emailTask-2068f5d711c8.json 1`] = ` +{ + "displayName": "Custom Email Task", + "emailTask": { + "bcc": { + "isExpression": true, + "value": "// This is the bcc script +"bcc@email.com";", + }, + "cc": { + "isExpression": true, + "value": "// This is the cc script +"cc@email.com";", + }, + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-b7fc169ca4eb", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": { + "hello": "goodbye", + "hi": "hola", + }, + "templateName": "frodoTestEmailTemplateFour", + "to": { + "isExpression": true, + "value": "// This is the to script +"to@email.com";", + }, + }, + "name": "emailTask-2068f5d711c8", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Email Task 2 - emailTask-881f2975e240/Custom Email Task 2 - emailTask-881f2975e240.json 1`] = ` +{ + "displayName": "Custom Email Task 2", + "emailTask": { + "bcc": "bcc@email.com", + "cc": "cc@email.com", + "nextStep": [ + { + "condition": null, + "outcome": "SUCCESS", + "step": "waitTask-72d593301121", + }, + { + "condition": null, + "outcome": "FAILED", + "step": "violationTask-50261d9bc712", + }, + ], + "object": {}, + "templateName": "frodoTestEmailTemplateFour", + "to": "to@email.com", + }, + "name": "emailTask-881f2975e240", + "type": "emailTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Fulfillment Task - fulfillmentTask-7fce35a32915/Custom Fulfillment Task - fulfillmentTask-7fce35a32915.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task", + "fulfillmentTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate2", + }, + "escalation": { + "actors": [ + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate2", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(7*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate2", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate2", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(2*30*24*60*60*1000))).toISOString()", + }, + "frequency": 2, + "notification": "FrodoTestEmailTemplate2", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "exclusiveGateway-94bc3d35f3b4", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-7fce35a32915", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed/Custom Fulfillment Task 2 - fulfillmentTask-29a71d4ab8ed.json 1`] = ` +{ + "displayName": "Custom Fulfillment Task 2", + "fulfillmentTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "approvalMode": "any", + "events": { + "expiration": { + "date": { + "value": "content.customExpirationDate", + }, + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "FULFILL", + "step": "emailTask-881f2975e240", + }, + { + "condition": null, + "outcome": "DENY", + "step": "violationTask-50261d9bc712", + }, + ], + }, + "name": "fulfillmentTask-29a71d4ab8ed", + "type": "fulfillmentTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js 1`] = ` +"logger.info("This is inclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55/Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.json 1`] = ` +{ + "displayName": "Custom Inclusive Gateway", + "name": "inclusiveGateway-a6cf9605ce55", + "scriptTask": { + "gatewayType": "inclusive", + "language": "javascript", + "nextStep": [ + { + "condition": "// This is outcome 1 +outcome === 1", + "outcome": "outcomeOne", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 2 +outcome === 2", + "outcome": "outcomeTwo", + "step": "scriptTask-493f5ea87636", + }, + { + "condition": "// This is outcome 3 +outcome === 3", + "outcome": "outcomeThree", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Inclusive Gateway - inclusiveGateway-a6cf9605ce55.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.js 1`] = ` +"/* +Script nodes are used to invoke APIs or execute business logic. +You can invoke governance APIs or IDM APIs. +See https://backstage.forgerock.com/docs/idcloud/latest/identity-governance/administration/workflow-configure.html for more details. + +Script nodes should return a single value and should have the +logic enclosed in a try-catch block. + +Example: +try { + var requestObj = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + applicationId = requestObj.application.id; +} +catch (e) { + failureReason = 'Validation failed: Error reading request with id ' + requestId; +} +*/ +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Script Task - scriptTask-493f5ea87636/Custom Script Task - scriptTask-493f5ea87636.json 1`] = ` +{ + "displayName": "Custom Script Task", + "name": "scriptTask-493f5ea87636", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "true", + "outcome": "done", + "step": "emailTask-2068f5d711c8", + }, + ], + "script": { + "file": "Custom Script Task - scriptTask-493f5ea87636.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js 1`] = ` +"logger.info("This is exclusive gateway"); +" +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4/Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.json 1`] = ` +{ + "displayName": "Custom Validation Gateway", + "name": "exclusiveGateway-94bc3d35f3b4", + "scriptTask": { + "language": "javascript", + "nextStep": [ + { + "condition": "// This is a validation success +outcome == true", + "outcome": "validationSuccess", + "step": "inclusiveGateway-a6cf9605ce55", + }, + { + "condition": "// This is a validation failure +outcome == false", + "outcome": "validationFailure", + "step": "violationTask-50261d9bc712", + }, + ], + "script": { + "file": "Custom Validation Gateway - exclusiveGateway-94bc3d35f3b4.js", + }, + }, + "type": "scriptTask", +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Violation Task - violationTask-50261d9bc712/Custom Violation Task - violationTask-50261d9bc712.json 1`] = ` +{ + "displayName": "Custom Violation Task", + "name": "violationTask-50261d9bc712", + "type": "violationTask", + "violationTask": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "approvalMode": "any", + "events": { + "assignment": { + "notification": "FrodoTestEmailTemplate3", + }, + "escalation": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*7*24*60*60*1000))).toISOString()", + }, + "frequency": 5, + "notification": "FrodoTestEmailTemplate3", + }, + "expiration": { + "action": "reassign", + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(8*30*24*60*60*1000))).toISOString()", + }, + "notification": "FrodoTestEmailTemplate3", + }, + "reassign": { + "notification": "FrodoTestEmailTemplate3", + }, + "reminder": { + "date": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(3*60*60*1000))).toISOString()", + }, + "frequency": 3, + "notification": "FrodoTestEmailTemplate3", + }, + }, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Violation Task 2 - violationTask-f8066518b46a/Custom Violation Task 2 - violationTask-f8066518b46a.json 1`] = ` +{ + "displayName": "Custom Violation Task 2", + "name": "violationTask-f8066518b46a", + "type": "violationTask", + "violationTask": { + "actors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "approvalMode": "any", + "events": {}, + "nextStep": [ + { + "condition": null, + "outcome": "REMEDIATE", + "step": null, + }, + { + "condition": null, + "outcome": "ALLOW", + "step": null, + }, + { + "condition": null, + "outcome": "EXPIRATION", + "step": "approvalTask-7e33e73d6763", + }, + ], + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Wait Task - waitTask-b7fc169ca4eb/Custom Wait Task - waitTask-b7fc169ca4eb.json 1`] = ` +{ + "displayName": "Custom Wait Task", + "name": "waitTask-b7fc169ca4eb", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "approvalTask-363e32acf981", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "(new Date(new Date().getTime()+(5*30*24*60*60*1000))).toISOString()", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Wait Task 2 - waitTask-72d593301121/Custom Wait Task 2 - waitTask-72d593301121.json 1`] = ` +{ + "displayName": "Custom Wait Task 2", + "name": "waitTask-72d593301121", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "waitTask-b343cc7df7c9", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "requestIndex.request.common.startDate", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/steps/Custom Wait Task 3 - waitTask-b343cc7df7c9/Custom Wait Task 3 - waitTask-b343cc7df7c9.json 1`] = ` +{ + "displayName": "Custom Wait Task 3", + "name": "waitTask-b343cc7df7c9", + "type": "waitTask", + "waitTask": { + "events": null, + "nextStep": [ + { + "condition": "true", + "outcome": "COMPLETE", + "step": "violationTask-f8066518b46a", + }, + ], + "resumeDate": { + "isExpression": true, + "value": "content.get('resumeDate')", + }, + }, +} +`; + +exports[`frodo config-manager pull "frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style": igaTestDir02/iga/workflows/test_workflow_4/test_workflow_4.json 1`] = ` +{ + "_rev": 0, + "childType": false, + "description": "test_workflow_4", + "displayName": "test_workflow_4", + "id": "testWorkflow4", + "mutable": true, + "name": "test_workflow_4", + "staticNodes": { + "endNode": { + "_outcomes": [], + "connections": {}, + "displayDetails": { + "icon": "checkmark", + "value": "Success", + "variant": "success", + }, + "displayType": "SingleInput", + "hasError": false, + "id": "endNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "End", + "nodeType": "SingleInput", + "schema": null, + "template": null, + "x": 826, + "y": 50, + }, + "startNode": { + "_outcomes": [ + { + "displayName": "start", + "id": "start", + }, + ], + "connections": { + "start": "approvalTask-7e33e73d6763", + }, + "displayDetails": { + "icon": "play_arrow", + "value": "Start", + "variant": "info", + }, + "displayType": "IconOutcomeNode", + "hasError": false, + "id": "startNode", + "isDeleteable": false, + "isDroppable": false, + "isEditable": false, + "isHovered": false, + "name": "Start", + "nodeType": "IconOutcomeNode", + "schema": null, + "template": null, + "x": 20, + "y": 42, + }, + "uiConfig": { + "approvalTask-363e32acf981": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + { + "id": { + "isExpression": false, + "value": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + }, + "type": "role", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "type": "applicationOwner", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "type": "manager", + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "type": "entitlementOwner", + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "type": "roleOwner", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 478.3999938964844, + "y": 195.6125030517578, + }, + "approvalTask-7e33e73d6763": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "day(s)", + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDuration", + "expirationTimeSpan": "hour(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": "managed/role/be68f831-a8f3-42da-93df-84bbc66427f6", + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.applicationOwner[0].id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + requestIndex.manager.id", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": ""managed/user/" + ((requestIndex.entitlementOwner && requestIndex.entitlementOwner.length > 0) ? requestIndex.entitlementOwner[0].id : requestIndex.applicationOwner[0].id)", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + { + "id": { + "isExpression": true, + "value": "(function() { + var systemSettings = openidm.action("iga/commons/config/iga_access_request", "GET", {}, {}); + var approver = null; + if (requestIndex.roleOwner && requestIndex.roleOwner[0]) { + approver = "managed/user/" + requestIndex.roleOwner[0].id; + } else if (systemSettings && systemSettings.defaultApprover) { + approver = systemSettings.defaultApprover; + } + return approver; +})()", + }, + "permissions": { + "approve": true, + "comment": true, + "modify": true, + "reassign": true, + "reject": true, + }, + }, + ], + "reminderDate": 4, + "reminderTimeSpan": "month(s)", + }, + "x": 146.39999389648438, + "y": 15.61250305175781, + }, + "emailTask-2068f5d711c8": { + "x": 150.39999389648438, + "y": 648.812502861023, + }, + "emailTask-881f2975e240": { + "x": 478.3999938964844, + "y": 474.41250228881836, + }, + "exclusiveGateway-94bc3d35f3b4": { + "x": 145.39999389648438, + "y": 274.6125030517578, + }, + "fulfillmentTask-29a71d4ab8ed": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationDate": 1, + "escalationType": "applicationOwner", + "expirationDate": 7, + "expirationDateType": "variable", + "expirationDateVariable": "customExpirationDate", + "expirationTimeSpan": "day(s)", + "reassignedActors": [], + "reminderDate": 1, + }, + "x": 479.3999938964844, + "y": 334.41250228881836, + }, + "fulfillmentTask-7fce35a32915": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "hour(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "comment": true, + "deny": true, + "fulfill": true, + "modify": true, + "reassign": true, + }, + }, + ], + "reminderDate": 2, + "reminderTimeSpan": "month(s)", + }, + "x": 145.39999389648438, + "y": 146.6125030517578, + }, + "inclusiveGateway-a6cf9605ce55": { + "x": 147.39999389648438, + "y": 405.6125030517578, + }, + "scriptTask-493f5ea87636": { + "x": 148.39999389648438, + "y": 570.6125030517578, + }, + "violationTask-50261d9bc712": { + "actors": { + "isExpression": true, + "value": "/** +Define custom script which returns an array of actors in the following format +(function() { + var content = execution.getVariables(); + var requestId = content.get('id'); + var requestIndex = openidm.action('iga/governance/requests/' + requestId, 'GET', {}, {}); + return [{ + id: "managed/user/" + requestIndex.applicationOwner[0].id, + permissions: { + approve: true, + reject: true, + reassign: true, + modify: true, + comment: true + } + }]; +})() +**/ +( +function(){ + return []; +} +)()", + }, + "events": { + "escalationDate": 5, + "escalationTimeSpan": "week(s)", + "escalationType": "applicationOwner", + "expirationDate": 8, + "expirationDateType": "duration", + "expirationDateVariable": "", + "expirationTimeSpan": "month(s)", + "reassignedActors": [ + { + "id": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + "permissions": { + "allow": true, + "comment": true, + "exception": true, + "reassign": true, + "remediate": true, + }, + }, + ], + "reminderDate": 3, + "reminderTimeSpan": "hour(s)", + }, + "x": 480.3999938964844, + "y": 13.61250305175781, + }, + "violationTask-f8066518b46a": { + "actors": [ + { + "id": { + "isExpression": false, + "value": "managed/user/0f325c99-6965-4f45-b1e4-f9db1fa4dcf6", + }, + "type": "user", + }, + ], + "events": { + "escalationType": "applicationOwner", + "expirationDateType": "variable", + "expirationDateVariable": "taskExpirationDate", + "reassignedActors": [], + }, + "x": 788.3999938964844, + "y": 613.4125022888184, + }, + "waitTask-72d593301121": { + "events": { + "resumeDateNumber": 1, + "resumeDateRequestProperty": "request.common.startDate", + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "requestProp", + }, + "x": 476.3999938964844, + "y": 612.4125022888184, + }, + "waitTask-b343cc7df7c9": { + "events": { + "resumeDateNumber": 1, + "resumeDateTimeSpan": "day(s)", + "resumeDateType": "variable", + "resumeDateVariable": "resumeDate", + }, + "x": 476.3999938964844, + "y": 694.4125022888184, + }, + "waitTask-b7fc169ca4eb": { + "events": { + "resumeDateNumber": 5, + "resumeDateTimeSpan": "month(s)", + "resumeDateType": "duration", + }, + "x": 148.39999389648438, + "y": 779.812502861023, + }, + }, + }, + "status": "published", +} +`; diff --git a/test/e2e/config-manager-export-iga-workflows.e2e.test.js b/test/e2e/config-manager-export-iga-workflows.e2e.test.js new file mode 100644 index 000000000..620bf24c7 --- /dev/null +++ b/test/e2e/config-manager-export-iga-workflows.e2e.test.js @@ -0,0 +1,78 @@ +/** + * Follow this process to write e2e tests for the CLI project: + * + * 1. Test if all the necessary mocks for your tests already exist. + * In mock mode, run the command you want to test with the same arguments + * and parameters exactly as you want to test it, for example: + * + * $ FRODO_MOCK=1 frodo conn save https://openam-frodo-dev.forgeblocks.com/am volker.scheuber@forgerock.com Sup3rS3cr3t! + * + * If your command completes without errors and with the expected results, + * all the required mocks already exist and you are good to write your + * test and skip to step #4. + * + * If, however, your command fails and you see errors like the one below, + * you know you need to record the mock responses first: + * + * [Polly] [adapter:node-http] Recording for the following request is not found and `recordIfMissing` is `false`. + * + * 2. Record mock responses for your exact command. + * In mock record mode, run the command you want to test with the same arguments + * and parameters exactly as you want to test it, for example: + * + * $ FRODO_MOCK=record frodo conn save https://openam-frodo-dev.forgeblocks.com/am volker.scheuber@forgerock.com Sup3rS3cr3t! + * + * Wait until you see all the Polly instances (mock recording adapters) have + * shutdown before you try to run step #1 again. + * Messages like these indicate mock recording adapters shutting down: + * + * Polly instance 'conn/4' stopping in 3s... + * Polly instance 'conn/4' stopping in 2s... + * Polly instance 'conn/save/3' stopping in 3s... + * Polly instance 'conn/4' stopping in 1s... + * Polly instance 'conn/save/3' stopping in 2s... + * Polly instance 'conn/4' stopped. + * Polly instance 'conn/save/3' stopping in 1s... + * Polly instance 'conn/save/3' stopped. + * + * 3. Validate your freshly recorded mock responses are complete and working. + * Re-run the exact command you want to test in mock mode (see step #1). + * + * 4. Write your test. + * Make sure to use the exact command including number of arguments and params. + * + * 5. Commit both your test and your new recordings to the repository. + * Your tests are likely going to reside outside the frodo-lib project but + * the recordings must be committed to the frodo-lib project. + */ + +/* +FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-trivir-fairfax.forgeblocks.com/am frodo config-manager pull iga-workflows -D igaTestDir01 +FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-trivir-fairfax.forgeblocks.com/am frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02 +FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-trivir-fairfax.forgeblocks.com/am frodo config-manager pull iga-workflows -i -D igaTestDir03 +*/ + + +import { getEnv, testExport } from './utils/TestUtils'; +import { iga_connection as ic } from './utils/TestConfig'; + +process.env['FRODO_MOCK'] = '1'; +const env = getEnv(ic); + +describe('frodo config-manager pull ', () => { + test('"frodo config-manager pull iga-workflows -D igaTestDir01": should export the iga workflows in fr-config-manager style"', async () => { + const dirName = 'igaTestDir01'; + const CMD = `frodo config-manager pull iga-workflows -D ${dirName}`; + await testExport(CMD, env, undefined, undefined, dirName, false, true); + }); + test('"frodo config-manager pull iga-workflows -n test_workflow_4 -D igaTestDir02": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style"', async () => { + const dirName = 'igaTestDir02'; + const CMD = `frodo config-manager pull iga-workflows -n test_workflow_4 -D ${dirName}`; + await testExport(CMD, env, undefined, undefined, dirName, false, true); + }); + test('"frodo config-manager pull iga-workflows -i -D igaTestDir03": should export a single iga workflow by name: test_workflow_4 in fr-config-manager style"', async () => { + const dirName = 'igaTestDir03'; + const CMD = `frodo config-manager pull iga-workflows -i -D ${dirName}`; + await testExport(CMD, env, undefined, undefined, dirName, false, true); + }); +}); \ No newline at end of file diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/am_1076162899/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/am_1076162899/recording.har new file mode 100644 index 000000000..40b1703b0 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/am_1076162899/recording.har @@ -0,0 +1,312 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_D/am", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccd7a5defd0fdeaa986a2b54642d911a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "accept-api-version", + "value": "resource=1.1" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 398, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/json/serverinfo/*" + }, + "response": { + "bodySize": 614, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 614, + "text": "{\"_id\":\"*\",\"_rev\":\"959929574\",\"domains\":[],\"protectedUserAttributes\":[\"telephoneNumber\",\"mail\"],\"cookieName\":\"311468432e97f1f\",\"secureCookie\":true,\"forgotPassword\":\"false\",\"forgotUsername\":\"false\",\"kbaEnabled\":\"false\",\"selfRegistration\":\"false\",\"lang\":\"en-US\",\"successfulUserRegistrationDestination\":\"default\",\"socialImplementations\":[],\"referralsEnabled\":\"false\",\"zeroPageLogin\":{\"enabled\":false,\"refererWhitelist\":[],\"allowedWithoutReferer\":true},\"realm\":\"/\",\"xuiUserSessionValidationEnabled\":true,\"fileBasedConfiguration\":true,\"userIdAttributes\":[],\"cloudOnlyFeaturesEnabled\":true,\"oauth2AIAgentsEnabled\":false}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.1" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"959929574\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "614" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:37:09 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 786, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:37:09.790Z", + "time": 173, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 173 + } + }, + { + "_id": "6125d0328ad0dcaee55f73fd8b22ca14", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "accept-api-version", + "value": "resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1649, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/json/serverinfo/version" + }, + "response": { + "bodySize": 275, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 275, + "text": "{\"_id\":\"version\",\"_rev\":\"1171477248\",\"version\":\"9.0.0-SNAPSHOT\",\"fullVersion\":\"ForgeRock Access Management 9.0.0-SNAPSHOT Build 304c60a9fe7797e1045c631600098d4465b73e4d (2026-April-15 10:21)\",\"revision\":\"304c60a9fe7797e1045c631600098d4465b73e4d\",\"date\":\"2026-April-15 10:21\"}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"1171477248\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "275" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:37:10 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 787, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:37:10.138Z", + "time": 130, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 130 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/environment_1072573434/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/environment_1072573434/recording.har new file mode 100644 index 000000000..cb9ba23f2 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/environment_1072573434/recording.har @@ -0,0 +1,125 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_D/environment", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccc7ec61c2094114d7917814bb19b83b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1600, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/environment/scopes/service-accounts" + }, + "response": { + "bodySize": 1975, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 1975, + "text": "[{\"scope\":\"fr:am:*\",\"description\":\"All Access Management APIs\"},{\"scope\":\"fr:autoaccess:*\",\"description\":\"All Auto Access APIs\"},{\"scope\":\"fr:idc:analytics:*\",\"description\":\"All Analytics APIs\"},{\"scope\":\"fr:idc:certificate:*\",\"description\":\"All TLS certificate APIs\",\"childScopes\":[{\"scope\":\"fr:idc:certificate:read\",\"description\":\"Read TLS certificates\"}]},{\"scope\":\"fr:idc:content-security-policy:*\",\"description\":\"All content security policy APIs\",\"childScopes\":[{\"scope\":\"fr:idc:content-security-policy:read\",\"description\":\"Read content security policy\"}]},{\"scope\":\"fr:idc:cookie-domain:*\",\"description\":\"All cookie domain APIs\",\"childScopes\":[{\"scope\":\"fr:idc:cookie-domain:read\",\"description\":\"Read cookie domains\"}]},{\"scope\":\"fr:idc:custom-domain:*\",\"description\":\"All custom domain APIs\",\"childScopes\":[{\"scope\":\"fr:idc:custom-domain:read\",\"description\":\"Read custom domains\"}]},{\"scope\":\"fr:idc:dataset:*\",\"description\":\"All dataset deletion APIs\",\"childScopes\":[{\"scope\":\"fr:idc:dataset:read\",\"description\":\"Read dataset deletions\"}]},{\"scope\":\"fr:idc:esv:*\",\"description\":\"All ESV APIs\",\"childScopes\":[{\"scope\":\"fr:idc:esv:read\",\"description\":\"Read ESVs, excluding values of secrets\"},{\"scope\":\"fr:idc:esv:update\",\"description\":\"Create, modify, and delete ESVs\"},{\"scope\":\"fr:idc:esv:restart\",\"description\":\"Restart workloads that consume ESVs\"}]},{\"scope\":\"fr:idc:promotion:*\",\"description\":\"All configuration promotion APIs\",\"childScopes\":[{\"scope\":\"fr:idc:promotion:read\",\"description\":\"Read configuration promotion\"}]},{\"scope\":\"fr:idc:release:*\",\"description\":\"All product release APIs\",\"childScopes\":[{\"scope\":\"fr:idc:release:read\",\"description\":\"Read product release\"}]},{\"scope\":\"fr:idc:sso-cookie:*\",\"description\":\"All SSO cookie APIs\",\"childScopes\":[{\"scope\":\"fr:idc:sso-cookie:read\",\"description\":\"Read SSO cookie\"}]},{\"scope\":\"fr:idm:*\",\"description\":\"All Identity Management APIs\"},{\"scope\":\"fr:iga:*\",\"description\":\"All Identity Governance APIs\"}]" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "1975" + }, + { + "name": "etag", + "value": "W/\"7b7-tIBWy/EinSCKaoNz4aU2iqiTmFc\"" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:37:10 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "5cf0c28b-4664-4e91-99bc-f08c6a1559b5" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 413, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:37:10.276Z", + "time": 111, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 111 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/iga_2664973160/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/iga_2664973160/recording.har new file mode 100644 index 000000000..723610402 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/iga_2664973160/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_D/iga", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "f64029142a38862fb58bc7ec0e44e61d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1593, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_queryString", + "value": "" + }, + { + "name": "_pageSize", + "value": "10000" + }, + { + "name": "_pagedResultsOffset", + "value": "1" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/iga/governance/workflow?_queryString=&_pageSize=10000&_pagedResultsOffset=1" + }, + "response": { + "bodySize": 44022, + "content": { + "encoding": "base64", + "mimeType": "application/json; charset=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TVVb8qc5vghUi3m9/VUuCrbzDAma5sLM1XV1ZgbftDsv6rDndqWPqN+7nlqJs4beW6hd9T03C+mPlBfHJOPrFJ1N3vZKuSFebRLyG1HXynv+SktW7zdJfmYsyKV+IlTlNGR9CF5pl0p8Inl8U0iZFYBFFLBEfEL8vrrRv8D5ZNKtUGkipv2PEo+T1bouyTtIgbUYwE30nei/Drpl93pSyOr94XZkoG2KBGSTfbHIElWTZkXrfTeQEKjajX5S1nu6iAlDhoLlht/0IFk8Fv+EMF01FxC1noSiXix/YwpCbcVgLft5eTqKjmuz/lZyLRPyPjLGyLGnJ8+cGeE1+Ojy2Htse7xIwg+Y9Yo+K5qMLRbEooEFzC7FVd5T/xjllY8LtJQyAbkqRvm1nN1WAQ4oTxr93v66kkCU2ketcuyYDl1gPREkv2wz69d0W5QVzyndlSYmPH/2gwtNdeQJ63y9xZ8SdEQ==\",\"n0l3AhBm4zEmg8vhf1LOuwH9/+KRVOTisPq4cu6jMh//2+3/On754+PzX5erF3V3laq7vxh+18/qv39mzeUqbe2frL28emnsL/uL1/Xnlm92+uff/rve9i/691+C+uPK/fX7r18vXtfzv+x6aD/Lp693Hw9f+eZwZf/Kr5j0V9/78PVuc9Tf/3r5yj+OfzB5/JPt+pZvjn/+sTk0LOv++vzbXv2eHfTn/rnpZfjzj03f8l/N5R+bvuWbPxr+i/9r//qs//vr18/n59vz8+WSxKSPNNDXr2uQStCY/DedIfzsD0w=\"]" + }, + "cookies": [], + "headers": [ + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "etag", + "value": "W/\"73466-89WIrAJ89vsGCvxkwFrnozkKmHM\"" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "br" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:37:11 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "6dd459fc-2f1d-4011-a86b-8f4f067507aa" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "headersSize": 485, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:37:10.524Z", + "time": 1030, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 1030 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/oauth2_393036114/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/oauth2_393036114/recording.har new file mode 100644 index 000000000..fd1f9a21f --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/oauth2_393036114/recording.har @@ -0,0 +1,146 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_D/oauth2", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ff75519a93ccab829f8ee8cf5e92b49f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 1140, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/x-www-form-urlencoded" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "accept-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "content-length", + "value": "1140" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 453, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [], + "text": "assertion=&client_id=service-account&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&scope=fr:am:* fr:idm:* fr:iga:*" + }, + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/oauth2/access_token" + }, + "response": { + "bodySize": 1315, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1315, + "text": "{\"access_token\":\"\",\"scope\":\"fr:am:* fr:idm:* fr:iga:*\",\"token_type\":\"Bearer\",\"expires_in\":899}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1315" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:37:10 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:37:09.980Z", + "time": 152, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 152 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/openidm_3290118515/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/openidm_3290118515/recording.har new file mode 100644 index 000000000..28ce5809e --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_D_2157136892/openidm_3290118515/recording.har @@ -0,0 +1,310 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_D/openidm", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "9cb8561357870863838a9948da32d1e8", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1661, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_fields", + "value": "*" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/openidm/managed/svcacct/6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f?_fields=%2A" + }, + "response": { + "bodySize": 1035, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1035, + "text": "{\"_id\":\"6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f\",\"_rev\":\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\",\"accountStatus\":\"active\",\"name\":\"frodo-dsevy\",\"description\":null,\"scopes\":[\"fr:am:*\",\"fr:idm:*\",\"fr:iga:*\"],\"jwks\":\"{\\\"keys\\\":[{\\\"e\\\":\\\"AQAB\\\",\\\"kty\\\":\\\"RSA\\\",\\\"n\\\":\\\"6HXYr7B1lk8cUVwkHu7mcx2_bhbGr3iISQje39G4W-1nJsC6KfPoCYxaAPeYRI7IqUyrgSmX3WvDybYjtLW1uGtKJ8YEoYaVfNUdcKjKhVMe0kVaf5CQIUgdfIYN_jt4KCL4MBP45Tzs4SQFI4FzujonNhl5cgRuPd8N21ziYnF11iKUKpNsKCSc1OzTYAeE2NM6fnP737gCs4FlJUY_v0qAkmBjqoLHIWxm_1GCJ3UBjcnzmUdCM4Akjftn45Oq_z0N_ZaANSS1twK53PL_hfKiNFWsBn2rJ-tmh4e5r-sx2nBseRHwH0AKtJklMw9lFHufQ9KNG73xZ-WaWtaxc55P3JnYl6kFaiuNDaSTvL3I4b1uKLeT4pUdr4In51bDd7P0gUSKe9LVTfafr50WkxaJ_e07SU1rFi7j41wjd4P7yCY5hBK_ZPvZsTT_6i1-gpBRBJFfpbcZxlhFF3PUf6p4M_Bzkwt4kdyoPErs7D3fXEpIqIHpeStD2G4RbdI-_MqYvJinc5ZXsGnWC44ZHwZj0QhweS7Zsp9ZA--nNTWz5zYwVjraOe5Jv9pBfY9a-DGy4QqKO23sAcZjjjQGf9H-YX-krCLHOjsjVfyMY3xiQPVZJUVMK-ocWqOT7dwvpMGJ8yG57j1OjAB8ZJvqlDduDY9w6fhdI6wVZ5FYwZ8\\\"}]}\",\"maxCachingTime\":\"15\",\"maxIdleTime\":\"15\",\"maxSessionTime\":\"15\",\"quotaLimit\":\"5\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:37:10 GMT" + }, + { + "name": "vary", + "value": "Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "content-length", + "value": "1035" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000" + } + ], + "headersSize": 658, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:37:10.192Z", + "time": 218, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 218 + } + }, + { + "_id": "9cb8561357870863838a9948da32d1e8", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1661, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_fields", + "value": "*" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/openidm/managed/svcacct/6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f?_fields=%2A" + }, + "response": { + "bodySize": 1035, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1035, + "text": "{\"_id\":\"6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f\",\"_rev\":\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\",\"accountStatus\":\"active\",\"name\":\"frodo-dsevy\",\"description\":null,\"scopes\":[\"fr:am:*\",\"fr:idm:*\",\"fr:iga:*\"],\"jwks\":\"{\\\"keys\\\":[{\\\"e\\\":\\\"AQAB\\\",\\\"kty\\\":\\\"RSA\\\",\\\"n\\\":\\\"6HXYr7B1lk8cUVwkHu7mcx2_bhbGr3iISQje39G4W-1nJsC6KfPoCYxaAPeYRI7IqUyrgSmX3WvDybYjtLW1uGtKJ8YEoYaVfNUdcKjKhVMe0kVaf5CQIUgdfIYN_jt4KCL4MBP45Tzs4SQFI4FzujonNhl5cgRuPd8N21ziYnF11iKUKpNsKCSc1OzTYAeE2NM6fnP737gCs4FlJUY_v0qAkmBjqoLHIWxm_1GCJ3UBjcnzmUdCM4Akjftn45Oq_z0N_ZaANSS1twK53PL_hfKiNFWsBn2rJ-tmh4e5r-sx2nBseRHwH0AKtJklMw9lFHufQ9KNG73xZ-WaWtaxc55P3JnYl6kFaiuNDaSTvL3I4b1uKLeT4pUdr4In51bDd7P0gUSKe9LVTfafr50WkxaJ_e07SU1rFi7j41wjd4P7yCY5hBK_ZPvZsTT_6i1-gpBRBJFfpbcZxlhFF3PUf6p4M_Bzkwt4kdyoPErs7D3fXEpIqIHpeStD2G4RbdI-_MqYvJinc5ZXsGnWC44ZHwZj0QhweS7Zsp9ZA--nNTWz5zYwVjraOe5Jv9pBfY9a-DGy4QqKO23sAcZjjjQGf9H-YX-krCLHOjsjVfyMY3xiQPVZJUVMK-ocWqOT7dwvpMGJ8yG57j1OjAB8ZJvqlDduDY9w6fhdI6wVZ5FYwZ8\\\"}]}\",\"maxCachingTime\":\"15\",\"maxIdleTime\":\"15\",\"maxSessionTime\":\"15\",\"quotaLimit\":\"5\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:37:10 GMT" + }, + { + "name": "vary", + "value": "Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "content-length", + "value": "1035" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-c3d6bcc9-bd16-4b6e-bd06-cf07ad9157c3" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:37:10.393Z", + "time": 121, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 121 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/am_1076162899/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/am_1076162899/recording.har new file mode 100644 index 000000000..22e44d05f --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/am_1076162899/recording.har @@ -0,0 +1,312 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_i_D/am", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccd7a5defd0fdeaa986a2b54642d911a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "accept-api-version", + "value": "resource=1.1" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 398, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/json/serverinfo/*" + }, + "response": { + "bodySize": 614, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 614, + "text": "{\"_id\":\"*\",\"_rev\":\"959929574\",\"domains\":[],\"protectedUserAttributes\":[\"telephoneNumber\",\"mail\"],\"cookieName\":\"311468432e97f1f\",\"secureCookie\":true,\"forgotPassword\":\"false\",\"forgotUsername\":\"false\",\"kbaEnabled\":\"false\",\"selfRegistration\":\"false\",\"lang\":\"en-US\",\"successfulUserRegistrationDestination\":\"default\",\"socialImplementations\":[],\"referralsEnabled\":\"false\",\"zeroPageLogin\":{\"enabled\":false,\"refererWhitelist\":[],\"allowedWithoutReferer\":true},\"realm\":\"/\",\"xuiUserSessionValidationEnabled\":true,\"fileBasedConfiguration\":true,\"userIdAttributes\":[],\"cloudOnlyFeaturesEnabled\":true,\"oauth2AIAgentsEnabled\":false}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.1" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"959929574\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "614" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:46:16 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 786, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:46:16.599Z", + "time": 160, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 160 + } + }, + { + "_id": "6125d0328ad0dcaee55f73fd8b22ca14", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "accept-api-version", + "value": "resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1649, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/json/serverinfo/version" + }, + "response": { + "bodySize": 275, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 275, + "text": "{\"_id\":\"version\",\"_rev\":\"1171477248\",\"version\":\"9.0.0-SNAPSHOT\",\"fullVersion\":\"ForgeRock Access Management 9.0.0-SNAPSHOT Build 304c60a9fe7797e1045c631600098d4465b73e4d (2026-April-15 10:21)\",\"revision\":\"304c60a9fe7797e1045c631600098d4465b73e4d\",\"date\":\"2026-April-15 10:21\"}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"1171477248\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "275" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:46:17 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 787, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:46:16.927Z", + "time": 112, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 112 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/environment_1072573434/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/environment_1072573434/recording.har new file mode 100644 index 000000000..a328b03a5 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/environment_1072573434/recording.har @@ -0,0 +1,125 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_i_D/environment", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccc7ec61c2094114d7917814bb19b83b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1600, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/environment/scopes/service-accounts" + }, + "response": { + "bodySize": 1975, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 1975, + "text": "[{\"scope\":\"fr:am:*\",\"description\":\"All Access Management APIs\"},{\"scope\":\"fr:autoaccess:*\",\"description\":\"All Auto Access APIs\"},{\"scope\":\"fr:idc:analytics:*\",\"description\":\"All Analytics APIs\"},{\"scope\":\"fr:idc:certificate:*\",\"description\":\"All TLS certificate APIs\",\"childScopes\":[{\"scope\":\"fr:idc:certificate:read\",\"description\":\"Read TLS certificates\"}]},{\"scope\":\"fr:idc:content-security-policy:*\",\"description\":\"All content security policy APIs\",\"childScopes\":[{\"scope\":\"fr:idc:content-security-policy:read\",\"description\":\"Read content security policy\"}]},{\"scope\":\"fr:idc:cookie-domain:*\",\"description\":\"All cookie domain APIs\",\"childScopes\":[{\"scope\":\"fr:idc:cookie-domain:read\",\"description\":\"Read cookie domains\"}]},{\"scope\":\"fr:idc:custom-domain:*\",\"description\":\"All custom domain APIs\",\"childScopes\":[{\"scope\":\"fr:idc:custom-domain:read\",\"description\":\"Read custom domains\"}]},{\"scope\":\"fr:idc:dataset:*\",\"description\":\"All dataset deletion APIs\",\"childScopes\":[{\"scope\":\"fr:idc:dataset:read\",\"description\":\"Read dataset deletions\"}]},{\"scope\":\"fr:idc:esv:*\",\"description\":\"All ESV APIs\",\"childScopes\":[{\"scope\":\"fr:idc:esv:read\",\"description\":\"Read ESVs, excluding values of secrets\"},{\"scope\":\"fr:idc:esv:update\",\"description\":\"Create, modify, and delete ESVs\"},{\"scope\":\"fr:idc:esv:restart\",\"description\":\"Restart workloads that consume ESVs\"}]},{\"scope\":\"fr:idc:promotion:*\",\"description\":\"All configuration promotion APIs\",\"childScopes\":[{\"scope\":\"fr:idc:promotion:read\",\"description\":\"Read configuration promotion\"}]},{\"scope\":\"fr:idc:release:*\",\"description\":\"All product release APIs\",\"childScopes\":[{\"scope\":\"fr:idc:release:read\",\"description\":\"Read product release\"}]},{\"scope\":\"fr:idc:sso-cookie:*\",\"description\":\"All SSO cookie APIs\",\"childScopes\":[{\"scope\":\"fr:idc:sso-cookie:read\",\"description\":\"Read SSO cookie\"}]},{\"scope\":\"fr:idm:*\",\"description\":\"All Identity Management APIs\"},{\"scope\":\"fr:iga:*\",\"description\":\"All Identity Governance APIs\"}]" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "1975" + }, + { + "name": "etag", + "value": "W/\"7b7-tIBWy/EinSCKaoNz4aU2iqiTmFc\"" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:46:17 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "64c481c6-9342-4dcf-866f-d0a1648f305b" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 413, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:46:17.045Z", + "time": 102, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 102 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/iga_2664973160/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/iga_2664973160/recording.har new file mode 100644 index 000000000..3d8d9902e --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/iga_2664973160/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_i_D/iga", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "f64029142a38862fb58bc7ec0e44e61d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1593, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_queryString", + "value": "" + }, + { + "name": "_pageSize", + "value": "10000" + }, + { + "name": "_pagedResultsOffset", + "value": "1" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/iga/governance/workflow?_queryString=&_pageSize=10000&_pagedResultsOffset=1" + }, + "response": { + "bodySize": 44027, + "content": { + "encoding": "base64", + "mimeType": "application/json; charset=utf-8", + "size": 44027, + "text": "[\"W2U0Rx3RdFbbQ0B14OD6h2nZjuv5/r98Z/8/mu7UOyvCQZZVH31KXJ8+BJy0+yZAG+gfYqVLqi27glzlrpIAH6K13mj8xsP3//uWlrm8iYwLEsXKNMshZ3e5si5UpiC75p2jql8VdHUj6AYQAAQDG9gAnOW99933/q9fBo3qJqZhOAcgx2DINSBnLSW/xsv5UEpyLsAB5UyQKAr//9VNdjfAGa51mawNcqUBnZLcLuJaDNEDXra2SSqxygb+GPPpd3NnuhERntYtR1bfy50xBEGaZPcxNP/v2rfb/tkMR4wiIgLaZahWfWv27xNj2AZJCLHyGBrWdM4/V5xEweAIrzEmVtufC3CzNTlQ719j/Wf/vtbKExAxSd/spjdymaz/ZJDq4Y0YTSrSqGDalR3M0F+SwD+Vn72yw4U7HElMr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nz5wZ4TX46PLYe2x7vEjCD5j1ij4rmowtFsSigQXMLsVV3lP/GOWVjwu0lDIBuSpG+bWc3VYBDihPGv3e/rqSQJTaR61y7JgOXWA9ESS/bDPr13RblBXPKd2VJiY8f/aDC0115AnrfL3FnxJ0Rn0l3AhBm4zEmg8vhf1LOuwH9/+KRVOTisPq4cu6jMh//2+3/On754+PzX5erF3V3laq7vxh+18/qv39mzeUqbe2frL28emnsL/uL1/Xnlm92+uff/rve9i/691+C+uPK/fX7r18vXtfzv+x6aD/Lp693Hw9f+eZwZf/Kr5j0V9/78PVuc9Tf/3r5yj+OfzB5/JPt+pZvjn/+sTk0LOv++vzbXv2eHfTn/rnpZfjzj03f8l/N5R+bvuWbPxr+i/9r//qs//vr18/n59vz8+WSxKSPNNDXr2uQStCY/DedIfzsD0w=\"]" + }, + "cookies": [], + "headers": [ + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "etag", + "value": "W/\"73466-89WIrAJ89vsGCvxkwFrnozkKmHM\"" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "br" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:46:17 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "f84710cf-4448-4c6e-9c2b-af785d6bec9a" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "headersSize": 485, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:46:17.257Z", + "time": 575, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 575 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/oauth2_393036114/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/oauth2_393036114/recording.har new file mode 100644 index 000000000..1c67ce9e5 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/oauth2_393036114/recording.har @@ -0,0 +1,146 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_i_D/oauth2", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ff75519a93ccab829f8ee8cf5e92b49f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 1140, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/x-www-form-urlencoded" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "accept-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "content-length", + "value": "1140" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 453, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [], + "text": "assertion=&client_id=service-account&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&scope=fr:am:* fr:idm:* fr:iga:*" + }, + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/oauth2/access_token" + }, + "response": { + "bodySize": 1315, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1315, + "text": "{\"access_token\":\"\",\"scope\":\"fr:am:* fr:idm:* fr:iga:*\",\"token_type\":\"Bearer\",\"expires_in\":899}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1315" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:46:16 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:46:16.774Z", + "time": 142, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 142 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/openidm_3290118515/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/openidm_3290118515/recording.har new file mode 100644 index 000000000..54458ce68 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_i_D_3629472760/openidm_3290118515/recording.har @@ -0,0 +1,310 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_i_D/openidm", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "9cb8561357870863838a9948da32d1e8", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1661, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_fields", + "value": "*" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/openidm/managed/svcacct/6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f?_fields=%2A" + }, + "response": { + "bodySize": 1035, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1035, + "text": "{\"_id\":\"6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f\",\"_rev\":\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\",\"accountStatus\":\"active\",\"name\":\"frodo-dsevy\",\"description\":null,\"scopes\":[\"fr:am:*\",\"fr:idm:*\",\"fr:iga:*\"],\"jwks\":\"{\\\"keys\\\":[{\\\"e\\\":\\\"AQAB\\\",\\\"kty\\\":\\\"RSA\\\",\\\"n\\\":\\\"6HXYr7B1lk8cUVwkHu7mcx2_bhbGr3iISQje39G4W-1nJsC6KfPoCYxaAPeYRI7IqUyrgSmX3WvDybYjtLW1uGtKJ8YEoYaVfNUdcKjKhVMe0kVaf5CQIUgdfIYN_jt4KCL4MBP45Tzs4SQFI4FzujonNhl5cgRuPd8N21ziYnF11iKUKpNsKCSc1OzTYAeE2NM6fnP737gCs4FlJUY_v0qAkmBjqoLHIWxm_1GCJ3UBjcnzmUdCM4Akjftn45Oq_z0N_ZaANSS1twK53PL_hfKiNFWsBn2rJ-tmh4e5r-sx2nBseRHwH0AKtJklMw9lFHufQ9KNG73xZ-WaWtaxc55P3JnYl6kFaiuNDaSTvL3I4b1uKLeT4pUdr4In51bDd7P0gUSKe9LVTfafr50WkxaJ_e07SU1rFi7j41wjd4P7yCY5hBK_ZPvZsTT_6i1-gpBRBJFfpbcZxlhFF3PUf6p4M_Bzkwt4kdyoPErs7D3fXEpIqIHpeStD2G4RbdI-_MqYvJinc5ZXsGnWC44ZHwZj0QhweS7Zsp9ZA--nNTWz5zYwVjraOe5Jv9pBfY9a-DGy4QqKO23sAcZjjjQGf9H-YX-krCLHOjsjVfyMY3xiQPVZJUVMK-ocWqOT7dwvpMGJ8yG57j1OjAB8ZJvqlDduDY9w6fhdI6wVZ5FYwZ8\\\"}]}\",\"maxCachingTime\":\"15\",\"maxIdleTime\":\"15\",\"maxSessionTime\":\"15\",\"quotaLimit\":\"5\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:46:17 GMT" + }, + { + "name": "vary", + "value": "Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "content-length", + "value": "1035" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:46:16.977Z", + "time": 194, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 194 + } + }, + { + "_id": "9cb8561357870863838a9948da32d1e8", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1661, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_fields", + "value": "*" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/openidm/managed/svcacct/6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f?_fields=%2A" + }, + "response": { + "bodySize": 1035, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1035, + "text": "{\"_id\":\"6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f\",\"_rev\":\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\",\"accountStatus\":\"active\",\"name\":\"frodo-dsevy\",\"description\":null,\"scopes\":[\"fr:am:*\",\"fr:idm:*\",\"fr:iga:*\"],\"jwks\":\"{\\\"keys\\\":[{\\\"e\\\":\\\"AQAB\\\",\\\"kty\\\":\\\"RSA\\\",\\\"n\\\":\\\"6HXYr7B1lk8cUVwkHu7mcx2_bhbGr3iISQje39G4W-1nJsC6KfPoCYxaAPeYRI7IqUyrgSmX3WvDybYjtLW1uGtKJ8YEoYaVfNUdcKjKhVMe0kVaf5CQIUgdfIYN_jt4KCL4MBP45Tzs4SQFI4FzujonNhl5cgRuPd8N21ziYnF11iKUKpNsKCSc1OzTYAeE2NM6fnP737gCs4FlJUY_v0qAkmBjqoLHIWxm_1GCJ3UBjcnzmUdCM4Akjftn45Oq_z0N_ZaANSS1twK53PL_hfKiNFWsBn2rJ-tmh4e5r-sx2nBseRHwH0AKtJklMw9lFHufQ9KNG73xZ-WaWtaxc55P3JnYl6kFaiuNDaSTvL3I4b1uKLeT4pUdr4In51bDd7P0gUSKe9LVTfafr50WkxaJ_e07SU1rFi7j41wjd4P7yCY5hBK_ZPvZsTT_6i1-gpBRBJFfpbcZxlhFF3PUf6p4M_Bzkwt4kdyoPErs7D3fXEpIqIHpeStD2G4RbdI-_MqYvJinc5ZXsGnWC44ZHwZj0QhweS7Zsp9ZA--nNTWz5zYwVjraOe5Jv9pBfY9a-DGy4QqKO23sAcZjjjQGf9H-YX-krCLHOjsjVfyMY3xiQPVZJUVMK-ocWqOT7dwvpMGJ8yG57j1OjAB8ZJvqlDduDY9w6fhdI6wVZ5FYwZ8\\\"}]}\",\"maxCachingTime\":\"15\",\"maxIdleTime\":\"15\",\"maxSessionTime\":\"15\",\"quotaLimit\":\"5\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:46:17 GMT" + }, + { + "name": "vary", + "value": "Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "content-length", + "value": "1035" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-3414094a-1b22-4e32-8d7b-86d96ab8cc90" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:46:17.153Z", + "time": 97, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 97 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/am_1076162899/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/am_1076162899/recording.har new file mode 100644 index 000000000..ee30cc79b --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/am_1076162899/recording.har @@ -0,0 +1,312 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_n_D/am", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccd7a5defd0fdeaa986a2b54642d911a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "accept-api-version", + "value": "resource=1.1" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 398, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/json/serverinfo/*" + }, + "response": { + "bodySize": 614, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 614, + "text": "{\"_id\":\"*\",\"_rev\":\"959929574\",\"domains\":[],\"protectedUserAttributes\":[\"telephoneNumber\",\"mail\"],\"cookieName\":\"311468432e97f1f\",\"secureCookie\":true,\"forgotPassword\":\"false\",\"forgotUsername\":\"false\",\"kbaEnabled\":\"false\",\"selfRegistration\":\"false\",\"lang\":\"en-US\",\"successfulUserRegistrationDestination\":\"default\",\"socialImplementations\":[],\"referralsEnabled\":\"false\",\"zeroPageLogin\":{\"enabled\":false,\"refererWhitelist\":[],\"allowedWithoutReferer\":true},\"realm\":\"/\",\"xuiUserSessionValidationEnabled\":true,\"fileBasedConfiguration\":true,\"userIdAttributes\":[],\"cloudOnlyFeaturesEnabled\":true,\"oauth2AIAgentsEnabled\":false}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.1" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"959929574\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "614" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:45:30 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 786, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:45:30.410Z", + "time": 170, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 170 + } + }, + { + "_id": "6125d0328ad0dcaee55f73fd8b22ca14", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "accept-api-version", + "value": "resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1649, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/json/serverinfo/version" + }, + "response": { + "bodySize": 275, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 275, + "text": "{\"_id\":\"version\",\"_rev\":\"1171477248\",\"version\":\"9.0.0-SNAPSHOT\",\"fullVersion\":\"ForgeRock Access Management 9.0.0-SNAPSHOT Build 304c60a9fe7797e1045c631600098d4465b73e4d (2026-April-15 10:21)\",\"revision\":\"304c60a9fe7797e1045c631600098d4465b73e4d\",\"date\":\"2026-April-15 10:21\"}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-api-version", + "value": "resource=1.0" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"1171477248\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "275" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:45:30 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 787, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:45:30.741Z", + "time": 122, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 122 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/environment_1072573434/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/environment_1072573434/recording.har new file mode 100644 index 000000000..4727b3f43 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/environment_1072573434/recording.har @@ -0,0 +1,125 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_n_D/environment", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ccc7ec61c2094114d7917814bb19b83b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1600, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/environment/scopes/service-accounts" + }, + "response": { + "bodySize": 1975, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 1975, + "text": "[{\"scope\":\"fr:am:*\",\"description\":\"All Access Management APIs\"},{\"scope\":\"fr:autoaccess:*\",\"description\":\"All Auto Access APIs\"},{\"scope\":\"fr:idc:analytics:*\",\"description\":\"All Analytics APIs\"},{\"scope\":\"fr:idc:certificate:*\",\"description\":\"All TLS certificate APIs\",\"childScopes\":[{\"scope\":\"fr:idc:certificate:read\",\"description\":\"Read TLS certificates\"}]},{\"scope\":\"fr:idc:content-security-policy:*\",\"description\":\"All content security policy APIs\",\"childScopes\":[{\"scope\":\"fr:idc:content-security-policy:read\",\"description\":\"Read content security policy\"}]},{\"scope\":\"fr:idc:cookie-domain:*\",\"description\":\"All cookie domain APIs\",\"childScopes\":[{\"scope\":\"fr:idc:cookie-domain:read\",\"description\":\"Read cookie domains\"}]},{\"scope\":\"fr:idc:custom-domain:*\",\"description\":\"All custom domain APIs\",\"childScopes\":[{\"scope\":\"fr:idc:custom-domain:read\",\"description\":\"Read custom domains\"}]},{\"scope\":\"fr:idc:dataset:*\",\"description\":\"All dataset deletion APIs\",\"childScopes\":[{\"scope\":\"fr:idc:dataset:read\",\"description\":\"Read dataset deletions\"}]},{\"scope\":\"fr:idc:esv:*\",\"description\":\"All ESV APIs\",\"childScopes\":[{\"scope\":\"fr:idc:esv:read\",\"description\":\"Read ESVs, excluding values of secrets\"},{\"scope\":\"fr:idc:esv:update\",\"description\":\"Create, modify, and delete ESVs\"},{\"scope\":\"fr:idc:esv:restart\",\"description\":\"Restart workloads that consume ESVs\"}]},{\"scope\":\"fr:idc:promotion:*\",\"description\":\"All configuration promotion APIs\",\"childScopes\":[{\"scope\":\"fr:idc:promotion:read\",\"description\":\"Read configuration promotion\"}]},{\"scope\":\"fr:idc:release:*\",\"description\":\"All product release APIs\",\"childScopes\":[{\"scope\":\"fr:idc:release:read\",\"description\":\"Read product release\"}]},{\"scope\":\"fr:idc:sso-cookie:*\",\"description\":\"All SSO cookie APIs\",\"childScopes\":[{\"scope\":\"fr:idc:sso-cookie:read\",\"description\":\"Read SSO cookie\"}]},{\"scope\":\"fr:idm:*\",\"description\":\"All Identity Management APIs\"},{\"scope\":\"fr:iga:*\",\"description\":\"All Identity Governance APIs\"}]" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "1975" + }, + { + "name": "etag", + "value": "W/\"7b7-tIBWy/EinSCKaoNz4aU2iqiTmFc\"" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:45:30 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "d698b643-188a-4648-9513-dd74c2891e6f" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 413, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:45:30.868Z", + "time": 114, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 114 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/iga_2664973160/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/iga_2664973160/recording.har new file mode 100644 index 000000000..ffe62d947 --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/iga_2664973160/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_n_D/iga", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "f64029142a38862fb58bc7ec0e44e61d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1593, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_queryString", + "value": "" + }, + { + "name": "_pageSize", + "value": "10000" + }, + { + "name": "_pagedResultsOffset", + "value": "1" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/iga/governance/workflow?_queryString=&_pageSize=10000&_pagedResultsOffset=1" + }, + "response": { + "bodySize": 44033, + "content": { + "encoding": "base64", + "mimeType": "application/json; charset=utf-8", + "size": 44033, + "text": "[\"W2U0Rx3RdFbbQ0B14OD6h2nZjuv5/r98Z/8/mu7UOyvCQZZVH31KXJ8+BJy0+yZAG+gfYqVLqi27glzlrpIAH6K13mj8xsP3//uWlrm8iYwLEsXKNMshZ3e5si5UpiC75p2jql8VdHUj6AYQAAQDG9gAnOW99933/q9fBo3qJqZhOAcgx2DINSBnLSW/xsv5UEpyLsAB5UyQKAr//9VNdjfAGa51mawNcqUBnZLcLuJaDNEDXra2SSqxygb+GPPpd3NnuhERntYtR1bfy50xBEGaZPcxNP/v2rfb/tkMR4wiIgLaZahWfWv27xNj2AZJCLHyGBrWdM4/V5xEweAIrzEmVtufC3CzNTlQ719j/Wf/vtbKExAxSd/spjdymaz/ZJDq4Y0YTSrSqGDalR3M0F+SwD+Vn72yw4U7HElMrNojqcjHYKN5+6TPZTjzVXBemP/36TAYZx87HA9IKrI0/NcSjLPGbklMFjPv3R3+c+tUHzAm3zw+k6qISRjwECgjxOXPPvhP9LPq71R4mhei7cqs5ZngxWNxHvoquFPhCb5KZAGJd31V1Rux+DrcDnjITTHB4qsnlR37PiZuHFoH4ZE3N5vr31YEzU2kWuIeUPt7HRmlRamaMu0KMsVpfdKb1S+ri7vHvxWFbd7yvOFKZGR6xHf9q9PUfF32SGKi2sH5UPhH3sgVzl5FKlKTq0T9k+rFGNAvagKncHLicTn5a62txtcES/UP/fWLRQ/v30MgZiNfCv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r/vr82179nh305/656WX4849N3/JfzeUfm77lmz8a/ov/a//6rP/769fP5+fb8/PlksSkjzTQ169rkErQmPw3nSH87A9M\"]" + }, + "cookies": [], + "headers": [ + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "etag", + "value": "W/\"73466-89WIrAJ89vsGCvxkwFrnozkKmHM\"" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "br" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:45:32 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "3fb53413-2739-4ba5-8b5e-261db6fbe362" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "headersSize": 485, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:45:31.097Z", + "time": 976, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 976 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/oauth2_393036114/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/oauth2_393036114/recording.har new file mode 100644 index 000000000..f6302d81a --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/oauth2_393036114/recording.har @@ -0,0 +1,146 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_n_D/oauth2", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ff75519a93ccab829f8ee8cf5e92b49f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 1140, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/x-www-form-urlencoded" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "accept-api-version", + "value": "protocol=2.1,resource=1.0" + }, + { + "name": "content-length", + "value": "1140" + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 453, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [], + "text": "assertion=&client_id=service-account&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&scope=fr:am:* fr:idm:* fr:iga:*" + }, + "queryString": [], + "url": "https://openam-trivir-fairfax.forgeblocks.com/am/oauth2/access_token" + }, + "response": { + "bodySize": 1315, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1315, + "text": "{\"access_token\":\"\",\"scope\":\"fr:am:* fr:idm:* fr:iga:*\",\"token_type\":\"Bearer\",\"expires_in\":899}" + }, + "cookies": [], + "headers": [ + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "content-security-policy-report-only", + "value": "frame-ancestors 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1315" + }, + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:45:30 GMT" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:45:30.601Z", + "time": 133, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 133 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/openidm_3290118515/recording.har b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/openidm_3290118515/recording.har new file mode 100644 index 000000000..3b0ebf34c --- /dev/null +++ b/test/e2e/mocks/config-manager_4167095917/pull_2167214206/iga-workflows_1855750639/0_n_D_3738999489/openidm_3290118515/recording.har @@ -0,0 +1,310 @@ +{ + "log": { + "_recordingName": "config-manager/pull/iga-workflows/0_n_D/openidm", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "9cb8561357870863838a9948da32d1e8", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1661, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_fields", + "value": "*" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/openidm/managed/svcacct/6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f?_fields=%2A" + }, + "response": { + "bodySize": 1035, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1035, + "text": "{\"_id\":\"6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f\",\"_rev\":\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\",\"accountStatus\":\"active\",\"name\":\"frodo-dsevy\",\"description\":null,\"scopes\":[\"fr:am:*\",\"fr:idm:*\",\"fr:iga:*\"],\"jwks\":\"{\\\"keys\\\":[{\\\"e\\\":\\\"AQAB\\\",\\\"kty\\\":\\\"RSA\\\",\\\"n\\\":\\\"6HXYr7B1lk8cUVwkHu7mcx2_bhbGr3iISQje39G4W-1nJsC6KfPoCYxaAPeYRI7IqUyrgSmX3WvDybYjtLW1uGtKJ8YEoYaVfNUdcKjKhVMe0kVaf5CQIUgdfIYN_jt4KCL4MBP45Tzs4SQFI4FzujonNhl5cgRuPd8N21ziYnF11iKUKpNsKCSc1OzTYAeE2NM6fnP737gCs4FlJUY_v0qAkmBjqoLHIWxm_1GCJ3UBjcnzmUdCM4Akjftn45Oq_z0N_ZaANSS1twK53PL_hfKiNFWsBn2rJ-tmh4e5r-sx2nBseRHwH0AKtJklMw9lFHufQ9KNG73xZ-WaWtaxc55P3JnYl6kFaiuNDaSTvL3I4b1uKLeT4pUdr4In51bDd7P0gUSKe9LVTfafr50WkxaJ_e07SU1rFi7j41wjd4P7yCY5hBK_ZPvZsTT_6i1-gpBRBJFfpbcZxlhFF3PUf6p4M_Bzkwt4kdyoPErs7D3fXEpIqIHpeStD2G4RbdI-_MqYvJinc5ZXsGnWC44ZHwZj0QhweS7Zsp9ZA--nNTWz5zYwVjraOe5Jv9pBfY9a-DGy4QqKO23sAcZjjjQGf9H-YX-krCLHOjsjVfyMY3xiQPVZJUVMK-ocWqOT7dwvpMGJ8yG57j1OjAB8ZJvqlDduDY9w6fhdI6wVZ5FYwZ8\\\"}]}\",\"maxCachingTime\":\"15\",\"maxIdleTime\":\"15\",\"maxSessionTime\":\"15\",\"quotaLimit\":\"5\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:45:30 GMT" + }, + { + "name": "vary", + "value": "Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "content-length", + "value": "1035" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000" + } + ], + "headersSize": 658, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:45:30.783Z", + "time": 185, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 185 + } + }, + { + "_id": "9cb8561357870863838a9948da32d1e8", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/4.0.0-39" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "authorization", + "value": "Bearer " + }, + { + "name": "accept-encoding", + "value": "gzip, compress, deflate, br" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1661, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "_fields", + "value": "*" + } + ], + "url": "https://openam-trivir-fairfax.forgeblocks.com/openidm/managed/svcacct/6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f?_fields=%2A" + }, + "response": { + "bodySize": 1035, + "content": { + "mimeType": "application/json;charset=utf-8", + "size": 1035, + "text": "{\"_id\":\"6b65c0a2-3ecd-4d7b-a52a-8c0a5c326f3f\",\"_rev\":\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\",\"accountStatus\":\"active\",\"name\":\"frodo-dsevy\",\"description\":null,\"scopes\":[\"fr:am:*\",\"fr:idm:*\",\"fr:iga:*\"],\"jwks\":\"{\\\"keys\\\":[{\\\"e\\\":\\\"AQAB\\\",\\\"kty\\\":\\\"RSA\\\",\\\"n\\\":\\\"6HXYr7B1lk8cUVwkHu7mcx2_bhbGr3iISQje39G4W-1nJsC6KfPoCYxaAPeYRI7IqUyrgSmX3WvDybYjtLW1uGtKJ8YEoYaVfNUdcKjKhVMe0kVaf5CQIUgdfIYN_jt4KCL4MBP45Tzs4SQFI4FzujonNhl5cgRuPd8N21ziYnF11iKUKpNsKCSc1OzTYAeE2NM6fnP737gCs4FlJUY_v0qAkmBjqoLHIWxm_1GCJ3UBjcnzmUdCM4Akjftn45Oq_z0N_ZaANSS1twK53PL_hfKiNFWsBn2rJ-tmh4e5r-sx2nBseRHwH0AKtJklMw9lFHufQ9KNG73xZ-WaWtaxc55P3JnYl6kFaiuNDaSTvL3I4b1uKLeT4pUdr4In51bDd7P0gUSKe9LVTfafr50WkxaJ_e07SU1rFi7j41wjd4P7yCY5hBK_ZPvZsTT_6i1-gpBRBJFfpbcZxlhFF3PUf6p4M_Bzkwt4kdyoPErs7D3fXEpIqIHpeStD2G4RbdI-_MqYvJinc5ZXsGnWC44ZHwZj0QhweS7Zsp9ZA--nNTWz5zYwVjraOe5Jv9pBfY9a-DGy4QqKO23sAcZjjjQGf9H-YX-krCLHOjsjVfyMY3xiQPVZJUVMK-ocWqOT7dwvpMGJ8yG57j1OjAB8ZJvqlDduDY9w6fhdI6wVZ5FYwZ8\\\"}]}\",\"maxCachingTime\":\"15\",\"maxIdleTime\":\"15\",\"maxSessionTime\":\"15\",\"quotaLimit\":\"5\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Tue, 28 Apr 2026 19:45:31 GMT" + }, + { + "name": "vary", + "value": "Origin" + }, + { + "name": "cache-control", + "value": "no-store" + }, + { + "name": "content-security-policy", + "value": "default-src 'none';frame-ancestors 'none';sandbox" + }, + { + "name": "content-type", + "value": "application/json;charset=utf-8" + }, + { + "name": "cross-origin-opener-policy", + "value": "same-origin" + }, + { + "name": "cross-origin-resource-policy", + "value": "same-origin" + }, + { + "name": "etag", + "value": "\"58ad10bd-a1f8-4e41-95b6-b6d4365502cf-28632\"" + }, + { + "name": "expires", + "value": "0" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "x-frame-options", + "value": "DENY" + }, + { + "name": "content-length", + "value": "1035" + }, + { + "name": "x-forgerock-transactionid", + "value": "frodo-1b1998fd-6986-42a2-8719-7e9c82c0b6eb" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "x-robots-tag", + "value": "none" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-04-28T19:45:30.995Z", + "time": 97, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 97 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/test/e2e/utils/TestConfig.js b/test/e2e/utils/TestConfig.js index d5de9f2c5..67390461e 100644 --- a/test/e2e/utils/TestConfig.js +++ b/test/e2e/utils/TestConfig.js @@ -10,6 +10,17 @@ export const connection = { '{"d":"UQJv2m1KXSl5phfjMVqxRR0JjiOyXwe4iVXpCZjwdTo7oVo-cw0icBZkFh-QZHzDwa_mqt_sEAn6oniEu5IrlsFIPomKUmkSgUHBiqUDSC6iOGF4BIdajifKKk2MjR8e3vXJY7gsXzp7eNDkGO4T9ie5c-TkUIi39aIsKeXBKFVZg4kDLw2Cctm5F0SpBUUci--eYvt3QjzFUKfsdwTe7PcnTO95m-t0JcbhqqI6hAzSIUq0E3v7aynYqp7f_4ZDhzy-FuBjAT_tnlYlTxKCQABdBJtYdjHEgmU-9wETLhBrrIaBg3M6nTtgr-p1OR27tg3W7hyDlgSHfQBv5-dnWNSvr4U7ciX_ZU4LyEQsaLnQprbllB526N7WB_iroF7k9mjr6RhIJLmoI2pK6GVXRsiRL818PDonaL3xgaxsRTAEa63Cb5kSRWsqkv1Das4pqUcrf7VuIOCA8XD5xuAWCwsiAMiQZMx3LWEPS3jRxPUpDMG12yqAHeR7RZ9-8SML2YzEy0nYgcvSCSiFT7Pd57yqPGthSgafMK7GRRBJ6WN9JOsj2LJXjpyz26gCUlnPNYUyUjAZyQFG8q9OhET5YceAJ1g0Upzn1xYQTclyXQxLCXy7Ux3DSIAdhl8zZrm9MTH6s0dI-VHmX4gZs-9aTA4S-e4joZIEoCM8zst41jk","dp":"zSrQqCykCpw1XU-V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8PFfTo8Rn5NqivQ0pFZCF00HjgeTVDBd4pe4hVIKhNCdMp3QpEZMTC2By9anPj-GWftK3g6OSRdm3yQjnqyLGsl5CIYDaaNCxmNoDFdAQ94ZonMxEbHR0vywB7z-hOqRsIe3mBrXaQxpnxuLlz4I_iGvCBofCXN5GKL0-y8fz-sSj6tZ0T-ao7VCZ4Aqt70JRrR7f3mV5M1DhOtRMwfALt-AHJJzZAgkRdyAwgalZeTV-u0lLZDC33vlKwv3v_HN6w"}', }; +export const iga_connection = { + host: 'https://openam-frodo-dev.forgeblocks.com/am', + user: 'volker.scheuber@forgerock.com', + pass: 'Sup3rS3cr3t!', + isIGA: 'true', + realm: 'alpha', + saId: 'b672336b-41ef-428d-ae4a-e0c082875377', + saJwk: + '{"d":"UQJv2m1KXSl5phfjMVqxRR0JjiOyXwe4iVXpCZjwdTo7oVo-cw0icBZkFh-QZHzDwa_mqt_sEAn6oniEu5IrlsFIPomKUmkSgUHBiqUDSC6iOGF4BIdajifKKk2MjR8e3vXJY7gsXzp7eNDkGO4T9ie5c-TkUIi39aIsKeXBKFVZg4kDLw2Cctm5F0SpBUUci--eYvt3QjzFUKfsdwTe7PcnTO95m-t0JcbhqqI6hAzSIUq0E3v7aynYqp7f_4ZDhzy-FuBjAT_tnlYlTxKCQABdBJtYdjHEgmU-9wETLhBrrIaBg3M6nTtgr-p1OR27tg3W7hyDlgSHfQBv5-dnWNSvr4U7ciX_ZU4LyEQsaLnQprbllB526N7WB_iroF7k9mjr6RhIJLmoI2pK6GVXRsiRL818PDonaL3xgaxsRTAEa63Cb5kSRWsqkv1Das4pqUcrf7VuIOCA8XD5xuAWCwsiAMiQZMx3LWEPS3jRxPUpDMG12yqAHeR7RZ9-8SML2YzEy0nYgcvSCSiFT7Pd57yqPGthSgafMK7GRRBJ6WN9JOsj2LJXjpyz26gCUlnPNYUyUjAZyQFG8q9OhET5YceAJ1g0Upzn1xYQTclyXQxLCXy7Ux3DSIAdhl8zZrm9MTH6s0dI-VHm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HvheQM3mEK7HTgkG_oeyBfWIneh4k_bdIRfy_SjzmLaV8s7jzU8PFfTo8Rn5NqivQ0pFZCF00HjgeTVDBd4pe4hVIKhNCdMp3QpEZMTC2By9anPj-GWftK3g6OSRdm3yQjnqyLGsl5CIYDaaNCxmNoDFdAQ94ZonMxEbHR0vywB7z-hOqRsIe3mBrXaQxpnxuLlz4I_iGvCBofCXN5GKL0-y8fz-sSj6tZ0T-ao7VCZ4Aqt70JRrR7f3mV5M1DhOtRMwfALt-AHJJzZAgkRdyAwgalZeTV-u0lLZDC33vlKwv3v_HN6w"}', +}; + export const classic_connection = { host: 'http://openam-frodo-dev.classic.com:8080/am', user: 'amAdmin',