@acorex/platform 21.0.0-next.37 → 21.0.0-next.40
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.
- package/fesm2022/acorex-platform-common.mjs +25 -3
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +18 -172
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +3 -0
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +29 -13
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +62 -40
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +209 -62
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +1072 -358
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +171 -86
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +170 -63
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs → acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs} +5 -60
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +720 -415
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +120 -9
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs → acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs → acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-AOrcgjDF.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs → acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +26 -14
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs → acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs} +2 -2
- package/fesm2022/acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs +94 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs} +38 -16
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +183 -84
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +75 -15
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acorex-platform-common.d.ts +11 -6
- package/types/acorex-platform-core.d.ts +67 -101
- package/types/acorex-platform-domain.d.ts +28 -2
- package/types/acorex-platform-layout-builder.d.ts +41 -28
- package/types/acorex-platform-layout-components.d.ts +4 -3
- package/types/acorex-platform-layout-designer.d.ts +56 -16
- package/types/acorex-platform-layout-entity.d.ts +180 -40
- package/types/acorex-platform-layout-views.d.ts +31 -29
- package/types/acorex-platform-layout-widget-core.d.ts +81 -52
- package/types/acorex-platform-layout-widgets.d.ts +42 -16
- package/types/acorex-platform-runtime.d.ts +156 -61
- package/types/acorex-platform-themes-default.d.ts +1 -0
- package/types/acorex-platform-workflow.d.ts +64 -52
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs +0 -65
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs.map +0 -1
|
@@ -3,6 +3,7 @@ import { Injectable, inject, InjectionToken, Optional, Inject, NgModule } from '
|
|
|
3
3
|
import { Subject, filter } from 'rxjs';
|
|
4
4
|
import { cloneDeep, get, set } from 'lodash-es';
|
|
5
5
|
import { setSmart, AXPExpressionEvaluatorService, AXPDataGenerator } from '@acorex/platform/core';
|
|
6
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
6
7
|
import { AXPCommandService } from '@acorex/platform/runtime';
|
|
7
8
|
|
|
8
9
|
class AXPWorkflowError extends Error {
|
|
@@ -628,7 +629,7 @@ class AXPActivityDefinitionService {
|
|
|
628
629
|
if (definition && definition.category) {
|
|
629
630
|
// Try to find category by name/id
|
|
630
631
|
const categories = await this.getCategories();
|
|
631
|
-
const found = categories.find(cat => cat.id === definition.category
|
|
632
|
+
const found = categories.find((cat) => cat.id === definition.category);
|
|
632
633
|
if (found) {
|
|
633
634
|
return found.id;
|
|
634
635
|
}
|
|
@@ -871,6 +872,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
871
872
|
*/
|
|
872
873
|
const AXP_WORKFLOW_ENGINE = new InjectionToken('AXP_WORKFLOW_ENGINE');
|
|
873
874
|
|
|
875
|
+
/**
|
|
876
|
+
* Activity types that use the task board (suspend until user acts via inbox), not inline interactive execution.
|
|
877
|
+
*/
|
|
878
|
+
const AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES = [
|
|
879
|
+
'workflow-activity:human-task',
|
|
880
|
+
'workflow-activity:cartable',
|
|
881
|
+
];
|
|
882
|
+
function axpIsWorkflowTaskBoardActivityType(activityType) {
|
|
883
|
+
return !!activityType && AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES.includes(activityType);
|
|
884
|
+
}
|
|
885
|
+
|
|
874
886
|
//#endregion
|
|
875
887
|
/**
|
|
876
888
|
* Workflow Expression Scope Service
|
|
@@ -1114,6 +1126,7 @@ class ActivityExecutor {
|
|
|
1114
1126
|
this.commandService = inject(AXPCommandService);
|
|
1115
1127
|
this.expressionEvaluator = inject(AXPExpressionEvaluatorService);
|
|
1116
1128
|
this.expressionScopeService = inject(WorkflowExpressionScopeService);
|
|
1129
|
+
this.translateService = inject(AXTranslationService);
|
|
1117
1130
|
}
|
|
1118
1131
|
//#endregion
|
|
1119
1132
|
//#region ---- Public Methods ----
|
|
@@ -1173,7 +1186,7 @@ class ActivityExecutor {
|
|
|
1173
1186
|
if (!result.success) {
|
|
1174
1187
|
return {
|
|
1175
1188
|
output: {
|
|
1176
|
-
error: result.message?.text,
|
|
1189
|
+
error: await this.resolveCommandMessageTextForError(result.message?.text),
|
|
1177
1190
|
},
|
|
1178
1191
|
outcome: 'Failed',
|
|
1179
1192
|
};
|
|
@@ -1211,6 +1224,18 @@ class ActivityExecutor {
|
|
|
1211
1224
|
};
|
|
1212
1225
|
}
|
|
1213
1226
|
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Resolves command failure message text for workflow output: `@` keys via translate, MLS maps via resolve.
|
|
1229
|
+
*/
|
|
1230
|
+
async resolveCommandMessageTextForError(value) {
|
|
1231
|
+
if (value == null) {
|
|
1232
|
+
return '';
|
|
1233
|
+
}
|
|
1234
|
+
if (typeof value === 'string') {
|
|
1235
|
+
return value.startsWith('@') ? await this.translateService.translateAsync(value) : value;
|
|
1236
|
+
}
|
|
1237
|
+
return this.translateService.resolve(value);
|
|
1238
|
+
}
|
|
1214
1239
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActivityExecutor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1215
1240
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActivityExecutor, providedIn: 'root' }); }
|
|
1216
1241
|
}
|
|
@@ -1285,9 +1310,9 @@ class AXPWorkflowManager {
|
|
|
1285
1310
|
let iterationCount = 0;
|
|
1286
1311
|
while (currentTask && iterationCount < maxIterations) {
|
|
1287
1312
|
iterationCount++;
|
|
1288
|
-
// Interactive = frontend executionMode and NOT
|
|
1313
|
+
// Interactive = frontend executionMode and NOT task-board activities (human-task, cartable)
|
|
1289
1314
|
const isInteractive = (currentTask.executionMode === 'frontend' || currentTask.executionMode === 'both') &&
|
|
1290
|
-
currentTask.activityType
|
|
1315
|
+
!axpIsWorkflowTaskBoardActivityType(currentTask.activityType);
|
|
1291
1316
|
if (isInteractive) {
|
|
1292
1317
|
// Execute frontend activity
|
|
1293
1318
|
const execResult = await this.activityExecutor.execute(currentTask, currentState, currentActivityOutputs);
|
|
@@ -1325,9 +1350,9 @@ class AXPWorkflowManager {
|
|
|
1325
1350
|
output: completeResponse.output,
|
|
1326
1351
|
};
|
|
1327
1352
|
}
|
|
1328
|
-
// Backend decides: if nextTask is
|
|
1353
|
+
// Backend decides: if nextTask is task-board activity or not frontend, return it (task board or done)
|
|
1329
1354
|
const nextInteractive = (completeResponse.nextTask.executionMode === 'frontend' || completeResponse.nextTask.executionMode === 'both') &&
|
|
1330
|
-
completeResponse.nextTask.activityType
|
|
1355
|
+
!axpIsWorkflowTaskBoardActivityType(completeResponse.nextTask.activityType);
|
|
1331
1356
|
if (!nextInteractive) {
|
|
1332
1357
|
return {
|
|
1333
1358
|
nextTask: completeResponse.nextTask,
|
|
@@ -1338,7 +1363,7 @@ class AXPWorkflowManager {
|
|
|
1338
1363
|
currentTask = completeResponse.nextTask;
|
|
1339
1364
|
}
|
|
1340
1365
|
else {
|
|
1341
|
-
// Not interactive (e.g.
|
|
1366
|
+
// Not interactive (e.g. human-task / cartable) - return as-is for task board
|
|
1342
1367
|
return {
|
|
1343
1368
|
nextTask: currentTask,
|
|
1344
1369
|
state: currentState,
|
|
@@ -1389,13 +1414,13 @@ class AXPWorkflowManager {
|
|
|
1389
1414
|
startNormalizedState.lastUpdated = new Date(startNormalizedState.lastUpdated);
|
|
1390
1415
|
}
|
|
1391
1416
|
this.stateCache.set(response.instanceId, startNormalizedState);
|
|
1392
|
-
// 🎯 Interactive flow: Execute frontend activities that are NOT
|
|
1417
|
+
// 🎯 Interactive flow: Execute frontend activities that are NOT task-board types (those go to task board)
|
|
1393
1418
|
let finalNextTask = response.pendingTask || null;
|
|
1394
1419
|
let finalOutput = startNormalizedState.output;
|
|
1395
1420
|
const pendingTask = response.pendingTask;
|
|
1396
1421
|
if (pendingTask &&
|
|
1397
1422
|
(pendingTask.executionMode === 'frontend' || pendingTask.executionMode === 'both') &&
|
|
1398
|
-
pendingTask.activityType
|
|
1423
|
+
!axpIsWorkflowTaskBoardActivityType(pendingTask.activityType)) {
|
|
1399
1424
|
const interactiveResult = await this.executeInteractiveFlow(response.instanceId, pendingTask, startNormalizedState, response.activityOutputs || response.state.activityOutputs);
|
|
1400
1425
|
finalNextTask = interactiveResult.nextTask;
|
|
1401
1426
|
startNormalizedState = interactiveResult.state;
|
|
@@ -1458,13 +1483,13 @@ class AXPWorkflowManager {
|
|
|
1458
1483
|
if (normalizedState) {
|
|
1459
1484
|
this.stateCache.set(instanceId, normalizedState);
|
|
1460
1485
|
}
|
|
1461
|
-
// 🎯 Interactive flow: Execute frontend activities that are NOT
|
|
1486
|
+
// 🎯 Interactive flow: Execute frontend activities that are NOT task-board types (those go to task board)
|
|
1462
1487
|
let finalNextTask = response.nextTask || null;
|
|
1463
1488
|
let finalOutput = response.output;
|
|
1464
1489
|
const nextTask = response.nextTask;
|
|
1465
1490
|
if (nextTask &&
|
|
1466
1491
|
(nextTask.executionMode === 'frontend' || nextTask.executionMode === 'both') &&
|
|
1467
|
-
nextTask.activityType
|
|
1492
|
+
!axpIsWorkflowTaskBoardActivityType(nextTask.activityType)) {
|
|
1468
1493
|
const interactiveResult = await this.executeInteractiveFlow(instanceId, nextTask, normalizedState, normalizedState?.activityOutputs);
|
|
1469
1494
|
finalNextTask = interactiveResult.nextTask;
|
|
1470
1495
|
normalizedState = interactiveResult.state;
|
|
@@ -1535,6 +1560,35 @@ class AXPWorkflowManager {
|
|
|
1535
1560
|
return null;
|
|
1536
1561
|
}
|
|
1537
1562
|
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Claim a pooled workflow task (assign current user on the bookmark without advancing the workflow).
|
|
1565
|
+
* Supported only when the injected workflow engine implements {@link AXPWorkflowEngine.claimTask}.
|
|
1566
|
+
*/
|
|
1567
|
+
async claimTask(instanceId, bookmarkId, stepId) {
|
|
1568
|
+
const claim = this.workflowEngine.claimTask?.bind(this.workflowEngine);
|
|
1569
|
+
if (!claim) {
|
|
1570
|
+
return {
|
|
1571
|
+
success: false,
|
|
1572
|
+
instanceId,
|
|
1573
|
+
error: 'Claim task is not supported by this workflow engine',
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
try {
|
|
1577
|
+
const result = await claim({ instanceId, bookmarkId, stepId });
|
|
1578
|
+
return {
|
|
1579
|
+
success: result.success,
|
|
1580
|
+
instanceId,
|
|
1581
|
+
error: result.error,
|
|
1582
|
+
};
|
|
1583
|
+
}
|
|
1584
|
+
catch (error) {
|
|
1585
|
+
return {
|
|
1586
|
+
success: false,
|
|
1587
|
+
instanceId,
|
|
1588
|
+
error: error instanceof Error ? error.message : 'Failed to claim task',
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1538
1592
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1539
1593
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowManager, providedIn: 'root' }); }
|
|
1540
1594
|
}
|
|
@@ -1573,6 +1627,7 @@ class AXPWorkflowLocalEngine {
|
|
|
1573
1627
|
//#region ---- Services & Dependencies ----
|
|
1574
1628
|
this.activityDefinitionService = inject(AXPActivityDefinitionService);
|
|
1575
1629
|
this.workflowProviders = inject(AXP_WORKFLOW_PROVIDER, { optional: true }) || [];
|
|
1630
|
+
this.multiLanguageResolver = inject(AXTranslationService);
|
|
1576
1631
|
//#endregion
|
|
1577
1632
|
//#region ---- Instance Storage ----
|
|
1578
1633
|
/**
|
|
@@ -1693,6 +1748,11 @@ class AXPWorkflowLocalEngine {
|
|
|
1693
1748
|
...(request.userInput || {}),
|
|
1694
1749
|
};
|
|
1695
1750
|
}
|
|
1751
|
+
localState.state.variables = {
|
|
1752
|
+
...localState.state.variables,
|
|
1753
|
+
[`${request.stepId}_outcome`]: outcome,
|
|
1754
|
+
[`${request.stepId}_activityOutput`]: request.userInput || {},
|
|
1755
|
+
};
|
|
1696
1756
|
// Mark activity as completed and continue progression
|
|
1697
1757
|
// Continue progressing workflow steps (skipping backend activities)
|
|
1698
1758
|
const nextTask = await this.executeWorkflowSteps(localState);
|
|
@@ -1766,13 +1826,13 @@ class AXPWorkflowLocalEngine {
|
|
|
1766
1826
|
const connections = graph.connections || [];
|
|
1767
1827
|
// Build activity map
|
|
1768
1828
|
const activityMap = new Map();
|
|
1769
|
-
activities.forEach(activity => {
|
|
1829
|
+
activities.forEach((activity) => {
|
|
1770
1830
|
activityMap.set(activity.id, activity);
|
|
1771
1831
|
});
|
|
1772
1832
|
// Build connection graph
|
|
1773
1833
|
const outgoingConnections = new Map();
|
|
1774
1834
|
const incomingConnections = new Map();
|
|
1775
|
-
connections.forEach(conn => {
|
|
1835
|
+
connections.forEach((conn) => {
|
|
1776
1836
|
const sourceId = conn.source.activtyName;
|
|
1777
1837
|
const targetId = conn.target.activtyName;
|
|
1778
1838
|
if (!outgoingConnections.has(sourceId)) {
|
|
@@ -1829,7 +1889,7 @@ class AXPWorkflowLocalEngine {
|
|
|
1829
1889
|
found: !!activityDefinition,
|
|
1830
1890
|
});
|
|
1831
1891
|
const executionMode = activityDefinition?.executionMode || 'frontend';
|
|
1832
|
-
const activityTitle = activityDefinition?.title;
|
|
1892
|
+
const activityTitle = this.multiLanguageResolver.resolve(activityDefinition?.title) || activityDefinition?.name;
|
|
1833
1893
|
// Handle backend activities: skip
|
|
1834
1894
|
if (executionMode === 'backend') {
|
|
1835
1895
|
console.log(`[WorkflowLocalEngine] ⏭️ Skipping backend activity: ${activity.name} (${activity.id})`);
|
|
@@ -2497,5 +2557,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
2497
2557
|
* Generated bundle index. Do not edit.
|
|
2498
2558
|
*/
|
|
2499
2559
|
|
|
2500
|
-
export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionService, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowLocalEngine, AXPWorkflowManager, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_CATEGORY_PROVIDER, AXP_WORKFLOW_ENGINE, AXP_WORKFLOW_PROVIDER, ActivityExecutor, WorkflowExpressionScopeService, createWorkFlowEvent, ofType };
|
|
2560
|
+
export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionService, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowLocalEngine, AXPWorkflowManager, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_CATEGORY_PROVIDER, AXP_WORKFLOW_ENGINE, AXP_WORKFLOW_PROVIDER, AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES, ActivityExecutor, WorkflowExpressionScopeService, axpIsWorkflowTaskBoardActivityType, createWorkFlowEvent, ofType };
|
|
2501
2561
|
//# sourceMappingURL=acorex-platform-workflow.mjs.map
|