@acorex-platform/module-workflow-management-client 2.0.0-next.50 → 2.0.0-next.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/fesm2022/{acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-DfHDYcB1.mjs → acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-CeWy4F28.mjs} +38 -38
  2. package/fesm2022/{acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-DfHDYcB1.mjs.map → acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-CeWy4F28.mjs.map} +1 -1
  3. package/fesm2022/{acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-BPa0Sh6Z.mjs → acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-CCrfObJV.mjs} +1 -1
  4. package/fesm2022/{acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-BPa0Sh6Z.mjs.map → acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-CCrfObJV.mjs.map} +1 -1
  5. package/fesm2022/{acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-C4nMV2f5.mjs → acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-BDfqjyXH.mjs} +1 -1
  6. package/fesm2022/{acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-C4nMV2f5.mjs.map → acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-BDfqjyXH.mjs.map} +1 -1
  7. package/fesm2022/{acorex-platform-module-workflow-management-client-index-DUPFLctp.mjs → acorex-platform-module-workflow-management-client-commands-CEL0oQEo.mjs} +3 -3
  8. package/fesm2022/acorex-platform-module-workflow-management-client-commands-CEL0oQEo.mjs.map +1 -0
  9. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-acorex-platform-module-workflow-management-client-contracts-entity-catalog-Drne-WcE.mjs → acorex-platform-module-workflow-management-client-contracts-entity-catalog-acorex-platform-module-workflow-management-client-contracts-entity-catalog-DKJ8J3Du.mjs} +6 -6
  10. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-acorex-platform-module-workflow-management-client-contracts-entity-catalog-Drne-WcE.mjs.map → acorex-platform-module-workflow-management-client-contracts-entity-catalog-acorex-platform-module-workflow-management-client-contracts-entity-catalog-DKJ8J3Du.mjs.map} +1 -1
  11. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-category.entity-3VLEu-L6.mjs → acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-category.entity-D3vxC37e.mjs} +2 -2
  12. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-category.entity-3VLEu-L6.mjs.map → acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-category.entity-D3vxC37e.mjs.map} +1 -1
  13. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-definition.entity-ClVokZpw.mjs → acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-definition.entity-DeQ9YJnV.mjs} +2 -2
  14. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-definition.entity-ClVokZpw.mjs.map → acorex-platform-module-workflow-management-client-contracts-entity-catalog-activity-definition.entity-DeQ9YJnV.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-automation.entity-BY4uwLMZ.mjs → acorex-platform-module-workflow-management-client-contracts-entity-catalog-automation.entity-DawSPBc5.mjs} +2 -2
  16. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-automation.entity-BY4uwLMZ.mjs.map → acorex-platform-module-workflow-management-client-contracts-entity-catalog-automation.entity-DawSPBc5.mjs.map} +1 -1
  17. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-definition.entity-DN9KS_mu.mjs → acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-definition.entity-CzRfB-p0.mjs} +2 -2
  18. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-definition.entity-DN9KS_mu.mjs.map → acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-definition.entity-CzRfB-p0.mjs.map} +1 -1
  19. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-instance.entity-BnfbJExU.mjs → acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-instance.entity-OAs4J2QH.mjs} +2 -2
  20. package/fesm2022/{acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-instance.entity-BnfbJExU.mjs.map → acorex-platform-module-workflow-management-client-contracts-entity-catalog-workflow-instance.entity-OAs4J2QH.mjs.map} +1 -1
  21. package/fesm2022/acorex-platform-module-workflow-management-client-contracts-entity-catalog.mjs +1 -1
  22. package/fesm2022/{acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-BFdyJ4rC.mjs → acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-8fwqrqCV.mjs} +1 -1
  23. package/fesm2022/{acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-BFdyJ4rC.mjs.map → acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-8fwqrqCV.mjs.map} +1 -1
  24. package/fesm2022/{acorex-platform-module-workflow-management-client-execute-workflow.command-D1AQsYgn.mjs → acorex-platform-module-workflow-management-client-execute-workflow.command-CnQgIVaj.mjs} +1 -1
  25. package/fesm2022/{acorex-platform-module-workflow-management-client-execute-workflow.command-D1AQsYgn.mjs.map → acorex-platform-module-workflow-management-client-execute-workflow.command-CnQgIVaj.mjs.map} +1 -1
  26. package/fesm2022/{acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs → acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-CvFHyST8.mjs} +1 -1
  27. package/fesm2022/{acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs.map → acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-CvFHyST8.mjs.map} +1 -1
  28. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs → acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-D7w2TNxB.mjs} +1 -1
  29. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs.map → acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-D7w2TNxB.mjs.map} +1 -1
  30. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs → acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-DV8K0otJ.mjs} +1 -1
  31. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs.map → acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-DV8K0otJ.mjs.map} +1 -1
  32. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-cQXYistV.mjs → acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-DPMtUBxM.mjs} +3 -3
  33. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-cQXYistV.mjs.map → acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-DPMtUBxM.mjs.map} +1 -1
  34. package/fesm2022/{acorex-platform-module-workflow-management-client-index-B0-OPKmr.mjs → acorex-platform-module-workflow-management-client-workflow-definition-activities-page-BaK0DeXk.mjs} +4 -4
  35. package/fesm2022/acorex-platform-module-workflow-management-client-workflow-definition-activities-page-BaK0DeXk.mjs.map +1 -0
  36. package/fesm2022/{acorex-platform-module-workflow-management-client-index-C8nsbDAw.mjs → acorex-platform-module-workflow-management-client-workflow-instance-activity-instances-page-CE7L5ZDi.mjs} +4 -4
  37. package/fesm2022/acorex-platform-module-workflow-management-client-workflow-instance-activity-instances-page-CE7L5ZDi.mjs.map +1 -0
  38. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries--9NtYkau.mjs → acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries-DamdqV3a.mjs} +1 -1
  39. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries--9NtYkau.mjs.map → acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries-DamdqV3a.mjs.map} +1 -1
  40. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-CLZjVnAC.mjs → acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-Bnc6NpNz.mjs} +9 -9
  41. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-CLZjVnAC.mjs.map → acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-Bnc6NpNz.mjs.map} +1 -1
  42. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-AnJ-Pywf.mjs → acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-ChMzrVoq.mjs} +4 -4
  43. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-AnJ-Pywf.mjs.map → acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-ChMzrVoq.mjs.map} +1 -1
  44. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-34kIeL5C.mjs → acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-CEfYaxTL.mjs} +4 -4
  45. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-34kIeL5C.mjs.map → acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-CEfYaxTL.mjs.map} +1 -1
  46. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-task-popover.component-BAB0y9_u.mjs → acorex-platform-module-workflow-management-client-workflow-task-popover.component-BqxjT0p7.mjs} +4 -4
  47. package/fesm2022/{acorex-platform-module-workflow-management-client-workflow-task-popover.component-BAB0y9_u.mjs.map → acorex-platform-module-workflow-management-client-workflow-task-popover.component-BqxjT0p7.mjs.map} +1 -1
  48. package/fesm2022/acorex-platform-module-workflow-management-client.mjs +1 -1
  49. package/package.json +2 -2
  50. package/fesm2022/acorex-platform-module-workflow-management-client-index-B0-OPKmr.mjs.map +0 -1
  51. package/fesm2022/acorex-platform-module-workflow-management-client-index-C8nsbDAw.mjs.map +0 -1
  52. package/fesm2022/acorex-platform-module-workflow-management-client-index-DUPFLctp.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-workflow-management-client-execute-workflow.command-D1AQsYgn.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/entities/workflow-definition/commands/execute-workflow.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { AXPWorkflowManager } from '@acorex-platform/framework-client/workflow';\nimport { Injectable, inject } from '@angular/core';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\n\n//#region ---- Types ----\n\n/**\n * Input for ExecuteWorkflow command\n */\nexport interface ExecuteWorkflowInput {\n /**\n * Workflow name (unique key)\n */\n workflowId: string;\n\n /**\n * Initial input data\n */\n input?: Record<string, any>;\n}\n\n/**\n * Output for ExecuteWorkflow command\n */\nexport interface ExecuteWorkflowOutput {\n /**\n * Instance ID\n */\n instanceId: string;\n\n /**\n * Workflow output\n */\n output: any;\n}\n\nconst WORKFLOW_EXECUTE_ERROR_I18N = '@workflow-management:workflow-instances.messages.error';\n\n//#endregion\n\n/**\n * Execute Workflow Command\n * \n * Starts and manages workflow execution from entity list.\n * Handles the complete workflow lifecycle including frontend/backend activities.\n */\n@Injectable()\nexport class ExecuteWorkflowCommand implements AXPCommand<ExecuteWorkflowInput, ExecuteWorkflowOutput> {\n //#region ---- Services ----\n\n private readonly workflowManager = inject(AXPWorkflowManager);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(xx: any): AXPCommandExecuteResultPromise<ExecuteWorkflowOutput> {\n\n try {\n // Extract input from command context (entity actions pass options via options)\n const input = (xx?.options || xx) as ExecuteWorkflowInput;\n \n console.log(`[WorkflowManagement] 🚀 ExecuteWorkflowCommand: Starting workflow '${input.workflowId}'`, {\n workflowId: input.workflowId,\n input: input.input,\n context: xx,\n });\n\n // Start workflow execution\n // This uses the workflow engine which now queries definitions by name field\n const result = await this.workflowManager.start(input.workflowId, input.input || {});\n \n console.log(`[WorkflowManagement] 📊 Workflow start result:`, {\n success: result.success,\n instanceId: result.instanceId,\n error: result.error,\n stateStatus: result.state?.status,\n stateActivityOutputs: result.state?.activityOutputs,\n });\n\n if (!result.success) {\n console.error(`[WorkflowManagement] ❌ Failed to start workflow '${input.workflowId}':`, result.error);\n const unknownMessage = await this.translationService.translateAsync('@general:toggle.unknown');\n const errorMessage = result.error || unknownMessage;\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-failed-title`),\n content: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-error-content`, {\n params: { message: errorMessage },\n }),\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: { details: {\n instanceId: result.instanceId || '',\n output: null,\n },\n text: result.error || 'Unknown error'\n },\n };\n }\n\n console.log(`[WorkflowManagement] ✅ Workflow '${input.workflowId}' started successfully. Instance ID: ${result.instanceId}`);\n\n // Handle workflow execution loop\n // let currentResult = result;\n // let taskCount = 0;\n // while (currentResult.nextTask) {\n // taskCount++;\n // const task = currentResult.nextTask;\n\n // console.log(`[ExecuteWorkflowCommand] 🔄 Task ${taskCount}: Executing frontend task: ${task.activityType}`, task);\n\n // // Execute frontend task\n // console.log(`[ExecuteWorkflowCommand] ⚙️ Calling workflowManager.execute...`);\n // const executionResult = await this.workflowManager.execute(task);\n // console.log(`[ExecuteWorkflowCommand] ✅ Task executed:`, {\n // output: executionResult.output,\n // outcome: executionResult.outcome,\n // });\n \n // const { output, outcome } = executionResult;\n\n // // Complete task and get next\n // currentResult = await this.workflowManager.complete(\n // currentResult.instanceId!,\n // task,\n // outcome,\n // output\n // );\n\n // if (!currentResult.success) {\n // this.toastService.show({\n // color: 'danger',\n // title: 'Workflow Execution Failed',\n // content: currentResult.error || 'Unknown error',\n // closeButton: true,\n // timeOut: 5000,\n // });\n\n // return {\n // success: false,\n // message: {\n // text: currentResult.error || 'Unknown error'\n // },\n // data: {\n // instanceId: currentResult.instanceId || '',\n // output: null,\n // }\n // };\n // }\n // }\n\n // Workflow completed successfully\n // console.log(`[ExecuteWorkflowCommand] Workflow completed:`, currentResult.state?.output);\n\n if (result.dismissed) {\n return {\n success: true,\n kind: 'object',\n data: undefined as unknown as ExecuteWorkflowOutput,\n metadata: { refresh: false },\n };\n }\n\n return {\n success: true,\n kind: 'object',\n data: undefined as unknown as ExecuteWorkflowOutput,\n // data: {\n // instanceId: currentResult.instanceId!,\n // output: currentResult.state?.output,\n // }\n };\n } catch (error: any) {\n console.error(`[ExecuteWorkflowCommand] Error:`, error);\n\n const unknownMessage = await this.translationService.translateAsync('@general:toggle.unknown');\n const errorMessage = error.message || unknownMessage;\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-error-title`),\n content: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-error-content`, {\n params: { message: errorMessage },\n }),\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: { details: {\n instanceId: '',\n output: null,\n },\n text: error.message || 'Unknown error'\n },\n };\n }\n }\n\n //#endregion\n}\n\n"],"names":[],"mappings":";;;;;;AAwCA,MAAM,2BAA2B,GAAG,wDAAwD;AAE5F;AAEA;;;;;AAKG;MAEU,sBAAsB,CAAA;AADnC,IAAA,WAAA,G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js","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/entities/workflow-definition/commands/execute-workflow.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { AXPWorkflowManager } from '@acorex-platform/framework-client/workflow';\nimport { Injectable, inject } from '@angular/core';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\n\n//#region ---- Types ----\n\n/**\n * Input for ExecuteWorkflow command\n */\nexport interface ExecuteWorkflowInput {\n /**\n * Workflow name (unique key)\n */\n workflowId: string;\n\n /**\n * Initial input data\n */\n input?: Record<string, any>;\n}\n\n/**\n * Output for ExecuteWorkflow command\n */\nexport interface ExecuteWorkflowOutput {\n /**\n * Instance ID\n */\n instanceId: string;\n\n /**\n * Workflow output\n */\n output: any;\n}\n\nconst WORKFLOW_EXECUTE_ERROR_I18N = '@workflow-management:workflow-instances.messages.error';\n\n//#endregion\n\n/**\n * Execute Workflow Command\n * \n * Starts and manages workflow execution from entity list.\n * Handles the complete workflow lifecycle including frontend/backend activities.\n */\n@Injectable()\nexport class ExecuteWorkflowCommand implements AXPCommand<ExecuteWorkflowInput, ExecuteWorkflowOutput> {\n //#region ---- Services ----\n\n private readonly workflowManager = inject(AXPWorkflowManager);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(xx: any): AXPCommandExecuteResultPromise<ExecuteWorkflowOutput> {\n\n try {\n // Extract input from command context (entity actions pass options via options)\n const input = (xx?.options || xx) as ExecuteWorkflowInput;\n \n console.log(`[WorkflowManagement] 🚀 ExecuteWorkflowCommand: Starting workflow '${input.workflowId}'`, {\n workflowId: input.workflowId,\n input: input.input,\n context: xx,\n });\n\n // Start workflow execution\n // This uses the workflow engine which now queries definitions by name field\n const result = await this.workflowManager.start(input.workflowId, input.input || {});\n \n console.log(`[WorkflowManagement] 📊 Workflow start result:`, {\n success: result.success,\n instanceId: result.instanceId,\n error: result.error,\n stateStatus: result.state?.status,\n stateActivityOutputs: result.state?.activityOutputs,\n });\n\n if (!result.success) {\n console.error(`[WorkflowManagement] ❌ Failed to start workflow '${input.workflowId}':`, result.error);\n const unknownMessage = await this.translationService.translateAsync('@general:toggle.unknown');\n const errorMessage = result.error || unknownMessage;\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-failed-title`),\n content: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-error-content`, {\n params: { message: errorMessage },\n }),\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: { details: {\n instanceId: result.instanceId || '',\n output: null,\n },\n text: result.error || 'Unknown error'\n },\n };\n }\n\n console.log(`[WorkflowManagement] ✅ Workflow '${input.workflowId}' started successfully. Instance ID: ${result.instanceId}`);\n\n // Handle workflow execution loop\n // let currentResult = result;\n // let taskCount = 0;\n // while (currentResult.nextTask) {\n // taskCount++;\n // const task = currentResult.nextTask;\n\n // console.log(`[ExecuteWorkflowCommand] 🔄 Task ${taskCount}: Executing frontend task: ${task.activityType}`, task);\n\n // // Execute frontend task\n // console.log(`[ExecuteWorkflowCommand] ⚙️ Calling workflowManager.execute...`);\n // const executionResult = await this.workflowManager.execute(task);\n // console.log(`[ExecuteWorkflowCommand] ✅ Task executed:`, {\n // output: executionResult.output,\n // outcome: executionResult.outcome,\n // });\n \n // const { output, outcome } = executionResult;\n\n // // Complete task and get next\n // currentResult = await this.workflowManager.complete(\n // currentResult.instanceId!,\n // task,\n // outcome,\n // output\n // );\n\n // if (!currentResult.success) {\n // this.toastService.show({\n // color: 'danger',\n // title: 'Workflow Execution Failed',\n // content: currentResult.error || 'Unknown error',\n // closeButton: true,\n // timeOut: 5000,\n // });\n\n // return {\n // success: false,\n // message: {\n // text: currentResult.error || 'Unknown error'\n // },\n // data: {\n // instanceId: currentResult.instanceId || '',\n // output: null,\n // }\n // };\n // }\n // }\n\n // Workflow completed successfully\n // console.log(`[ExecuteWorkflowCommand] Workflow completed:`, currentResult.state?.output);\n\n if (result.dismissed) {\n return {\n success: true,\n kind: 'object',\n data: undefined as unknown as ExecuteWorkflowOutput,\n metadata: { refresh: false },\n };\n }\n\n return {\n success: true,\n kind: 'object',\n data: undefined as unknown as ExecuteWorkflowOutput,\n // data: {\n // instanceId: currentResult.instanceId!,\n // output: currentResult.state?.output,\n // }\n };\n } catch (error: any) {\n console.error(`[ExecuteWorkflowCommand] Error:`, error);\n\n const unknownMessage = await this.translationService.translateAsync('@general:toggle.unknown');\n const errorMessage = error.message || unknownMessage;\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-error-title`),\n content: await this.translationService.translateAsync(`${WORKFLOW_EXECUTE_ERROR_I18N}.execution-error-content`, {\n params: { message: errorMessage },\n }),\n closeButton: true,\n timeOut: 5000,\n });\n\n return {\n success: false,\n message: { details: {\n instanceId: '',\n output: null,\n },\n text: error.message || 'Unknown error'\n },\n };\n }\n }\n\n //#endregion\n}\n\n"],"names":[],"mappings":";;;;;;AAwCA,MAAM,2BAA2B,GAAG,wDAAwD;AAE5F;AAEA;;;;;AAKG;MAEU,sBAAsB,CAAA;AADnC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC5C,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA2JnE,IAAA;;;IArJC,MAAM,OAAO,CAAC,EAAO,EAAA;AAEnB,QAAA,IAAI;;YAEF,MAAM,KAAK,IAAI,EAAE,EAAE,OAAO,IAAI,EAAE,CAAyB;YAEzD,OAAO,CAAC,GAAG,CAAC,CA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,EAAE,QAAQ;gBACf,KAAK,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA,EAAG,2BAA2B,CAAA,sBAAA,CAAwB,CAAC;gBAC3G,OAAO,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA,EAAG,2BAA2B,CAAA,wBAAA,CAA0B,EAAE;AAC9G,oBAAA,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;iBAClC,CAAC;AACF,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,OAAO,EAAE,IAAI;AACd,aAAA,CAAC;YAEF,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,EAAE,OAAO,EAAE;AAClB,wBAAA,UAAU,EAAE,EAAE;AACd,wBAAA,MAAM,EAAE,IAAI;AACb,qBAAA;AACC,oBAAA,IAAI,EAAE,KAAK,CAAC,OAAO,IAAI;AACxB,iBAAA;aACA;QACL;IACF;8GA7JW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAtB,sBAAsB,EAAA,CAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC;;;"}
@@ -57,4 +57,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
57
57
  }] });
58
58
 
59
59
  export { SaveWorkflowDefinitionActivitiesCommand, WORKFLOW_DEFINITION_ACTIVITIES_SAVE_COMMAND };
60
- //# sourceMappingURL=acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs.map
60
+ //# sourceMappingURL=acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-CvFHyST8.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/entities/workflow-definition/commands/save-workflow-definition-activities.command.ts"],"sourcesContent":["\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, AXPWorkflowGraph } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { inject, Injectable } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';\n\nexport const WORKFLOW_DEFINITION_ACTIVITIES_SAVE_COMMAND = 'WorkflowManagement.WorkflowDefinition:Activities:Save';\n\nexport interface SaveWorkflowDefinitionActivitiesInput {\n id: string;\n graph: AXPWorkflowGraph;\n /** When true, suppresses success toast (used by background auto-save). */\n silent?: boolean;\n}\n\n/**\n * Persists the workflow definition graph edited from the Activities custom page.\n */\n@Injectable()\nexport class SaveWorkflowDefinitionActivitiesCommand\n implements AXPCommand<SaveWorkflowDefinitionActivitiesInput, unknown>\n{\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: SaveWorkflowDefinitionActivitiesInput): AXPCommandExecuteResultPromise<unknown> {\n const { id, graph, silent } = input;\n\n if (!id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n try {\n const entityRef = `${RootConfig.module.name}.${RootConfig.entities.workflowDefinition.name}`;\n const dataAccessor = this.entityService.withEntity(entityRef).data<any, any>();\n\n await dataAccessor.update(id, { graph });\n\n return { success: true, kind: 'object',\n data: { id, graph },\n metadata: { refresh: false },\n ...(silent\n ? {}\n : {\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n }),\n };\n } catch (error: unknown) {\n const message =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.generic.error.description');\n\n return {\n success: false,\n message: { text: message },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;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,KAAc,EAAE;AACvB,YAAA,MAAM,OAAO,GACX,KAAK,YAAY;kBACb,KAAK,CAAC;kBACN,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,6CAA6C,CAAC;YAEjG,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;aAC3B;QACH;IACF;8GA9CW,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvC,uCAAuC,EAAA,CAAA,CAAA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;"}
1
+ {"version":3,"file":"acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-CvFHyST8.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/entities/workflow-definition/commands/save-workflow-definition-activities.command.ts"],"sourcesContent":["\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult, AXPWorkflowGraph } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { inject, Injectable } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';\n\nexport const WORKFLOW_DEFINITION_ACTIVITIES_SAVE_COMMAND = 'WorkflowManagement.WorkflowDefinition:Activities:Save';\n\nexport interface SaveWorkflowDefinitionActivitiesInput {\n id: string;\n graph: AXPWorkflowGraph;\n /** When true, suppresses success toast (used by background auto-save). */\n silent?: boolean;\n}\n\n/**\n * Persists the workflow definition graph edited from the Activities custom page.\n */\n@Injectable()\nexport class SaveWorkflowDefinitionActivitiesCommand\n implements AXPCommand<SaveWorkflowDefinitionActivitiesInput, unknown>\n{\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: SaveWorkflowDefinitionActivitiesInput): AXPCommandExecuteResultPromise<unknown> {\n const { id, graph, silent } = input;\n\n if (!id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n try {\n const entityRef = `${RootConfig.module.name}.${RootConfig.entities.workflowDefinition.name}`;\n const dataAccessor = this.entityService.withEntity(entityRef).data<any, any>();\n\n await dataAccessor.update(id, { graph });\n\n return { success: true, kind: 'object',\n data: { id, graph },\n metadata: { refresh: false },\n ...(silent\n ? {}\n : {\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n }),\n };\n } catch (error: unknown) {\n const message =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.generic.error.description');\n\n return {\n success: false,\n message: { text: message },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;;;AAUO,MAAM,2CAA2C,GAAG;AAS3D;;AAEG;MAEU,uCAAuC,CAAA;AADpD,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA2CnE,IAAA;IAzCC,MAAM,OAAO,CAAC,KAA4C,EAAA;QACxD,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK;QAEnC,IAAI,CAAC,EAAE,EAAE;YACP,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AAC5F,iBAAA;aACF;QACH;AAEA,QAAA,IAAI;AACF,YAAA,MAAM,SAAS,GAAG,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE;AAC5F,YAAA,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,EAAY;YAE9E,MAAM,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AAExC,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ;AACpC,gBAAA,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE;AACnB,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;AAC5B,gBAAA,IAAI;AACF,sBAAE;AACF,sBAAE;AACE,wBAAA,OAAO,EAAE;4BACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,+CAA+C,CAAC;AACpG,yBAAA;qBACF,CAAC;aACP;QACH;QAAE,OAAO,KAAc,EAAE;AACvB,YAAA,MAAM,OAAO,GACX,KAAK,YAAY;kBACb,KAAK,CAAC;kBACN,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,6CAA6C,CAAC;YAEjG,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;aAC3B;QACH;IACF;8GA9CW,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvC,uCAAuC,EAAA,CAAA,CAAA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;"}
@@ -169,4 +169,4 @@ function buildWorkflowActivityInstanceRows(instance, definition, emptyAssigneesL
169
169
  //#endregion
170
170
 
171
171
  export { workflowActivityToViewerRoot as a, buildWorkflowActivityInstanceRows as b, formatReadableActivityName as f, workflowActivityStatusChipModifier as w };
172
- //# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs.map
172
+ //# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-D7w2TNxB.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-instance-activity-instances-page/workflow-activity-instance-rows.utils.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPActivityExecutionContextState, AXPWorkflowActivityInstance, AXPWorkflowDefinition, AXPWorkflowInstance } from '@acorex-platform/framework-shared/core';\n\n//#endregion\n\n//#region ---- Types ----\n\n/** One row in a workflow activity timeline (engine state, definition graph, persisted audit keys). */\nexport interface AXMWorkflowActivityInstanceViewRow {\n contextId: string;\n nodeId: string;\n activityTitle: string;\n activityTypeName: string;\n isHumanTask: boolean;\n status: string;\n startedAt: string;\n completedAt: string | null;\n /** Connection port / outcome that was taken after this step (from workflow state variables). */\n outcomeDisplay: string;\n /** Input from graph definition — passed to `ax-json-viewer`. */\n inputForViewer: unknown;\n /** Captured output for this step — passed to `ax-json-viewer`. */\n outputForViewer: unknown;\n humanAssigneesDisplay: string;\n /** Who performed the step (from persisted `completedByLabel` / `completedByUserId` when available). */\n performedByDisplay: string;\n}\n\n//#endregion\n\n//#region ---- Helpers (display only) ----\n\nexport function formatReadableActivityName(value: string): string {\n return value\n .replace(/^workflow-activity:/, '')\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/[-_]/g, ' ')\n .split(' ')\n .filter((token) => token.length > 0)\n .map((token) => token.charAt(0).toUpperCase() + token.slice(1))\n .join(' ');\n}\n\nfunction normalizeUserIds(value: unknown): string[] {\n if (value == null) {\n return [];\n }\n if (Array.isArray(value)) {\n return value.filter((v): v is string => typeof v === 'string' && v.trim().length > 0);\n }\n if (typeof value === 'string' && value.trim().length > 0) {\n return [value.trim()];\n }\n return [];\n}\n\nfunction formatHumanAssigneesFromPayload(payload: Record<string, unknown> | null | undefined): string {\n if (!payload) {\n return '';\n }\n const assigned = normalizeUserIds(payload['assignedUserIds']);\n const candidateUsers = normalizeUserIds(payload['candidateUserIds']);\n const candidateRoles = normalizeUserIds(payload['candidateRoleIds']);\n const labels = [\n ...assigned.map((id) => `User:${id}`),\n ...candidateUsers.map((id) => `Candidate:${id}`),\n ...candidateRoles.map((id) => `Role:${id}`),\n ];\n const unique = [...new Set(labels)];\n return unique.length > 0 ? unique.join(', ') : '';\n}\n\nfunction formatPerformedBy(label: unknown, id: unknown, empty: string): string {\n const ls = label != null && String(label).trim() !== '' ? String(label).trim() : '';\n const idStr = id != null && String(id).trim() !== '' ? String(id).trim() : '';\n if (ls && idStr) {\n return `${ls} (${idStr})`;\n }\n if (ls) {\n return ls;\n }\n if (idStr) {\n return idStr;\n }\n return empty;\n}\n\nfunction resolveActivityTitle(graphActivity: AXPWorkflowActivityInstance | undefined, nodeId: string): string {\n const rawTitle = graphActivity?.inputs?.['title'];\n if (typeof rawTitle === 'string' && rawTitle.trim().length > 0) {\n return rawTitle.trim();\n }\n if (graphActivity?.name) {\n return formatReadableActivityName(graphActivity.name);\n }\n return formatReadableActivityName(nodeId);\n}\n\nfunction resolveOutputForViewer(\n props: Record<string, unknown>,\n nodeId: string,\n ctx: AXPActivityExecutionContextState,\n): unknown {\n const key = `${nodeId}_activityOutput`;\n if (key in props && props[key] !== undefined) {\n return props[key];\n }\n if (ctx.activityState != null) {\n return ctx.activityState;\n }\n const p = ctx.properties;\n if (p && typeof p === 'object' && Object.keys(p as object).length > 0) {\n return p;\n }\n return null;\n}\n\n/**\n * Maps activity execution status to `status-chips.css` modifier classes.\n */\nexport function workflowActivityStatusChipModifier(\n status: string,\n): 'primary' | 'success' | 'warning' | 'danger' | 'neutral' | 'secondary' {\n const s = (status ?? '').trim().toLowerCase();\n if (s === 'running' || s === 'pending' || s === 'executing') {\n return 'primary';\n }\n if (s === 'completed' || s === 'succeeded' || s === 'success') {\n return 'success';\n }\n if (s === 'canceled' || s === 'cancelled') {\n return 'neutral';\n }\n if (s === 'faulted' || s === 'failed' || s === 'error') {\n return 'danger';\n }\n if (s === 'suspended' || s === 'waiting') {\n return 'warning';\n }\n return 'secondary';\n}\n\n/**\n * Normalizes a value for `ax-json-viewer` (expects a root object).\n */\nexport function workflowActivityToViewerRoot(value: unknown): Record<string, unknown> {\n if (value === null || value === undefined) {\n return {};\n }\n if (typeof value === 'object' && !Array.isArray(value)) {\n return value as Record<string, unknown>;\n }\n return { value };\n}\n\nexport function buildWorkflowActivityInstanceRows(\n instance: AXPWorkflowInstance | null | undefined,\n definition: AXPWorkflowDefinition | null | undefined,\n emptyAssigneesLabel: string,\n notAvailableLabel: string,\n): AXMWorkflowActivityInstanceViewRow[] {\n if (!instance?.workflowState) {\n return [];\n }\n const props = (instance.workflowState.properties ?? {}) as Record<string, unknown>;\n const contexts = instance.workflowState.activityExecutionContexts ?? [];\n const activities = definition?.graph?.activities ?? [];\n const findActivity = (nodeId: string) => activities.find((a) => a.id === nodeId);\n const extended = instance as AXPWorkflowInstance & {\n bookmarks?: Array<{\n activityId?: string;\n payload?: Record<string, unknown> | null;\n isConsumed?: boolean;\n consumed?: boolean;\n }>;\n };\n const bookmarks = extended.bookmarks ?? [];\n\n const rows: AXMWorkflowActivityInstanceViewRow[] = contexts.map((ctx: AXPActivityExecutionContextState) => {\n const nodeId = ctx.scheduledActivityNodeId;\n const graphActivity = findActivity(nodeId);\n const isHumanTask =\n graphActivity?.name === 'workflow-activity:human-task' || graphActivity?.name === 'workflow-activity:cartable';\n const bookmark = bookmarks.find((b) => b.activityId === nodeId);\n const payload = bookmark?.payload && typeof bookmark.payload === 'object' ? bookmark.payload : null;\n let humanAssignees = isHumanTask ? formatHumanAssigneesFromPayload(payload) : '';\n if (isHumanTask && !humanAssignees) {\n humanAssignees = emptyAssigneesLabel;\n }\n\n const outKey = `${nodeId}_outcome`;\n const outcomeRaw = props[outKey];\n const outcomeDisplay =\n outcomeRaw !== undefined && outcomeRaw !== null && String(outcomeRaw).length > 0\n ? String(outcomeRaw)\n : notAvailableLabel;\n\n const inputForViewer: unknown = graphActivity?.inputs ?? null;\n const outputForViewer = resolveOutputForViewer(props, nodeId, ctx);\n\n const labelKey = `${nodeId}_completedByLabel`;\n const idKey = `${nodeId}_completedByUserId`;\n const performedByDisplay = formatPerformedBy(props[labelKey], props[idKey], notAvailableLabel);\n\n return {\n contextId: ctx.id,\n nodeId,\n activityTitle: resolveActivityTitle(graphActivity, nodeId),\n activityTypeName: graphActivity?.name ?? notAvailableLabel,\n isHumanTask,\n status: String(ctx.status ?? ''),\n startedAt: ctx.startedAt ?? '',\n completedAt: ctx.completedAt ?? null,\n outcomeDisplay,\n inputForViewer,\n outputForViewer,\n humanAssigneesDisplay: isHumanTask ? humanAssignees : notAvailableLabel,\n performedByDisplay,\n };\n });\n\n rows.sort((a, b) => {\n const ta = new Date(a.startedAt).getTime();\n const tb = new Date(b.startedAt).getTime();\n if (ta !== tb) {\n return ta - tb;\n }\n return a.contextId.localeCompare(b.contextId);\n });\n\n return rows;\n}\n\n//#endregion\n"],"names":[],"mappings":"AAAA;AA6BA;AAEA;AAEM,SAAU,0BAA0B,CAAC,KAAa,EAAA;AACtD,IAAA,OAAO;AACJ,SAAA,OAAO,CAAC,qBAAqB,EAAE,EAAE;AACjC,SAAA,OAAO,CAAC,iBAAiB,EAAE,OAAO;AAClC,SAAA,OAAO,CAAC,OAAO,EAAE,GAAG;SACpB,KAAK,CAAC,GAAG;SACT,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;SAClC,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;SAC7D,IAAI,CAAC,GAAG,CAAC;AACd;AAEA,SAAS,gBAAgB,CAAC,KAAc,EAAA;AACtC,IAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACjB,QAAA,OA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AG,CAAC,WAAW,IAAI,IAAI;YACpC,cAAc;YACd,cAAc;YACd,eAAe;YACf,qBAAqB,EAAE,WAAW,GAAG,cAAc,GAAG,iBAAiB;YACvE,kBAAkB;SACnB;AACH,IAAA,CAAC,CAAC;IAEF,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAI;AACjB,QAAA,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;AAC1C,QAAA,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;AAC1C,QAAA,IAAI,EAAE,KAAK,EAAE,EAAE;YACb,OAAO,EAAE,GAAG,EAAE;QAChB;QACA,OAAO,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,IAAI;AACb;AAEA;;"}
1
+ {"version":3,"file":"acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-D7w2TNxB.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-instance-activity-instances-page/workflow-activity-instance-rows.utils.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPActivityExecutionContextState, AXPWorkflowActivityInstance, AXPWorkflowDefinition, AXPWorkflowInstance } from '@acorex-platform/framework-shared/core';\n\n//#endregion\n\n//#region ---- Types ----\n\n/** One row in a workflow activity timeline (engine state, definition graph, persisted audit keys). */\nexport interface AXMWorkflowActivityInstanceViewRow {\n contextId: string;\n nodeId: string;\n activityTitle: string;\n activityTypeName: string;\n isHumanTask: boolean;\n status: string;\n startedAt: string;\n completedAt: string | null;\n /** Connection port / outcome that was taken after this step (from workflow state variables). */\n outcomeDisplay: string;\n /** Input from graph definition — passed to `ax-json-viewer`. */\n inputForViewer: unknown;\n /** Captured output for this step — passed to `ax-json-viewer`. */\n outputForViewer: unknown;\n humanAssigneesDisplay: string;\n /** Who performed the step (from persisted `completedByLabel` / `completedByUserId` when available). */\n performedByDisplay: string;\n}\n\n//#endregion\n\n//#region ---- Helpers (display only) ----\n\nexport function formatReadableActivityName(value: string): string {\n return value\n .replace(/^workflow-activity:/, '')\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/[-_]/g, ' ')\n .split(' ')\n .filter((token) => token.length > 0)\n .map((token) => token.charAt(0).toUpperCase() + token.slice(1))\n .join(' ');\n}\n\nfunction normalizeUserIds(value: unknown): string[] {\n if (value == null) {\n return [];\n }\n if (Array.isArray(value)) {\n return value.filter((v): v is string => typeof v === 'string' && v.trim().length > 0);\n }\n if (typeof value === 'string' && value.trim().length > 0) {\n return [value.trim()];\n }\n return [];\n}\n\nfunction formatHumanAssigneesFromPayload(payload: Record<string, unknown> | null | undefined): string {\n if (!payload) {\n return '';\n }\n const assigned = normalizeUserIds(payload['assignedUserIds']);\n const candidateUsers = normalizeUserIds(payload['candidateUserIds']);\n const candidateRoles = normalizeUserIds(payload['candidateRoleIds']);\n const labels = [\n ...assigned.map((id) => `User:${id}`),\n ...candidateUsers.map((id) => `Candidate:${id}`),\n ...candidateRoles.map((id) => `Role:${id}`),\n ];\n const unique = [...new Set(labels)];\n return unique.length > 0 ? unique.join(', ') : '';\n}\n\nfunction formatPerformedBy(label: unknown, id: unknown, empty: string): string {\n const ls = label != null && String(label).trim() !== '' ? String(label).trim() : '';\n const idStr = id != null && String(id).trim() !== '' ? String(id).trim() : '';\n if (ls && idStr) {\n return `${ls} (${idStr})`;\n }\n if (ls) {\n return ls;\n }\n if (idStr) {\n return idStr;\n }\n return empty;\n}\n\nfunction resolveActivityTitle(graphActivity: AXPWorkflowActivityInstance | undefined, nodeId: string): string {\n const rawTitle = graphActivity?.inputs?.['title'];\n if (typeof rawTitle === 'string' && rawTitle.trim().length > 0) {\n return rawTitle.trim();\n }\n if (graphActivity?.name) {\n return formatReadableActivityName(graphActivity.name);\n }\n return formatReadableActivityName(nodeId);\n}\n\nfunction resolveOutputForViewer(\n props: Record<string, unknown>,\n nodeId: string,\n ctx: AXPActivityExecutionContextState,\n): unknown {\n const key = `${nodeId}_activityOutput`;\n if (key in props && props[key] !== undefined) {\n return props[key];\n }\n if (ctx.activityState != null) {\n return ctx.activityState;\n }\n const p = ctx.properties;\n if (p && typeof p === 'object' && Object.keys(p as object).length > 0) {\n return p;\n }\n return null;\n}\n\n/**\n * Maps activity execution status to `status-chips.css` modifier classes.\n */\nexport function workflowActivityStatusChipModifier(\n status: string,\n): 'primary' | 'success' | 'warning' | 'danger' | 'neutral' | 'secondary' {\n const s = (status ?? '').trim().toLowerCase();\n if (s === 'running' || s === 'pending' || s === 'executing') {\n return 'primary';\n }\n if (s === 'completed' || s === 'succeeded' || s === 'success') {\n return 'success';\n }\n if (s === 'canceled' || s === 'cancelled') {\n return 'neutral';\n }\n if (s === 'faulted' || s === 'failed' || s === 'error') {\n return 'danger';\n }\n if (s === 'suspended' || s === 'waiting') {\n return 'warning';\n }\n return 'secondary';\n}\n\n/**\n * Normalizes a value for `ax-json-viewer` (expects a root object).\n */\nexport function workflowActivityToViewerRoot(value: unknown): Record<string, unknown> {\n if (value === null || value === undefined) {\n return {};\n }\n if (typeof value === 'object' && !Array.isArray(value)) {\n return value as Record<string, unknown>;\n }\n return { value };\n}\n\nexport function buildWorkflowActivityInstanceRows(\n instance: AXPWorkflowInstance | null | undefined,\n definition: AXPWorkflowDefinition | null | undefined,\n emptyAssigneesLabel: string,\n notAvailableLabel: string,\n): AXMWorkflowActivityInstanceViewRow[] {\n if (!instance?.workflowState) {\n return [];\n }\n const props = (instance.workflowState.properties ?? {}) as Record<string, unknown>;\n const contexts = instance.workflowState.activityExecutionContexts ?? [];\n const activities = definition?.graph?.activities ?? [];\n const findActivity = (nodeId: string) => activities.find((a) => a.id === nodeId);\n const extended = instance as AXPWorkflowInstance & {\n bookmarks?: Array<{\n activityId?: string;\n payload?: Record<string, unknown> | null;\n isConsumed?: boolean;\n consumed?: boolean;\n }>;\n };\n const bookmarks = extended.bookmarks ?? [];\n\n const rows: AXMWorkflowActivityInstanceViewRow[] = contexts.map((ctx: AXPActivityExecutionContextState) => {\n const nodeId = ctx.scheduledActivityNodeId;\n const graphActivity = findActivity(nodeId);\n const isHumanTask =\n graphActivity?.name === 'workflow-activity:human-task' || graphActivity?.name === 'workflow-activity:cartable';\n const bookmark = bookmarks.find((b) => b.activityId === nodeId);\n const payload = bookmark?.payload && typeof bookmark.payload === 'object' ? bookmark.payload : null;\n let humanAssignees = isHumanTask ? formatHumanAssigneesFromPayload(payload) : '';\n if (isHumanTask && !humanAssignees) {\n humanAssignees = emptyAssigneesLabel;\n }\n\n const outKey = `${nodeId}_outcome`;\n const outcomeRaw = props[outKey];\n const outcomeDisplay =\n outcomeRaw !== undefined && outcomeRaw !== null && String(outcomeRaw).length > 0\n ? String(outcomeRaw)\n : notAvailableLabel;\n\n const inputForViewer: unknown = graphActivity?.inputs ?? null;\n const outputForViewer = resolveOutputForViewer(props, nodeId, ctx);\n\n const labelKey = `${nodeId}_completedByLabel`;\n const idKey = `${nodeId}_completedByUserId`;\n const performedByDisplay = formatPerformedBy(props[labelKey], props[idKey], notAvailableLabel);\n\n return {\n contextId: ctx.id,\n nodeId,\n activityTitle: resolveActivityTitle(graphActivity, nodeId),\n activityTypeName: graphActivity?.name ?? notAvailableLabel,\n isHumanTask,\n status: String(ctx.status ?? ''),\n startedAt: ctx.startedAt ?? '',\n completedAt: ctx.completedAt ?? null,\n outcomeDisplay,\n inputForViewer,\n outputForViewer,\n humanAssigneesDisplay: isHumanTask ? humanAssignees : notAvailableLabel,\n performedByDisplay,\n };\n });\n\n rows.sort((a, b) => {\n const ta = new Date(a.startedAt).getTime();\n const tb = new Date(b.startedAt).getTime();\n if (ta !== tb) {\n return ta - tb;\n }\n return a.contextId.localeCompare(b.contextId);\n });\n\n return rows;\n}\n\n//#endregion\n"],"names":[],"mappings":"AAAA;AA6BA;AAEA;AAEM,SAAU,0BAA0B,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
79
79
 
80
80
  export { AXMWorkflowConfiguratorWidgetColumnComponent };
81
- //# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs.map
81
+ //# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-DV8K0otJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator-widget-column.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { ChangeDetectionStrategy, Component, effect, inject, signal } from '@angular/core';\nimport type { AXMWorkflowManagementWorkflowDefinitionEntityModel } from '@acorex-platform/module-workflow-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';\nimport type { WorkflowConfiguratorValue } from './workflow-configurator.types';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-workflow-configurator-widget-column',\n template: `\n @if (displayTitle()) {\n <i class=\"fa-light fa-diagram-project fa-fw\"></i>&nbsp;\n <span [title]=\"displayTitle()\" class=\"text-xs font-medium\">{{ displayTitle() }}</span>\n } @else if (workflowName()) {\n <span [title]=\"workflowName()\" class=\"text-xs font-medium\">{{ workflowName() }}</span>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMWorkflowConfiguratorWidgetColumnComponent extends AXPColumnWidgetComponent<WorkflowConfiguratorValue> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- State Signals ----\n\n protected displayTitle = signal('');\n\n protected workflowName = signal('');\n\n //#endregion\n\n //#region ---- Effects ----\n\n constructor() {\n super();\n effect(() => {\n const config = this.rawValue as WorkflowConfiguratorValue | undefined;\n const name = config?.workflowName?.trim() ?? '';\n this.workflowName.set(name);\n\n const definitionId = config?.workflowDefinitionId?.trim() ?? '';\n if (!definitionId) {\n this.displayTitle.set(name);\n return;\n }\n\n void this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .byKey(definitionId)\n .then((row) => {\n const entity = row as AXMWorkflowManagementWorkflowDefinitionEntityModel;\n const title = this.translation.resolve(entity.title).trim();\n this.displayTitle.set(title || name);\n })\n .catch(() => {\n this.displayTitle.set(name);\n });\n });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAUA;AAEA;AAkBM,MAAO,4CAA6C,SAAQ,wBAAmD,CAAA;;;AAkBnH,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAhBQ,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;;;QAMjD,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;QAEzB,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;QAQjC,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,QAAiD;YACrE,MAAM,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE;AAC/C,YAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;YAE3B,MAAM,YAAY,GAAG,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE;YAC/D,IAAI,CAAC,YAAY,EAAE;AACjB,gBAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IA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A,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yCAAyC;AACnD,oBAAA,QAAQ,EAAE;;;;;;;;;AAST,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;"}
1
+ {"version":3,"file":"acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-DV8K0otJ.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator-widget-column.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { ChangeDetectionStrategy, Component, effect, inject, signal } from '@angular/core';\nimport type { AXMWorkflowManagementWorkflowDefinitionEntityModel } from '@acorex-platform/module-workflow-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';\nimport type { WorkflowConfiguratorValue } from './workflow-configurator.types';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-workflow-configurator-widget-column',\n template: `\n @if (displayTitle()) {\n <i class=\"fa-light fa-diagram-project fa-fw\"></i>&nbsp;\n <span [title]=\"displayTitle()\" class=\"text-xs font-medium\">{{ displayTitle() }}</span>\n } @else if (workflowName()) {\n <span [title]=\"workflowName()\" class=\"text-xs font-medium\">{{ workflowName() }}</span>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMWorkflowConfiguratorWidgetColumnComponent extends AXPColumnWidgetComponent<WorkflowConfiguratorValue> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- State Signals ----\n\n protected displayTitle = signal('');\n\n protected workflowName = signal('');\n\n //#endregion\n\n //#region ---- Effects ----\n\n constructor() {\n super();\n effect(() => {\n const config = this.rawValue as WorkflowConfiguratorValue | undefined;\n const name = config?.workflowName?.trim() ?? '';\n this.workflowName.set(name);\n\n const definitionId = config?.workflowDefinitionId?.trim() ?? '';\n if (!definitionId) {\n this.displayTitle.set(name);\n return;\n }\n\n void this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .byKey(definitionId)\n .then((row) => {\n const entity = row as AXMWorkflowManagementWorkflowDefinitionEntityModel;\n const title = this.translation.resolve(entity.title).trim();\n this.displayTitle.set(title || name);\n })\n .catch(() => {\n this.displayTitle.set(name);\n });\n });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAUA;AAEA;AAkBM,MAAO,4CAA6C,SAAQ,wBAAmD,CAAA;;;AAkBnH,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAhBQ,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;;;QAMjD,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;QAEzB,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;QAQjC,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,QAAiD;YACrE,MAAM,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE;AAC/C,YAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;YAE3B,MAAM,YAAY,GAAG,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE;YAC/D,IAAI,CAAC,YAAY,EAAE;AACjB,gBA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AAA,EAAA,CAAA;kBAhBxD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yCAAyC;AACnD,oBAAA,QAAQ,EAAE;;;;;;;;;AAST,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;"}
@@ -374,7 +374,7 @@ class AXMWorkflowConfiguratorComponent {
374
374
  [readonly]="readonly()"
375
375
  [items]="configuratorItems()"
376
376
  />
377
- `, isInline: true, styles: [":host([readonly]){pointer-events:none;opacity:.7}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXPItemConfiguratorComponent, selector: "axp-item-configurator", inputs: ["selectedItemId", "values", "nodeFields", "label", "readonly", "items", "headerActions"], outputs: ["selectedItemIdChange", "valuesChange", "nodeFieldsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
377
+ `, isInline: true, styles: [":host([readonly]){pointer-events:none;opacity:.7}\n/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXPItemConfiguratorComponent, selector: "axp-item-configurator", inputs: ["selectedItemId", "values", "nodeFields", "label", "readonly", "items", "headerActions"], outputs: ["selectedItemIdChange", "valuesChange", "nodeFieldsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
378
378
  }
379
379
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkflowConfiguratorComponent, decorators: [{
380
380
  type: Component,
@@ -389,7 +389,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
389
389
  `, changeDetection: ChangeDetectionStrategy.OnPush, host: {
390
390
  class: 'flex flex-col',
391
391
  '[attr.readonly]': 'readonly() ? "" : null',
392
- }, imports: [AXPItemConfiguratorComponent], styles: [":host([readonly]){pointer-events:none;opacity:.7}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
392
+ }, imports: [AXPItemConfiguratorComponent], styles: [":host([readonly]){pointer-events:none;opacity:.7}\n/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n"] }]
393
393
  }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], templateInputNames: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateInputNames", required: false }] }], catalogScopeFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "catalogScopeFilter", required: false }] }], templateInputFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateInputFilters", required: false }] }], selectedWorkflowIdModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedWorkflowIdModel", required: false }] }, { type: i0.Output, args: ["selectedWorkflowIdModelChange"] }], defaultInputModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultInputModel", required: false }] }, { type: i0.Output, args: ["defaultInputModelChange"] }] } });
394
394
 
395
395
  //#region ---- Imports ----
@@ -535,4 +535,4 @@ function isEmptyWorkflowConfiguratorValue(value) {
535
535
  }
536
536
 
537
537
  export { AXMWorkflowConfiguratorWidgetEditComponent };
538
- //# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-cQXYistV.mjs.map
538
+ //# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-DPMtUBxM.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-cQXYistV.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator.utils.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator.component.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator-widget-edit.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPWidgetProperty, AXPWidgetPropertyGroup } from '@acorex-platform/framework-shared/widget-core';\nimport { type AXPProperty, AXPSystemStatusType } from '@acorex-platform/framework-shared/core';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nimport { mapAXPPropertyToWidgetProperty } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXDataSourceFilterOption } from '@acorex/cdk/common';\n\nimport { castArray, get, isString } from 'lodash';\nimport type {\n WorkflowConfiguratorCatalogScopeFilter,\n WorkflowConfiguratorTemplateInputFilter,\n} from './workflow-configurator.types';\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Workflow inputs normally supplied when a run is started from runtime context, not on the template. */\nexport const WORKFLOW_CONFIGURATOR_RUNTIME_INPUT_NAMES = new Set([\n 'employeeId',\n 'employeeDisplayName',\n 'eventTypeId',\n 'eventTypeTitle',\n 'recordTypeId',\n 'recordTypeTitle',\n 'effectiveDate',\n 'assessmentCaseTitle',\n 'targetEmployeeStatusId',\n]);\n\n//#endregion\n\n//#region ---- Catalog scope matching ----\n\nexport interface WorkflowConfiguratorCatalogScopeRow {\n name?: string;\n catalogScopeKeys?: string[];\n catalogScopes?: Array<{ name?: string }>;\n}\n\n/**\n * Resolves catalog scope keys from persisted row shape (keys or enriched scopes).\n */\nexport function resolveWorkflowCatalogScopeKeys(row: WorkflowConfiguratorCatalogScopeRow): string[] {\n const keys = new Set<string>();\n\n for (const key of row.catalogScopeKeys ?? []) {\n if (isString(key) && key.trim()) {\n keys.add(key.trim());\n }\n }\n\n for (const scope of row.catalogScopes ?? []) {\n const name = scope?.name?.trim();\n if (name) {\n keys.add(name);\n }\n }\n\n return [...keys];\n}\n\n/**\n * Builds a workflow list filter from registered scope key names.\n */\nexport function workflowConfiguratorCatalogScopeFilterFromKeys(\n catalogScopeKeys: string | string[] | undefined,\n): WorkflowConfiguratorCatalogScopeFilter | undefined {\n const anyOf = castArray(catalogScopeKeys ?? [])\n .filter((k) => isString(k) && k.trim().length > 0)\n .map((k) => k.trim());\n\n return anyOf.length > 0 ? { anyOf } : undefined;\n}\n\n/**\n * Query filter for published workflow definitions, optionally restricted by catalog scope keys.\n */\nexport function buildWorkflowConfiguratorListQueryFilter(\n scopeFilter: WorkflowConfiguratorCatalogScopeFilter | undefined,\n): AXDataSourceFilterOption {\n const publishedFilter: AXDataSourceFilterOption = {\n field: 'statusId',\n operator: { type: 'equal' },\n value: AXPSystemStatusType.Published,\n };\n\n const anyOf = scopeFilter?.anyOf?.map((k) => k.trim()).filter(Boolean) ?? [];\n if (anyOf.length === 0) {\n return publishedFilter;\n }\n\n return {\n logic: 'and',\n filters: [\n publishedFilter,\n {\n logic: 'or',\n filters: anyOf.map((scopeKey) => ({\n field: 'catalogScopeKeys',\n operator: { type: 'contains' },\n value: scopeKey,\n })),\n },\n ],\n };\n}\n\n/**\n * Returns true when the row's catalog scope keys satisfy the configurator filter.\n */\nexport function matchesWorkflowConfiguratorCatalogScopeFilter(\n catalogScopeKeys: string[] | undefined,\n filter: WorkflowConfiguratorCatalogScopeFilter | undefined,\n): boolean {\n if (!filter) {\n return true;\n }\n\n const keys = (catalogScopeKeys ?? []).filter((k) => isString(k) && k.trim().length > 0);\n if (filter.keyPrefix?.trim()) {\n const prefix = filter.keyPrefix.trim();\n if (!keys.some((k) => k.startsWith(prefix))) {\n return false;\n }\n }\n\n const anyOf = filter.anyOf?.map((k) => k.trim()).filter(Boolean) ?? [];\n if (anyOf.length > 0 && !anyOf.some((scope) => keys.includes(scope))) {\n return false;\n }\n\n const allOf = filter.allOf?.map((k) => k.trim()).filter(Boolean) ?? [];\n if (allOf.length > 0 && !allOf.every((scope) => keys.includes(scope))) {\n return false;\n }\n\n return true;\n}\n\nfunction mergeTemplateInputCatalogScopeFilter(\n property: AXPProperty,\n templateInputFilters?: Record<string, WorkflowConfiguratorTemplateInputFilter>,\n): AXPProperty {\n const name = property.name?.trim();\n if (!name || !templateInputFilters) {\n return property;\n }\n\n const scopeFilter = templateInputFilters[name]?.catalogScopeKeys;\n if (!scopeFilter) {\n return property;\n }\n\n const values = castArray(scopeFilter).filter((v) => isString(v) && v.trim().length > 0);\n if (values.length === 0) {\n return property;\n }\n\n const iface = property.interface;\n if (!iface?.options) {\n return property;\n }\n\n const existingFilter = get(iface.options, 'filter');\n const scopeConditions = values.map((value) => ({\n field: 'catalogScopeKeys',\n operator: { type: 'contains' as const },\n value,\n }));\n\n const mergedFilter =\n scopeConditions.length === 1\n ? scopeConditions[0]\n : { logic: 'or' as const, filters: scopeConditions };\n\n return {\n ...property,\n interface: {\n ...iface,\n options: {\n ...iface.options,\n filter: existingFilter\n ? { logic: 'and', filters: [existingFilter, mergedFilter] }\n : mergedFilter,\n },\n },\n };\n}\n\n//#endregion\n\n//#region ---- Mapping ----\n\n/**\n * Maps workflow definition `inputs` to property viewer rows for {@link AXPItemConfiguratorComponent}.\n */\nexport function mapWorkflowInputsToWidgetProperties(\n inputs: AXPProperty[] | undefined,\n translation: AXTranslationService,\n templateInputNames?: string[],\n templateInputFilters?: Record<string, WorkflowConfiguratorTemplateInputFilter>,\n): AXPWidgetProperty[] {\n const list = inputs ?? [];\n const allowSet =\n templateInputNames && templateInputNames.length > 0\n ? new Set(templateInputNames)\n : null;\n\n const group: AXPWidgetPropertyGroup = {\n name: 'workflow-template-inputs',\n title: '@workflow-management:workflow-configurator.configure.group-title',\n order: 0,\n };\n\n const filtered = list.filter((property) => {\n const name = property.name?.trim();\n if (!name) {\n return false;\n }\n if (allowSet) {\n return allowSet.has(name);\n }\n return !WORKFLOW_CONFIGURATOR_RUNTIME_INPUT_NAMES.has(name);\n });\n\n return filtered.map((property, index) =>\n mapAXPPropertyToWidgetProperty(\n mergeTemplateInputCatalogScopeFilter(property, templateInputFilters),\n {\n group,\n order: index,\n valuePathPrefix: 'options',\n resolveTitle: (prop) =>\n typeof prop.title === 'string'\n ? prop.title\n : (translation.resolve(prop.title) ?? prop.name),\n resolveDescription: (prop) =>\n prop.description === undefined\n ? undefined\n : typeof prop.description === 'string'\n ? prop.description\n : translation.resolve(prop.description),\n },\n ),\n );\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPItemConfiguratorComponent, ItemConfiguratorListItem } from '@acorex-platform/framework-client/layout/components';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n untracked,\n} from '@angular/core';\nimport { isEqual } from 'lodash';\nimport type { AXMWorkflowManagementWorkflowDefinitionEntityModel } from '@acorex-platform/module-workflow-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';\nimport type {\n WorkflowConfiguratorCatalogScopeFilter,\n WorkflowConfiguratorTemplateInputFilter,\n WorkflowConfiguratorValue,\n} from './workflow-configurator.types';\nimport {\n buildWorkflowConfiguratorListQueryFilter,\n mapWorkflowInputsToWidgetProperties,\n matchesWorkflowConfiguratorCatalogScopeFilter,\n resolveWorkflowCatalogScopeKeys,\n type WorkflowConfiguratorCatalogScopeRow,\n} from './workflow-configurator.utils';\n\n//#endregion\n\n//#region ---- Types ----\n\ntype WorkflowDefinitionListRow = Pick<\n AXMWorkflowManagementWorkflowDefinitionEntityModel,\n 'id' | 'name' | 'title' | 'description' | 'inputs' | 'catalogScopeKeys' | 'catalogScopes'\n>;\n\n//#endregion\n\n//#region ---- Component ----\n\n/**\n * Select a workflow definition and configure template-time inputs via {@link AXPItemConfiguratorComponent}.\n */\n@Component({\n selector: 'axm-workflow-configurator',\n template: `\n <axp-item-configurator\n [(selectedItemId)]=\"selectedWorkflowIdModel\"\n [(values)]=\"defaultInputModel\"\n [label]=\"label()\"\n [readonly]=\"readonly()\"\n [items]=\"configuratorItems()\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'flex flex-col',\n '[attr.readonly]': 'readonly() ? \"\" : null',\n },\n styles: [\n `@reference '@acorex/styles/themes/default.css';\n\n :host([readonly]) {\n pointer-events: none;\n opacity: 0.7;\n }\n `,\n ],\n imports: [AXPItemConfiguratorComponent],\n})\nexport class AXMWorkflowConfiguratorComponent {\n //#region ---- Inputs ----\n\n value = model<WorkflowConfiguratorValue>({\n workflowDefinitionId: '',\n workflowName: '',\n defaultInput: {},\n });\n\n label = input<string>('@workflow-management:workflow-configurator.label');\n\n readonly = input<boolean>(false);\n\n /**\n * When set, only these workflow input names are configurable; otherwise runtime inputs are excluded by default.\n */\n templateInputNames = input<string[] | undefined>(undefined);\n\n /**\n * Limits workflow definitions to rows whose {@link catalogScopeKeys} match (e.g. HR lifecycle).\n */\n catalogScopeFilter = input<WorkflowConfiguratorCatalogScopeFilter | undefined>(undefined);\n\n /**\n * Per template input lookup filters (e.g. `questionnaireId` → HR catalog scopes).\n */\n templateInputFilters = input<Record<string, WorkflowConfiguratorTemplateInputFilter> | undefined>(\n undefined,\n );\n\n //#endregion\n\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Class Properties ----\n\n protected selectedWorkflowIdModel = model<string>('');\n\n protected defaultInputModel = model<Record<string, unknown>>({});\n\n protected workflows = signal<WorkflowDefinitionListRow[]>([]);\n\n protected configuratorItems = computed<ItemConfiguratorListItem[]>(() => {\n const names = this.templateInputNames();\n const inputFilters = this.templateInputFilters();\n return this.workflows().map((row) => ({\n id: row.id,\n title: (row.title ?? row.name) as ItemConfiguratorListItem['title'],\n icon: 'fa-light fa-diagram-project',\n description: row.description as ItemConfiguratorListItem['description'],\n propertyDefinitions: mapWorkflowInputsToWidgetProperties(\n row.inputs,\n this.translation,\n names,\n inputFilters,\n ),\n }));\n });\n\n //#endregion\n\n //#region ---- Lifecycle ----\n\n constructor() {\n effect(() => {\n this.catalogScopeFilter();\n untracked(() => {\n void this.loadWorkflowDefinitions();\n });\n });\n\n /** Sync inner models from bound `value` only (context/discard); never from model edits. */\n effect(() => {\n const v = this.value();\n const id = v?.workflowDefinitionId?.trim() ?? '';\n const defaults = v?.defaultInput ?? {};\n\n untracked(() => {\n if (this.selectedWorkflowIdModel() !== id) {\n this.selectedWorkflowIdModel.set(id);\n }\n if (!isEqual(this.defaultInputModel(), defaults)) {\n this.defaultInputModel.set({ ...defaults });\n }\n });\n });\n\n effect(() => {\n const id = this.selectedWorkflowIdModel();\n const defaults = this.defaultInputModel();\n const row = this.workflows().find((w) => w.id === id);\n const current = untracked(() => this.value());\n\n const next: WorkflowConfiguratorValue = {\n workflowDefinitionId: id,\n workflowName:\n row?.name?.trim() ??\n (current.workflowDefinitionId === id ? (current.workflowName?.trim() ?? '') : ''),\n defaultInput: { ...defaults },\n };\n\n const normalizedCurrent: WorkflowConfiguratorValue = {\n workflowDefinitionId: current.workflowDefinitionId?.trim() ?? '',\n workflowName: current.workflowName?.trim() ?? '',\n defaultInput: current.defaultInput ?? {},\n };\n\n if (!isEqual(next, normalizedCurrent)) {\n untracked(() => this.value.set(next));\n }\n });\n }\n\n //#endregion\n\n //#region ---- Data loading ----\n\n /**\n * List queries may omit heavy fields; template input definitions require full `inputs`.\n */\n private async hydrateWorkflowDefinitionRow(\n row: WorkflowDefinitionListRow,\n ): Promise<WorkflowDefinitionListRow> {\n if ((row.inputs?.length ?? 0) > 0) {\n return row;\n }\n\n const id = row.id?.trim();\n if (!id) {\n return row;\n }\n\n try {\n const full = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .byKey(id)) as WorkflowDefinitionListRow | null;\n\n if (!full?.id) {\n return row;\n }\n\n return {\n ...row,\n ...full,\n inputs: full.inputs ?? row.inputs,\n };\n } catch {\n return row;\n }\n }\n\n private async loadWorkflowDefinitions(): Promise<void> {\n try {\n const scopeFilter = this.catalogScopeFilter();\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .query({\n skip: 0,\n take: 500,\n filter: buildWorkflowConfiguratorListQueryFilter(scopeFilter),\n });\n\n const rows = (page.items ?? []) as WorkflowDefinitionListRow[];\n const pinnedId = this.value()?.workflowDefinitionId?.trim();\n\n const filtered = rows\n .filter((r) => !!r.id?.trim() && !!r.name?.trim())\n .filter((r) => {\n if (!scopeFilter) {\n return true;\n }\n if (pinnedId && r.id === pinnedId) {\n return true;\n }\n const keys = resolveWorkflowCatalogScopeKeys(r as WorkflowConfiguratorCatalogScopeRow);\n return matchesWorkflowConfiguratorCatalogScopeFilter(keys, scopeFilter);\n })\n .sort((a, b) => {\n const ta = this.translation.resolve(a.title).trim() || a.name;\n const tb = this.translation.resolve(b.title).trim() || b.name;\n return ta.localeCompare(tb, this.translation.getActiveLang(), { sensitivity: 'base' });\n });\n\n const hydrated = await Promise.all(filtered.map((row) => this.hydrateWorkflowDefinitionRow(row)));\n\n if (pinnedId && !hydrated.some((r) => r.id === pinnedId)) {\n try {\n const pinned = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .byKey(pinnedId)) as WorkflowDefinitionListRow | null;\n if (pinned?.id) {\n hydrated.unshift(await this.hydrateWorkflowDefinitionRow(pinned));\n }\n } catch {\n /* keep list as filtered */\n }\n }\n\n this.workflows.set(hydrated);\n } catch {\n this.workflows.set([]);\n }\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { isFormValueEqual } from '@acorex-platform/framework-shared/core';\nimport { ChangeDetectionStrategy, Component, computed, effect, model, signal, untracked } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { AXMWorkflowConfiguratorComponent } from './workflow-configurator.component';\nimport type {\n WorkflowConfiguratorCatalogScopeFilter,\n WorkflowConfiguratorTemplateInputFilter,\n WorkflowConfiguratorValue,\n} from './workflow-configurator.types';\nimport { workflowConfiguratorCatalogScopeFilterFromKeys } from './workflow-configurator.utils';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-workflow-configurator-widget-edit',\n template: `\n @if (isInitialized()) {\n <axm-workflow-configurator\n [(value)]=\"valueModel\"\n [label]=\"label()\"\n [readonly]=\"readonly()\"\n [templateInputNames]=\"templateInputNames()\"\n [catalogScopeFilter]=\"catalogScopeFilter()\"\n [templateInputFilters]=\"templateInputFilters()\"\n />\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXMWorkflowConfiguratorComponent],\n})\nexport class AXMWorkflowConfiguratorWidgetEditComponent extends AXPValueWidgetComponent<WorkflowConfiguratorValue> {\n //#region ---- Computed Properties ----\n\n protected readonly readonly = computed<boolean>(() => (this.options()['readonly'] as boolean) ?? false);\n\n protected label = computed<string>(\n () => (this.options()['label'] as string) || '@workflow-management:workflow-configurator.label',\n );\n\n protected templateInputNames = computed<string[] | undefined>(() => {\n const raw = this.options()['templateInputNames'];\n return Array.isArray(raw) ? (raw as string[]) : undefined;\n });\n\n protected catalogScopeFilter = computed<WorkflowConfiguratorCatalogScopeFilter | undefined>(() => {\n const fromKeys = workflowConfiguratorCatalogScopeFilterFromKeys(\n this.options()['catalogScopeKeys'] as string | string[] | undefined,\n );\n if (fromKeys) {\n return fromKeys;\n }\n\n const raw = this.options()['catalogScopeFilter'];\n return raw && typeof raw === 'object' ? (raw as WorkflowConfiguratorCatalogScopeFilter) : undefined;\n });\n\n protected templateInputFilters = computed<\n Record<string, WorkflowConfiguratorTemplateInputFilter> | undefined\n >(() => {\n const raw = this.options()['templateInputFilters'];\n return raw && typeof raw === 'object'\n ? (raw as Record<string, WorkflowConfiguratorTemplateInputFilter>)\n : undefined;\n });\n\n //#endregion\n\n //#region ---- State Signals ----\n\n protected isInitialized = signal(false);\n\n //#endregion\n\n //#region ---- Models ----\n\n protected valueModel = model<WorkflowConfiguratorValue>({\n workflowDefinitionId: '',\n workflowName: '',\n defaultInput: {},\n });\n\n //#endregion\n\n //#region ---- Effects ----\n\n private syncValueToConfigurator = effect(() => {\n const value = this.getValue();\n\n const normalized = normalizeWorkflowConfiguratorValue(value);\n const currentModel = untracked(() => this.valueModel());\n\n if (!isEqual(normalized, currentModel)) {\n untracked(() => {\n this.valueModel.set(normalized);\n });\n }\n\n untracked(() => {\n if (!this.isInitialized()) {\n this.isInitialized.set(true);\n }\n });\n });\n\n private syncConfiguratorToValue = effect(() => {\n const modelValue = this.valueModel();\n\n if (!untracked(() => this.isInitialized())) {\n return;\n }\n\n const normalized = normalizeWorkflowConfiguratorValue(modelValue);\n const payload = isEmptyWorkflowConfiguratorValue(normalized)\n ? null\n : {\n workflowDefinitionId: normalized.workflowDefinitionId.trim(),\n workflowName: normalized.workflowName.trim(),\n defaultInput: cloneDeep(normalized.defaultInput ?? {}),\n };\n\n const currentValue = untracked(() => this.getValue());\n if (!isFormValueEqual(payload, currentValue)) {\n untracked(() => {\n this.setValue(payload);\n });\n }\n });\n\n //#endregion\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction normalizeWorkflowConfiguratorValue(value: unknown): WorkflowConfiguratorValue {\n if (value && typeof value === 'object' && 'workflowDefinitionId' in value) {\n const v = value as WorkflowConfiguratorValue;\n return {\n workflowDefinitionId: v.workflowDefinitionId ?? '',\n workflowName: v.workflowName ?? '',\n defaultInput: v.defaultInput ?? {},\n };\n }\n\n return { workflowDefinitionId: '', workflowName: '', defaultInput: {} };\n}\n\nfunction isEmptyWorkflowConfiguratorValue(value: WorkflowConfiguratorValue): boolean {\n const id = value.workflowDefinitionId?.trim() ?? '';\n const name = value.workflowName?.trim() ?? '';\n const defaults = value.defaultInput ?? {};\n const hasDefaults = Object.keys(defaults).some((key) => {\n const entry = defaults[key];\n return entry !== null && entry !== undefined && entry !== '';\n });\n return !id && !name && !hasDefaults;\n}\n\n//#end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,EAAE,GAAG,KAAK,CAAC,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE;IACnD,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE;AAC7C,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,IAAI,EAAE;AACzC,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAI;AACrD,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC;QAC3B,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;AAC9D,IAAA,CAAC,CAAC;IACF,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW;AACrC;;"}
1
+ {"version":3,"file":"acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-DPMtUBxM.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator.utils.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator.component.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator-widget-edit.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPWidgetProperty, AXPWidgetPropertyGroup } from '@acorex-platform/framework-shared/widget-core';\nimport { type AXPProperty, AXPSystemStatusType } from '@acorex-platform/framework-shared/core';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nimport { mapAXPPropertyToWidgetProperty } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXDataSourceFilterOption } from '@acorex/cdk/common';\n\nimport { castArray, get, isString } from 'lodash';\nimport type {\n WorkflowConfiguratorCatalogScopeFilter,\n WorkflowConfiguratorTemplateInputFilter,\n} from './workflow-configurator.types';\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Workflow inputs normally supplied when a run is started from runtime context, not on the template. */\nexport const WORKFLOW_CONFIGURATOR_RUNTIME_INPUT_NAMES = new Set([\n 'employeeId',\n 'employeeDisplayName',\n 'eventTypeId',\n 'eventTypeTitle',\n 'recordTypeId',\n 'recordTypeTitle',\n 'effectiveDate',\n 'assessmentCaseTitle',\n 'targetEmployeeStatusId',\n]);\n\n//#endregion\n\n//#region ---- Catalog scope matching ----\n\nexport interface WorkflowConfiguratorCatalogScopeRow {\n name?: string;\n catalogScopeKeys?: string[];\n catalogScopes?: Array<{ name?: string }>;\n}\n\n/**\n * Resolves catalog scope keys from persisted row shape (keys or enriched scopes).\n */\nexport function resolveWorkflowCatalogScopeKeys(row: WorkflowConfiguratorCatalogScopeRow): string[] {\n const keys = new Set<string>();\n\n for (const key of row.catalogScopeKeys ?? []) {\n if (isString(key) && key.trim()) {\n keys.add(key.trim());\n }\n }\n\n for (const scope of row.catalogScopes ?? []) {\n const name = scope?.name?.trim();\n if (name) {\n keys.add(name);\n }\n }\n\n return [...keys];\n}\n\n/**\n * Builds a workflow list filter from registered scope key names.\n */\nexport function workflowConfiguratorCatalogScopeFilterFromKeys(\n catalogScopeKeys: string | string[] | undefined,\n): WorkflowConfiguratorCatalogScopeFilter | undefined {\n const anyOf = castArray(catalogScopeKeys ?? [])\n .filter((k) => isString(k) && k.trim().length > 0)\n .map((k) => k.trim());\n\n return anyOf.length > 0 ? { anyOf } : undefined;\n}\n\n/**\n * Query filter for published workflow definitions, optionally restricted by catalog scope keys.\n */\nexport function buildWorkflowConfiguratorListQueryFilter(\n scopeFilter: WorkflowConfiguratorCatalogScopeFilter | undefined,\n): AXDataSourceFilterOption {\n const publishedFilter: AXDataSourceFilterOption = {\n field: 'statusId',\n operator: { type: 'equal' },\n value: AXPSystemStatusType.Published,\n };\n\n const anyOf = scopeFilter?.anyOf?.map((k) => k.trim()).filter(Boolean) ?? [];\n if (anyOf.length === 0) {\n return publishedFilter;\n }\n\n return {\n logic: 'and',\n filters: [\n publishedFilter,\n {\n logic: 'or',\n filters: anyOf.map((scopeKey) => ({\n field: 'catalogScopeKeys',\n operator: { type: 'contains' },\n value: scopeKey,\n })),\n },\n ],\n };\n}\n\n/**\n * Returns true when the row's catalog scope keys satisfy the configurator filter.\n */\nexport function matchesWorkflowConfiguratorCatalogScopeFilter(\n catalogScopeKeys: string[] | undefined,\n filter: WorkflowConfiguratorCatalogScopeFilter | undefined,\n): boolean {\n if (!filter) {\n return true;\n }\n\n const keys = (catalogScopeKeys ?? []).filter((k) => isString(k) && k.trim().length > 0);\n if (filter.keyPrefix?.trim()) {\n const prefix = filter.keyPrefix.trim();\n if (!keys.some((k) => k.startsWith(prefix))) {\n return false;\n }\n }\n\n const anyOf = filter.anyOf?.map((k) => k.trim()).filter(Boolean) ?? [];\n if (anyOf.length > 0 && !anyOf.some((scope) => keys.includes(scope))) {\n return false;\n }\n\n const allOf = filter.allOf?.map((k) => k.trim()).filter(Boolean) ?? [];\n if (allOf.length > 0 && !allOf.every((scope) => keys.includes(scope))) {\n return false;\n }\n\n return true;\n}\n\nfunction mergeTemplateInputCatalogScopeFilter(\n property: AXPProperty,\n templateInputFilters?: Record<string, WorkflowConfiguratorTemplateInputFilter>,\n): AXPProperty {\n const name = property.name?.trim();\n if (!name || !templateInputFilters) {\n return property;\n }\n\n const scopeFilter = templateInputFilters[name]?.catalogScopeKeys;\n if (!scopeFilter) {\n return property;\n }\n\n const values = castArray(scopeFilter).filter((v) => isString(v) && v.trim().length > 0);\n if (values.length === 0) {\n return property;\n }\n\n const iface = property.interface;\n if (!iface?.options) {\n return property;\n }\n\n const existingFilter = get(iface.options, 'filter');\n const scopeConditions = values.map((value) => ({\n field: 'catalogScopeKeys',\n operator: { type: 'contains' as const },\n value,\n }));\n\n const mergedFilter =\n scopeConditions.length === 1\n ? scopeConditions[0]\n : { logic: 'or' as const, filters: scopeConditions };\n\n return {\n ...property,\n interface: {\n ...iface,\n options: {\n ...iface.options,\n filter: existingFilter\n ? { logic: 'and', filters: [existingFilter, mergedFilter] }\n : mergedFilter,\n },\n },\n };\n}\n\n//#endregion\n\n//#region ---- Mapping ----\n\n/**\n * Maps workflow definition `inputs` to property viewer rows for {@link AXPItemConfiguratorComponent}.\n */\nexport function mapWorkflowInputsToWidgetProperties(\n inputs: AXPProperty[] | undefined,\n translation: AXTranslationService,\n templateInputNames?: string[],\n templateInputFilters?: Record<string, WorkflowConfiguratorTemplateInputFilter>,\n): AXPWidgetProperty[] {\n const list = inputs ?? [];\n const allowSet =\n templateInputNames && templateInputNames.length > 0\n ? new Set(templateInputNames)\n : null;\n\n const group: AXPWidgetPropertyGroup = {\n name: 'workflow-template-inputs',\n title: '@workflow-management:workflow-configurator.configure.group-title',\n order: 0,\n };\n\n const filtered = list.filter((property) => {\n const name = property.name?.trim();\n if (!name) {\n return false;\n }\n if (allowSet) {\n return allowSet.has(name);\n }\n return !WORKFLOW_CONFIGURATOR_RUNTIME_INPUT_NAMES.has(name);\n });\n\n return filtered.map((property, index) =>\n mapAXPPropertyToWidgetProperty(\n mergeTemplateInputCatalogScopeFilter(property, templateInputFilters),\n {\n group,\n order: index,\n valuePathPrefix: 'options',\n resolveTitle: (prop) =>\n typeof prop.title === 'string'\n ? prop.title\n : (translation.resolve(prop.title) ?? prop.name),\n resolveDescription: (prop) =>\n prop.description === undefined\n ? undefined\n : typeof prop.description === 'string'\n ? prop.description\n : translation.resolve(prop.description),\n },\n ),\n );\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPItemConfiguratorComponent, ItemConfiguratorListItem } from '@acorex-platform/framework-client/layout/components';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n untracked,\n} from '@angular/core';\nimport { isEqual } from 'lodash';\nimport type { AXMWorkflowManagementWorkflowDefinitionEntityModel } from '@acorex-platform/module-workflow-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';\nimport type {\n WorkflowConfiguratorCatalogScopeFilter,\n WorkflowConfiguratorTemplateInputFilter,\n WorkflowConfiguratorValue,\n} from './workflow-configurator.types';\nimport {\n buildWorkflowConfiguratorListQueryFilter,\n mapWorkflowInputsToWidgetProperties,\n matchesWorkflowConfiguratorCatalogScopeFilter,\n resolveWorkflowCatalogScopeKeys,\n type WorkflowConfiguratorCatalogScopeRow,\n} from './workflow-configurator.utils';\n\n//#endregion\n\n//#region ---- Types ----\n\ntype WorkflowDefinitionListRow = Pick<\n AXMWorkflowManagementWorkflowDefinitionEntityModel,\n 'id' | 'name' | 'title' | 'description' | 'inputs' | 'catalogScopeKeys' | 'catalogScopes'\n>;\n\n//#endregion\n\n//#region ---- Component ----\n\n/**\n * Select a workflow definition and configure template-time inputs via {@link AXPItemConfiguratorComponent}.\n */\n@Component({\n selector: 'axm-workflow-configurator',\n template: `\n <axp-item-configurator\n [(selectedItemId)]=\"selectedWorkflowIdModel\"\n [(values)]=\"defaultInputModel\"\n [label]=\"label()\"\n [readonly]=\"readonly()\"\n [items]=\"configuratorItems()\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'flex flex-col',\n '[attr.readonly]': 'readonly() ? \"\" : null',\n },\n styles: [\n `@reference '@acorex/styles/themes/default.css';\n\n :host([readonly]) {\n pointer-events: none;\n opacity: 0.7;\n }\n `,\n ],\n imports: [AXPItemConfiguratorComponent],\n})\nexport class AXMWorkflowConfiguratorComponent {\n //#region ---- Inputs ----\n\n value = model<WorkflowConfiguratorValue>({\n workflowDefinitionId: '',\n workflowName: '',\n defaultInput: {},\n });\n\n label = input<string>('@workflow-management:workflow-configurator.label');\n\n readonly = input<boolean>(false);\n\n /**\n * When set, only these workflow input names are configurable; otherwise runtime inputs are excluded by default.\n */\n templateInputNames = input<string[] | undefined>(undefined);\n\n /**\n * Limits workflow definitions to rows whose {@link catalogScopeKeys} match (e.g. HR lifecycle).\n */\n catalogScopeFilter = input<WorkflowConfiguratorCatalogScopeFilter | undefined>(undefined);\n\n /**\n * Per template input lookup filters (e.g. `questionnaireId` → HR catalog scopes).\n */\n templateInputFilters = input<Record<string, WorkflowConfiguratorTemplateInputFilter> | undefined>(\n undefined,\n );\n\n //#endregion\n\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Class Properties ----\n\n protected selectedWorkflowIdModel = model<string>('');\n\n protected defaultInputModel = model<Record<string, unknown>>({});\n\n protected workflows = signal<WorkflowDefinitionListRow[]>([]);\n\n protected configuratorItems = computed<ItemConfiguratorListItem[]>(() => {\n const names = this.templateInputNames();\n const inputFilters = this.templateInputFilters();\n return this.workflows().map((row) => ({\n id: row.id,\n title: (row.title ?? row.name) as ItemConfiguratorListItem['title'],\n icon: 'fa-light fa-diagram-project',\n description: row.description as ItemConfiguratorListItem['description'],\n propertyDefinitions: mapWorkflowInputsToWidgetProperties(\n row.inputs,\n this.translation,\n names,\n inputFilters,\n ),\n }));\n });\n\n //#endregion\n\n //#region ---- Lifecycle ----\n\n constructor() {\n effect(() => {\n this.catalogScopeFilter();\n untracked(() => {\n void this.loadWorkflowDefinitions();\n });\n });\n\n /** Sync inner models from bound `value` only (context/discard); never from model edits. */\n effect(() => {\n const v = this.value();\n const id = v?.workflowDefinitionId?.trim() ?? '';\n const defaults = v?.defaultInput ?? {};\n\n untracked(() => {\n if (this.selectedWorkflowIdModel() !== id) {\n this.selectedWorkflowIdModel.set(id);\n }\n if (!isEqual(this.defaultInputModel(), defaults)) {\n this.defaultInputModel.set({ ...defaults });\n }\n });\n });\n\n effect(() => {\n const id = this.selectedWorkflowIdModel();\n const defaults = this.defaultInputModel();\n const row = this.workflows().find((w) => w.id === id);\n const current = untracked(() => this.value());\n\n const next: WorkflowConfiguratorValue = {\n workflowDefinitionId: id,\n workflowName:\n row?.name?.trim() ??\n (current.workflowDefinitionId === id ? (current.workflowName?.trim() ?? '') : ''),\n defaultInput: { ...defaults },\n };\n\n const normalizedCurrent: WorkflowConfiguratorValue = {\n workflowDefinitionId: current.workflowDefinitionId?.trim() ?? '',\n workflowName: current.workflowName?.trim() ?? '',\n defaultInput: current.defaultInput ?? {},\n };\n\n if (!isEqual(next, normalizedCurrent)) {\n untracked(() => this.value.set(next));\n }\n });\n }\n\n //#endregion\n\n //#region ---- Data loading ----\n\n /**\n * List queries may omit heavy fields; template input definitions require full `inputs`.\n */\n private async hydrateWorkflowDefinitionRow(\n row: WorkflowDefinitionListRow,\n ): Promise<WorkflowDefinitionListRow> {\n if ((row.inputs?.length ?? 0) > 0) {\n return row;\n }\n\n const id = row.id?.trim();\n if (!id) {\n return row;\n }\n\n try {\n const full = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .byKey(id)) as WorkflowDefinitionListRow | null;\n\n if (!full?.id) {\n return row;\n }\n\n return {\n ...row,\n ...full,\n inputs: full.inputs ?? row.inputs,\n };\n } catch {\n return row;\n }\n }\n\n private async loadWorkflowDefinitions(): Promise<void> {\n try {\n const scopeFilter = this.catalogScopeFilter();\n const page = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .query({\n skip: 0,\n take: 500,\n filter: buildWorkflowConfiguratorListQueryFilter(scopeFilter),\n });\n\n const rows = (page.items ?? []) as WorkflowDefinitionListRow[];\n const pinnedId = this.value()?.workflowDefinitionId?.trim();\n\n const filtered = rows\n .filter((r) => !!r.id?.trim() && !!r.name?.trim())\n .filter((r) => {\n if (!scopeFilter) {\n return true;\n }\n if (pinnedId && r.id === pinnedId) {\n return true;\n }\n const keys = resolveWorkflowCatalogScopeKeys(r as WorkflowConfiguratorCatalogScopeRow);\n return matchesWorkflowConfiguratorCatalogScopeFilter(keys, scopeFilter);\n })\n .sort((a, b) => {\n const ta = this.translation.resolve(a.title).trim() || a.name;\n const tb = this.translation.resolve(b.title).trim() || b.name;\n return ta.localeCompare(tb, this.translation.getActiveLang(), { sensitivity: 'base' });\n });\n\n const hydrated = await Promise.all(filtered.map((row) => this.hydrateWorkflowDefinitionRow(row)));\n\n if (pinnedId && !hydrated.some((r) => r.id === pinnedId)) {\n try {\n const pinned = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .byKey(pinnedId)) as WorkflowDefinitionListRow | null;\n if (pinned?.id) {\n hydrated.unshift(await this.hydrateWorkflowDefinitionRow(pinned));\n }\n } catch {\n /* keep list as filtered */\n }\n }\n\n this.workflows.set(hydrated);\n } catch {\n this.workflows.set([]);\n }\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { isFormValueEqual } from '@acorex-platform/framework-shared/core';\nimport { ChangeDetectionStrategy, Component, computed, effect, model, signal, untracked } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { AXMWorkflowConfiguratorComponent } from './workflow-configurator.component';\nimport type {\n WorkflowConfiguratorCatalogScopeFilter,\n WorkflowConfiguratorTemplateInputFilter,\n WorkflowConfiguratorValue,\n} from './workflow-configurator.types';\nimport { workflowConfiguratorCatalogScopeFilterFromKeys } from './workflow-configurator.utils';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-workflow-configurator-widget-edit',\n template: `\n @if (isInitialized()) {\n <axm-workflow-configurator\n [(value)]=\"valueModel\"\n [label]=\"label()\"\n [readonly]=\"readonly()\"\n [templateInputNames]=\"templateInputNames()\"\n [catalogScopeFilter]=\"catalogScopeFilter()\"\n [templateInputFilters]=\"templateInputFilters()\"\n />\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXMWorkflowConfiguratorComponent],\n})\nexport class AXMWorkflowConfiguratorWidgetEditComponent extends AXPValueWidgetComponent<WorkflowConfiguratorValue> {\n //#region ---- Computed Properties ----\n\n protected readonly readonly = computed<boolean>(() => (this.options()['readonly'] as boolean) ?? false);\n\n protected label = computed<string>(\n () => (this.options()['label'] as string) || '@workflow-management:workflow-configurator.label',\n );\n\n protected templateInputNames = computed<string[] | undefined>(() => {\n const raw = this.options()['templateInputNames'];\n return Array.isArray(raw) ? (raw as string[]) : undefined;\n });\n\n protected catalogScopeFilter = computed<WorkflowConfiguratorCatalogScopeFilter | undefined>(() => {\n const fromKeys = workflowConfiguratorCatalogScopeFilterFromKeys(\n this.options()['catalogScopeKeys'] as string | string[] | undefined,\n );\n if (fromKeys) {\n return fromKeys;\n }\n\n const raw = this.options()['catalogScopeFilter'];\n return raw && typeof raw === 'object' ? (raw as WorkflowConfiguratorCatalogScopeFilter) : undefined;\n });\n\n protected templateInputFilters = computed<\n Record<string, WorkflowConfiguratorTemplateInputFilter> | undefined\n >(() => {\n const raw = this.options()['templateInputFilters'];\n return raw && typeof raw === 'object'\n ? (raw as Record<string, WorkflowConfiguratorTemplateInputFilter>)\n : undefined;\n });\n\n //#endregion\n\n //#region ---- State Signals ----\n\n protected isInitialized = signal(false);\n\n //#endregion\n\n //#region ---- Models ----\n\n protected valueModel = model<WorkflowConfiguratorValue>({\n workflowDefinitionId: '',\n workflowName: '',\n defaultInput: {},\n });\n\n //#endregion\n\n //#region ---- Effects ----\n\n private syncValueToConfigurator = effect(() => {\n const value = this.getValue();\n\n const normalized = normalizeWorkflowConfiguratorValue(value);\n const currentModel = untracked(() => this.valueModel());\n\n if (!isEqual(normalized, currentModel)) {\n untracked(() => {\n this.valueModel.set(normalized);\n });\n }\n\n untracked(() => {\n if (!this.isInitialized()) {\n this.isInitialized.set(true);\n }\n });\n });\n\n private syncConfiguratorToValue = effect(() => {\n const modelValue = this.valueModel();\n\n if (!untracked(() => this.isInitialized())) {\n return;\n }\n\n const normalized = normalizeWorkflowConfiguratorValue(modelValue);\n const payload = isEmptyWorkflowConfiguratorValue(normalized)\n ? null\n : {\n workflowDefinitionId: normalized.workflowDefinitionId.trim(),\n workflowName: normalized.workflowName.trim(),\n defaultInput: cloneDeep(normalized.defaultInput ?? {}),\n };\n\n const currentValue = untracked(() => this.getValue());\n if (!isFormValueEqual(payload, currentValue)) {\n untracked(() => {\n this.setValue(payload);\n });\n }\n });\n\n //#endregion\n}\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction normalizeWorkflowConfiguratorValue(value: unknown): WorkflowConfiguratorValue {\n if (value && typeof value === 'object' && 'workflowDefinitionId' in value) {\n const v = value as WorkflowConfiguratorValue;\n return {\n workflowDefinitionId: v.workflowDefinitionId ?? '',\n workflowName: v.workflowName ?? '',\n defaultInput: v.defaultInput ?? {},\n };\n }\n\n return { workflowDefinitionId: '', workflowName: '', defaultInput: {} };\n}\n\nfunction isEmptyWorkflowConfiguratorValue(value: WorkflowConfiguratorValue): boolean {\n const id = value.workflowDefinitionId?.trim() ?? '';\n const name = value.workflowName?.trim() ?? '';\n const defaults = value.defaultInput ?? {};\n const hasDefaults = Object.keys(defaults).some((key) => {\n const entry = defaults[key];\n return entry !== null && entry !== undefined && entry !== '';\n });\n return !id && !name && !hasDefaults;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAeA;AAEA;AAEA;AACO,MAAM,yCAAyC,GAAG,IAAI,GAAG,CAAC;IAC/D,YAAY;IACZ,qBAAqB;IACrB,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,qBAAqB;IACrB,wBAAwB;AACzB,CAAA,CAAC;AAYF;;AAEG;AACG,SAAU,+BAA+B,CAAC,GAAwC,EAAA;AACtF,IAAA,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU;IAE9B,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,gBAAgB,IAAI,EAAE,EAAE;QAC5C,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE;YAC/B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACtB;IACF;IAEA,KAAK,MAAM,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