@acorex/platform 20.8.9 → 20.8.11
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-auth.mjs +125 -27
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/{acorex-platform-common-common-settings.provider-DVvuLUfF.mjs → acorex-platform-common-common-settings.provider-Bi1RYif5.mjs} +30 -32
- package/fesm2022/acorex-platform-common-common-settings.provider-Bi1RYif5.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +711 -205
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +420 -127
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +557 -826
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +634 -114
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-components-binding-expression-editor-popup.component-CSxCnzwU.mjs → acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs} +9 -9
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components.mjs +3365 -880
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +456 -204
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +18667 -14048
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +413 -171
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +507 -441
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-CPBzE96V.mjs → acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs} +10 -10
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-Dtv6U3df.mjs → acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs} +21 -76
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-QxJfswhK.mjs → acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs} +6 -7
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-CVdssZBD.mjs → acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs} +12 -12
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGO75IMz.mjs +116 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGO75IMz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-DVaZN9QN.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-DPGHgXa6.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-CdiNW691.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +6578 -4314
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-native.mjs +8 -7
- package/fesm2022/acorex-platform-native.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +391 -166
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cx1lLUaR.mjs +160 -0
- 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-AOrcgjDF.mjs +120 -0
- 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-rGsMVAZj.mjs → acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs} +16 -23
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BfCeUU5F.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-401.component-53VB-PS_.mjs → acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-404.component-DVF9soT5.mjs → acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +1784 -61
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-TJ9PWHMY.mjs → acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-BHcKkIx0.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs → acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs} +24 -25
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DK6R87Lf.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-D7-rCGl7.mjs +86 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +408 -305
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +359 -100
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/fesm2022/acorex-platform.mjs.map +1 -1
- package/package.json +31 -31
- package/{auth/index.d.ts → types/acorex-platform-auth.d.ts} +14 -2
- package/{common/index.d.ts → types/acorex-platform-common.d.ts} +302 -30
- package/{core/index.d.ts → types/acorex-platform-core.d.ts} +188 -44
- package/{domain/index.d.ts → types/acorex-platform-domain.d.ts} +744 -412
- package/{layout/builder/index.d.ts → types/acorex-platform-layout-builder.d.ts} +160 -38
- package/{layout/components/index.d.ts → types/acorex-platform-layout-components.d.ts} +854 -125
- package/{layout/designer/index.d.ts → types/acorex-platform-layout-designer.d.ts} +96 -18
- package/{layout/entity/index.d.ts → types/acorex-platform-layout-entity.d.ts} +848 -63
- package/{layout/views/index.d.ts → types/acorex-platform-layout-views.d.ts} +80 -47
- package/{layout/widget-core/index.d.ts → types/acorex-platform-layout-widget-core.d.ts} +274 -197
- package/{layout/widgets/index.d.ts → types/acorex-platform-layout-widgets.d.ts} +608 -122
- package/{native/index.d.ts → types/acorex-platform-native.d.ts} +0 -7
- package/types/acorex-platform-runtime.d.ts +571 -0
- package/{themes/default/index.d.ts → types/acorex-platform-themes-default.d.ts} +113 -4
- package/{themes/shared/index.d.ts → types/acorex-platform-themes-shared.d.ts} +5 -4
- package/{workflow/index.d.ts → types/acorex-platform-workflow.d.ts} +162 -81
- package/fesm2022/acorex-platform-common-common-settings.provider-DVvuLUfF.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CSxCnzwU.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-CPBzE96V.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-Dtv6U3df.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-QxJfswhK.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-CVdssZBD.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BCxE0RTB.mjs +0 -111
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BCxE0RTB.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DVaZN9QN.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-DPGHgXa6.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-CdiNW691.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-D4hU2SCE.mjs +0 -160
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-D4hU2SCE.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D2CtNrSn.mjs +0 -1716
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D2CtNrSn.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BVTklnzs.mjs +0 -120
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BVTklnzs.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-rGsMVAZj.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-401.component-53VB-PS_.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-404.component-DVF9soT5.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-offline.component-CwNNHzZn.mjs +0 -19
- package/fesm2022/acorex-platform-themes-default-error-offline.component-CwNNHzZn.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-TJ9PWHMY.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BHcKkIx0.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-BUPs84MI.mjs +0 -65
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-BUPs84MI.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BotknoHn.mjs +0 -64
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BotknoHn.mjs.map +0 -1
- package/runtime/index.d.ts +0 -307
- /package/{index.d.ts → types/acorex-platform.d.ts} +0 -0
|
@@ -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 {
|
|
@@ -23,10 +24,10 @@ class AXPWorkflowEventService {
|
|
|
23
24
|
get events$() {
|
|
24
25
|
return this.eventSubject.asObservable();
|
|
25
26
|
}
|
|
26
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
27
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
27
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
28
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowEventService, providedIn: 'root' }); }
|
|
28
29
|
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowEventService, decorators: [{
|
|
30
31
|
type: Injectable,
|
|
31
32
|
args: [{
|
|
32
33
|
providedIn: 'root',
|
|
@@ -116,10 +117,10 @@ class AXPWorkflowRegistryService {
|
|
|
116
117
|
});
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
120
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
120
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
121
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowRegistryService, providedIn: 'root' }); }
|
|
121
122
|
}
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowRegistryService, decorators: [{
|
|
123
124
|
type: Injectable,
|
|
124
125
|
args: [{
|
|
125
126
|
providedIn: 'root',
|
|
@@ -158,17 +159,17 @@ class AXPWorkflowAction {
|
|
|
158
159
|
dispatch(event) {
|
|
159
160
|
this.eventService.dispatch(event);
|
|
160
161
|
}
|
|
161
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
162
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
162
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowAction, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
163
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowAction }); }
|
|
163
164
|
}
|
|
164
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowAction, decorators: [{
|
|
165
166
|
type: Injectable
|
|
166
167
|
}] });
|
|
167
168
|
class AXPWorkflowFunction {
|
|
168
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
169
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowFunction, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
170
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowFunction }); }
|
|
170
171
|
}
|
|
171
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowFunction, decorators: [{
|
|
172
173
|
type: Injectable
|
|
173
174
|
}] });
|
|
174
175
|
function createWorkFlowEvent(type) {
|
|
@@ -184,10 +185,10 @@ class AXPWorkflowDecideAction extends AXPWorkflowAction {
|
|
|
184
185
|
async execute(context) {
|
|
185
186
|
// its a fake action
|
|
186
187
|
}
|
|
187
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
188
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
188
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowDecideAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
189
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowDecideAction, providedIn: 'root' }); }
|
|
189
190
|
}
|
|
190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowDecideAction, decorators: [{
|
|
191
192
|
type: Injectable,
|
|
192
193
|
args: [{
|
|
193
194
|
providedIn: 'root',
|
|
@@ -373,10 +374,10 @@ class AXPWorkflowService {
|
|
|
373
374
|
}
|
|
374
375
|
return this.injector.get(functionType);
|
|
375
376
|
}
|
|
376
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
377
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
377
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowService, deps: [{ token: AXPWorkflowRegistryService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
378
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowService, providedIn: 'root' }); }
|
|
378
379
|
}
|
|
379
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowService, decorators: [{
|
|
380
381
|
type: Injectable,
|
|
381
382
|
args: [{
|
|
382
383
|
providedIn: 'root',
|
|
@@ -401,10 +402,10 @@ class AXPStartWorkflowAction extends AXPWorkflowAction {
|
|
|
401
402
|
throw e;
|
|
402
403
|
}
|
|
403
404
|
}
|
|
404
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
405
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
405
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPStartWorkflowAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
406
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPStartWorkflowAction, providedIn: 'root' }); }
|
|
406
407
|
}
|
|
407
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPStartWorkflowAction, decorators: [{
|
|
408
409
|
type: Injectable,
|
|
409
410
|
args: [{
|
|
410
411
|
providedIn: 'root',
|
|
@@ -417,6 +418,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
417
418
|
// Compatible with Elsa backend while using ACoreX naming conventions
|
|
418
419
|
// ============================================
|
|
419
420
|
|
|
421
|
+
// Note:
|
|
422
|
+
// Previous versions defined dedicated activity result/command types here
|
|
423
|
+
// (AXPActivityResult / AXPActivity) that wrapped output and outcome.
|
|
424
|
+
// Activities are now modeled directly as AXPCommand with outcome stored in
|
|
425
|
+
// AXPExecuteCommandResult.metadata.outcome.
|
|
426
|
+
|
|
420
427
|
const AXP_ACTIVITY_PROVIDER = new InjectionToken('AXP_ACTIVITY_PROVIDER', {
|
|
421
428
|
factory: () => [],
|
|
422
429
|
});
|
|
@@ -592,6 +599,19 @@ class AXPActivityDefinitionService {
|
|
|
592
599
|
this.pendingActivityRequests.set(name, requestPromise);
|
|
593
600
|
return requestPromise;
|
|
594
601
|
}
|
|
602
|
+
/**
|
|
603
|
+
* Get all activity definitions (flat list) by loading root categories and their activities.
|
|
604
|
+
* Used by activity selector UIs (e.g. automation command configurator).
|
|
605
|
+
*/
|
|
606
|
+
async getAllActivities() {
|
|
607
|
+
const categories = await this.getCategories(undefined);
|
|
608
|
+
const all = [];
|
|
609
|
+
for (const cat of categories) {
|
|
610
|
+
const activities = await this.getActivitiesByCategoryId(cat.id);
|
|
611
|
+
all.push(...activities);
|
|
612
|
+
}
|
|
613
|
+
return all;
|
|
614
|
+
}
|
|
595
615
|
/**
|
|
596
616
|
* Get category ID containing a specific activity definition
|
|
597
617
|
*
|
|
@@ -609,7 +629,7 @@ class AXPActivityDefinitionService {
|
|
|
609
629
|
if (definition && definition.category) {
|
|
610
630
|
// Try to find category by name/id
|
|
611
631
|
const categories = await this.getCategories();
|
|
612
|
-
const found = categories.find(cat => cat.id === definition.category
|
|
632
|
+
const found = categories.find((cat) => cat.id === definition.category);
|
|
613
633
|
if (found) {
|
|
614
634
|
return found.id;
|
|
615
635
|
}
|
|
@@ -836,10 +856,10 @@ class AXPActivityDefinitionService {
|
|
|
836
856
|
this.pendingActivitiesRequests.clear();
|
|
837
857
|
this.pendingActivityRequests.clear();
|
|
838
858
|
}
|
|
839
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
840
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
859
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPActivityDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
860
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPActivityDefinitionService, providedIn: 'root' }); }
|
|
841
861
|
}
|
|
842
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
862
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPActivityDefinitionService, decorators: [{
|
|
843
863
|
type: Injectable,
|
|
844
864
|
args: [{
|
|
845
865
|
providedIn: 'root',
|
|
@@ -852,6 +872,62 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
852
872
|
*/
|
|
853
873
|
const AXP_WORKFLOW_ENGINE = new InjectionToken('AXP_WORKFLOW_ENGINE');
|
|
854
874
|
|
|
875
|
+
//#region ---- Error Codes ----
|
|
876
|
+
/**
|
|
877
|
+
* Stable workflow engine error codes for UI branching (toasts, take-over flow, etc.).
|
|
878
|
+
*/
|
|
879
|
+
const AXP_WORKFLOW_ERROR_CODES = {
|
|
880
|
+
TASK_NOT_ASSIGNEE: 'WORKFLOW_TASK_NOT_ASSIGNEE',
|
|
881
|
+
CLAIM_REQUIRED: 'WORKFLOW_CLAIM_REQUIRED',
|
|
882
|
+
REASSIGN_NOT_ALLOWED: 'WORKFLOW_REASSIGN_NOT_ALLOWED',
|
|
883
|
+
};
|
|
884
|
+
//#endregion
|
|
885
|
+
//#region ---- Engine Error ----
|
|
886
|
+
/**
|
|
887
|
+
* Business-rule failure from {@link AXPWorkflowEngine} (expected, user-facing).
|
|
888
|
+
*/
|
|
889
|
+
class AXPWorkflowEngineError extends Error {
|
|
890
|
+
constructor(message, code, details) {
|
|
891
|
+
super(message);
|
|
892
|
+
this.code = code;
|
|
893
|
+
this.details = details;
|
|
894
|
+
this.name = 'AXPWorkflowEngineError';
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Resolves a stable error code from an unknown thrown value.
|
|
899
|
+
*/
|
|
900
|
+
function getWorkflowEngineErrorCode(error) {
|
|
901
|
+
if (error instanceof AXPWorkflowEngineError) {
|
|
902
|
+
return error.code;
|
|
903
|
+
}
|
|
904
|
+
return undefined;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Resolves a user-facing message and optional code from an unknown thrown value.
|
|
908
|
+
*/
|
|
909
|
+
function getWorkflowEngineErrorInfo(error) {
|
|
910
|
+
if (error instanceof AXPWorkflowEngineError) {
|
|
911
|
+
return { message: error.message, code: error.code };
|
|
912
|
+
}
|
|
913
|
+
if (error instanceof Error) {
|
|
914
|
+
return { message: error.message };
|
|
915
|
+
}
|
|
916
|
+
return { message: 'An unexpected workflow error occurred' };
|
|
917
|
+
}
|
|
918
|
+
//#endregion
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Activity types that use the task board (suspend until user acts via inbox), not inline interactive execution.
|
|
922
|
+
*/
|
|
923
|
+
const AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES = [
|
|
924
|
+
'workflow-activity:human-task',
|
|
925
|
+
'workflow-activity:cartable',
|
|
926
|
+
];
|
|
927
|
+
function axpIsWorkflowTaskBoardActivityType(activityType) {
|
|
928
|
+
return !!activityType && AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES.includes(activityType);
|
|
929
|
+
}
|
|
930
|
+
|
|
855
931
|
//#endregion
|
|
856
932
|
/**
|
|
857
933
|
* Workflow Expression Scope Service
|
|
@@ -885,6 +961,82 @@ const AXP_WORKFLOW_ENGINE = new InjectionToken('AXP_WORKFLOW_ENGINE');
|
|
|
885
961
|
* ```
|
|
886
962
|
*/
|
|
887
963
|
class WorkflowExpressionScopeService {
|
|
964
|
+
//#region ---- Private Helpers (dot-notation input normalization) ----
|
|
965
|
+
/**
|
|
966
|
+
* Collect dot-notation key-value pairs from nested objects so that e.g.
|
|
967
|
+
* { metadata: { "metadata.questionnaire.id": "x" } } becomes { "metadata.questionnaire.id": "x" } at root.
|
|
968
|
+
* Top-level non-dot keys are kept as-is.
|
|
969
|
+
*/
|
|
970
|
+
flattenDotKeysFromTree(obj) {
|
|
971
|
+
if (obj === null || typeof obj !== 'object')
|
|
972
|
+
return obj;
|
|
973
|
+
const result = {};
|
|
974
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
975
|
+
if (key.includes('.')) {
|
|
976
|
+
result[key] = value;
|
|
977
|
+
}
|
|
978
|
+
else if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
979
|
+
for (const [k, v] of Object.entries(value)) {
|
|
980
|
+
if (k.includes('.')) {
|
|
981
|
+
result[k] = v;
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
result[key + '.' + k] = v;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
else {
|
|
989
|
+
result[key] = value;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
return result;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Expand flat keys with dots into nested objects.
|
|
996
|
+
* e.g. { "metadata.questionnaire.id": "x" } -> { metadata: { questionnaire: { id: "x" } } }.
|
|
997
|
+
*/
|
|
998
|
+
expandDotKeys(obj) {
|
|
999
|
+
if (obj === null || typeof obj !== 'object')
|
|
1000
|
+
return obj;
|
|
1001
|
+
const result = {};
|
|
1002
|
+
const dotKeys = [];
|
|
1003
|
+
const simpleKeys = [];
|
|
1004
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
1005
|
+
if (key.includes('.')) {
|
|
1006
|
+
dotKeys.push([key, value]);
|
|
1007
|
+
}
|
|
1008
|
+
else {
|
|
1009
|
+
simpleKeys.push([key, value]);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
for (const [key, value] of dotKeys) {
|
|
1013
|
+
const parts = key.split('.');
|
|
1014
|
+
let current = result;
|
|
1015
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
1016
|
+
const part = parts[i];
|
|
1017
|
+
if (!(part in current) || typeof current[part] !== 'object' || current[part] === null) {
|
|
1018
|
+
current[part] = {};
|
|
1019
|
+
}
|
|
1020
|
+
current = current[part];
|
|
1021
|
+
}
|
|
1022
|
+
current[parts[parts.length - 1]] = value;
|
|
1023
|
+
}
|
|
1024
|
+
for (const [key, value] of simpleKeys) {
|
|
1025
|
+
result[key] = value;
|
|
1026
|
+
}
|
|
1027
|
+
return result;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Normalize workflow input so that flat dot-notation keys (e.g. from form schema
|
|
1031
|
+
* "metadata.questionnaire.id") become nested for expression access (inputs.metadata.questionnaire.id).
|
|
1032
|
+
*/
|
|
1033
|
+
normalizeInputs(input) {
|
|
1034
|
+
if (!input || typeof input !== 'object')
|
|
1035
|
+
return {};
|
|
1036
|
+
const flattened = this.flattenDotKeysFromTree(input);
|
|
1037
|
+
return this.expandDotKeys(flattened);
|
|
1038
|
+
}
|
|
1039
|
+
//#endregion
|
|
888
1040
|
//#region ---- Public Methods ----
|
|
889
1041
|
/**
|
|
890
1042
|
* Build expression evaluation scope for workflow activities.
|
|
@@ -914,10 +1066,12 @@ class WorkflowExpressionScopeService {
|
|
|
914
1066
|
* @returns Expression evaluator scope with workflow data and context.eval() function
|
|
915
1067
|
*/
|
|
916
1068
|
buildScope(context) {
|
|
1069
|
+
// Normalize inputs so flat dot-notation keys (e.g. metadata.questionnaire.id from forms) become nested for expressions
|
|
1070
|
+
const inputs = this.normalizeInputs(context.inputs || {});
|
|
917
1071
|
// Build merged workflow data object for context.eval()
|
|
918
1072
|
// This allows expressions like: context.eval("inputs.userName") or context.eval("variables.count")
|
|
919
1073
|
const workflowData = {
|
|
920
|
-
inputs
|
|
1074
|
+
inputs,
|
|
921
1075
|
variables: context.variables || {},
|
|
922
1076
|
vars: context.variables || {}, // Alias for convenience
|
|
923
1077
|
outputs: context.outputs || {},
|
|
@@ -971,21 +1125,32 @@ class WorkflowExpressionScopeService {
|
|
|
971
1125
|
outputs['last'] = state.lastActivityOutput;
|
|
972
1126
|
}
|
|
973
1127
|
return this.buildScope({
|
|
974
|
-
inputs: state.input || {},
|
|
1128
|
+
inputs: this.normalizeInputs((state.input || {})),
|
|
975
1129
|
variables: state.variables || {},
|
|
976
1130
|
outputs: outputs,
|
|
977
1131
|
});
|
|
978
1132
|
}
|
|
979
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
980
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: WorkflowExpressionScopeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1134
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: WorkflowExpressionScopeService, providedIn: 'root' }); }
|
|
981
1135
|
}
|
|
982
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: WorkflowExpressionScopeService, decorators: [{
|
|
983
1137
|
type: Injectable,
|
|
984
1138
|
args: [{
|
|
985
1139
|
providedIn: 'root'
|
|
986
1140
|
}]
|
|
987
1141
|
}] });
|
|
988
1142
|
|
|
1143
|
+
//#region ---- Constants ----
|
|
1144
|
+
/**
|
|
1145
|
+
* Activity types handled internally by the workflow engine (e.g. mock backend).
|
|
1146
|
+
* When such an activity is not registered as Command on the client, we skip execution
|
|
1147
|
+
* without warning — the engine will run it when executing the workflow.
|
|
1148
|
+
*/
|
|
1149
|
+
const ENGINE_BUILTIN_ACTIVITY_TYPES = new Set([
|
|
1150
|
+
'workflow-activity:set-variable',
|
|
1151
|
+
'workflow-activity:http-request',
|
|
1152
|
+
'workflow-activity:resolve-employee-user-id',
|
|
1153
|
+
]);
|
|
989
1154
|
//#endregion
|
|
990
1155
|
/**
|
|
991
1156
|
* Activity Executor Service
|
|
@@ -1007,6 +1172,7 @@ class ActivityExecutor {
|
|
|
1007
1172
|
this.commandService = inject(AXPCommandService);
|
|
1008
1173
|
this.expressionEvaluator = inject(AXPExpressionEvaluatorService);
|
|
1009
1174
|
this.expressionScopeService = inject(WorkflowExpressionScopeService);
|
|
1175
|
+
this.translateService = inject(AXTranslationService);
|
|
1010
1176
|
}
|
|
1011
1177
|
//#endregion
|
|
1012
1178
|
//#region ---- Public Methods ----
|
|
@@ -1039,21 +1205,23 @@ class ActivityExecutor {
|
|
|
1039
1205
|
// Check if command exists
|
|
1040
1206
|
const commandExists = this.commandService.exists(activityName);
|
|
1041
1207
|
if (!commandExists) {
|
|
1042
|
-
|
|
1043
|
-
`
|
|
1208
|
+
if (!ENGINE_BUILTIN_ACTIVITY_TYPES.has(activityName)) {
|
|
1209
|
+
console.warn(`[ActivityExecutor] ⚠️ Activity '${activityName}' is not registered as Command. ` +
|
|
1210
|
+
`Skipping execution.`);
|
|
1211
|
+
}
|
|
1044
1212
|
return {
|
|
1045
1213
|
output: null,
|
|
1046
1214
|
outcome: 'Done'
|
|
1047
1215
|
};
|
|
1048
1216
|
}
|
|
1049
|
-
// Flatten properties if nested (
|
|
1217
|
+
// Flatten properties if nested (designer-style nested payload)
|
|
1050
1218
|
let commandInput = evaluatedInputs;
|
|
1051
1219
|
if (commandInput['properties'] && typeof commandInput['properties'] === 'object') {
|
|
1052
1220
|
// Flatten: {properties: {text: "..."}} -> {text: "..."}
|
|
1053
1221
|
commandInput = { ...commandInput['properties'] };
|
|
1054
1222
|
}
|
|
1055
1223
|
// Execute activity via CommandBus
|
|
1056
|
-
// Activities
|
|
1224
|
+
// Activities (AXPActivity) return {output, outcome}; legacy may return {output, outcomes}
|
|
1057
1225
|
const result = await this.commandService.execute(activityName, commandInput);
|
|
1058
1226
|
if (!result) {
|
|
1059
1227
|
return {
|
|
@@ -1064,21 +1232,33 @@ class ActivityExecutor {
|
|
|
1064
1232
|
if (!result.success) {
|
|
1065
1233
|
return {
|
|
1066
1234
|
output: {
|
|
1067
|
-
error: result.message?.text,
|
|
1235
|
+
error: await this.resolveCommandMessageTextForError(result.message?.text),
|
|
1068
1236
|
},
|
|
1069
1237
|
outcome: 'Failed',
|
|
1070
1238
|
};
|
|
1071
1239
|
}
|
|
1072
1240
|
const commandResult = result.data;
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
// Default to 'Done' if no outcomes specified
|
|
1241
|
+
// Prefer unified outcome in result.metadata; fall back to legacy data.outcome/outcomes.
|
|
1242
|
+
const metadataOutcome = result?.metadata?.['outcome'];
|
|
1076
1243
|
let outcome = 'Done';
|
|
1077
|
-
if (
|
|
1078
|
-
outcome =
|
|
1244
|
+
if (typeof metadataOutcome === 'string' && metadataOutcome.length > 0) {
|
|
1245
|
+
outcome = metadataOutcome;
|
|
1246
|
+
}
|
|
1247
|
+
else if (typeof commandResult?.outcome === 'string' && commandResult.outcome.length > 0) {
|
|
1248
|
+
outcome = commandResult.outcome;
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
const outcomes = (commandResult?.outcomes ?? {});
|
|
1252
|
+
if (outcomes && typeof outcomes === 'object' && Object.keys(outcomes).length > 0) {
|
|
1253
|
+
outcome = outcomes['Done'] ? 'Done' : Object.keys(outcomes)[0] || 'Done';
|
|
1254
|
+
}
|
|
1079
1255
|
}
|
|
1256
|
+
// Prefer output wrapper when present; otherwise treat data itself as output.
|
|
1257
|
+
const output = commandResult && typeof commandResult === 'object' && 'output' in commandResult
|
|
1258
|
+
? commandResult.output
|
|
1259
|
+
: commandResult;
|
|
1080
1260
|
return {
|
|
1081
|
-
output:
|
|
1261
|
+
output: output ?? null,
|
|
1082
1262
|
outcome,
|
|
1083
1263
|
};
|
|
1084
1264
|
}
|
|
@@ -1090,10 +1270,22 @@ class ActivityExecutor {
|
|
|
1090
1270
|
};
|
|
1091
1271
|
}
|
|
1092
1272
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1273
|
+
/**
|
|
1274
|
+
* Resolves command failure message text for workflow output: `@` keys via translate, MLS maps via resolve.
|
|
1275
|
+
*/
|
|
1276
|
+
async resolveCommandMessageTextForError(value) {
|
|
1277
|
+
if (value == null) {
|
|
1278
|
+
return '';
|
|
1279
|
+
}
|
|
1280
|
+
if (typeof value === 'string') {
|
|
1281
|
+
return value.startsWith('@') ? await this.translateService.translateAsync(value) : value;
|
|
1282
|
+
}
|
|
1283
|
+
return this.translateService.resolve(value);
|
|
1284
|
+
}
|
|
1285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActivityExecutor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1286
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActivityExecutor, providedIn: 'root' }); }
|
|
1095
1287
|
}
|
|
1096
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ActivityExecutor, decorators: [{
|
|
1097
1289
|
type: Injectable,
|
|
1098
1290
|
args: [{
|
|
1099
1291
|
providedIn: 'root'
|
|
@@ -1141,23 +1333,19 @@ class AXPWorkflowManager {
|
|
|
1141
1333
|
//#endregion
|
|
1142
1334
|
//#region ---- Public Methods ----
|
|
1143
1335
|
/**
|
|
1144
|
-
* Execute frontend activities interactively until reaching human-task or completion.
|
|
1336
|
+
* Execute frontend activities interactively until reaching workflow-activity:human-task or completion.
|
|
1145
1337
|
*
|
|
1146
|
-
*
|
|
1147
|
-
*
|
|
1148
|
-
*
|
|
1149
|
-
* 3. If backend returns nextTask (frontend activity), repeats the process
|
|
1150
|
-
* 4. Continues until workflow completes or reaches human-task
|
|
1338
|
+
* Interactive = show form/popup immediately (user sees and acts). Only workflow-activity:human-task
|
|
1339
|
+
* is not interactive (goes to task board). Other frontend activities (show-layout-popup, show-toast, etc.)
|
|
1340
|
+
* even with taskType human-task in definition are executed here.
|
|
1151
1341
|
*
|
|
1152
1342
|
* @param instanceId - Workflow instance ID
|
|
1153
1343
|
* @param task - Current task to execute
|
|
1154
1344
|
* @param state - Current workflow state
|
|
1155
1345
|
* @param lastActivityOutput - Last activity output (for expression evaluation)
|
|
1156
|
-
* @returns Final result with nextTask (if human-task) or completion status
|
|
1346
|
+
* @returns Final result with nextTask (if workflow-activity:human-task) or completion status
|
|
1157
1347
|
*/
|
|
1158
1348
|
async executeInteractiveFlow(instanceId, task, state, activityOutputs) {
|
|
1159
|
-
// Backend decides what to execute - frontend only executes ui-activity with frontend/both executionMode
|
|
1160
|
-
// If backend returns a task that's not executable here, return it as-is
|
|
1161
1349
|
let currentTask = task;
|
|
1162
1350
|
let currentState = state;
|
|
1163
1351
|
let currentActivityOutputs = {
|
|
@@ -1168,10 +1356,10 @@ class AXPWorkflowManager {
|
|
|
1168
1356
|
let iterationCount = 0;
|
|
1169
1357
|
while (currentTask && iterationCount < maxIterations) {
|
|
1170
1358
|
iterationCount++;
|
|
1171
|
-
//
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1359
|
+
// Interactive = frontend executionMode and NOT task-board activities (human-task, cartable)
|
|
1360
|
+
const isInteractive = (currentTask.executionMode === 'frontend' || currentTask.executionMode === 'both') &&
|
|
1361
|
+
!axpIsWorkflowTaskBoardActivityType(currentTask.activityType);
|
|
1362
|
+
if (isInteractive) {
|
|
1175
1363
|
// Execute frontend activity
|
|
1176
1364
|
const execResult = await this.activityExecutor.execute(currentTask, currentState, currentActivityOutputs);
|
|
1177
1365
|
// Track outputs locally (backend should also persist and return them)
|
|
@@ -1208,20 +1396,20 @@ class AXPWorkflowManager {
|
|
|
1208
1396
|
output: completeResponse.output,
|
|
1209
1397
|
};
|
|
1210
1398
|
}
|
|
1211
|
-
// Backend decides: if nextTask is not
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1399
|
+
// Backend decides: if nextTask is task-board activity or not frontend, return it (task board or done)
|
|
1400
|
+
const nextInteractive = (completeResponse.nextTask.executionMode === 'frontend' || completeResponse.nextTask.executionMode === 'both') &&
|
|
1401
|
+
!axpIsWorkflowTaskBoardActivityType(completeResponse.nextTask.activityType);
|
|
1402
|
+
if (!nextInteractive) {
|
|
1215
1403
|
return {
|
|
1216
1404
|
nextTask: completeResponse.nextTask,
|
|
1217
1405
|
state: currentState,
|
|
1218
1406
|
};
|
|
1219
1407
|
}
|
|
1220
|
-
// Continue with next
|
|
1408
|
+
// Continue with next interactive frontend task
|
|
1221
1409
|
currentTask = completeResponse.nextTask;
|
|
1222
1410
|
}
|
|
1223
1411
|
else {
|
|
1224
|
-
// Not
|
|
1412
|
+
// Not interactive (e.g. human-task / cartable) - return as-is for task board
|
|
1225
1413
|
return {
|
|
1226
1414
|
nextTask: currentTask,
|
|
1227
1415
|
state: currentState,
|
|
@@ -1272,15 +1460,14 @@ class AXPWorkflowManager {
|
|
|
1272
1460
|
startNormalizedState.lastUpdated = new Date(startNormalizedState.lastUpdated);
|
|
1273
1461
|
}
|
|
1274
1462
|
this.stateCache.set(response.instanceId, startNormalizedState);
|
|
1275
|
-
// 🎯 Interactive flow: Execute frontend activities
|
|
1276
|
-
// Backend decides what to execute - if pendingTask is executable (ui-activity with frontend/both), execute it
|
|
1463
|
+
// 🎯 Interactive flow: Execute frontend activities that are NOT task-board types (those go to task board)
|
|
1277
1464
|
let finalNextTask = response.pendingTask || null;
|
|
1278
1465
|
let finalOutput = startNormalizedState.output;
|
|
1279
|
-
|
|
1280
|
-
if (
|
|
1281
|
-
|
|
1282
|
-
(
|
|
1283
|
-
const interactiveResult = await this.executeInteractiveFlow(response.instanceId,
|
|
1466
|
+
const pendingTask = response.pendingTask;
|
|
1467
|
+
if (pendingTask &&
|
|
1468
|
+
(pendingTask.executionMode === 'frontend' || pendingTask.executionMode === 'both') &&
|
|
1469
|
+
!axpIsWorkflowTaskBoardActivityType(pendingTask.activityType)) {
|
|
1470
|
+
const interactiveResult = await this.executeInteractiveFlow(response.instanceId, pendingTask, startNormalizedState, response.activityOutputs || response.state.activityOutputs);
|
|
1284
1471
|
finalNextTask = interactiveResult.nextTask;
|
|
1285
1472
|
startNormalizedState = interactiveResult.state;
|
|
1286
1473
|
if (interactiveResult.output !== undefined) {
|
|
@@ -1342,15 +1529,14 @@ class AXPWorkflowManager {
|
|
|
1342
1529
|
if (normalizedState) {
|
|
1343
1530
|
this.stateCache.set(instanceId, normalizedState);
|
|
1344
1531
|
}
|
|
1345
|
-
// 🎯 Interactive flow: Execute frontend activities
|
|
1346
|
-
// Backend decides what to execute - if nextTask is executable (ui-activity with frontend/both), execute it
|
|
1532
|
+
// 🎯 Interactive flow: Execute frontend activities that are NOT task-board types (those go to task board)
|
|
1347
1533
|
let finalNextTask = response.nextTask || null;
|
|
1348
1534
|
let finalOutput = response.output;
|
|
1349
|
-
|
|
1350
|
-
if (
|
|
1351
|
-
|
|
1352
|
-
(
|
|
1353
|
-
const interactiveResult = await this.executeInteractiveFlow(instanceId,
|
|
1535
|
+
const nextTask = response.nextTask;
|
|
1536
|
+
if (nextTask &&
|
|
1537
|
+
(nextTask.executionMode === 'frontend' || nextTask.executionMode === 'both') &&
|
|
1538
|
+
!axpIsWorkflowTaskBoardActivityType(nextTask.activityType)) {
|
|
1539
|
+
const interactiveResult = await this.executeInteractiveFlow(instanceId, nextTask, normalizedState, normalizedState?.activityOutputs);
|
|
1354
1540
|
finalNextTask = interactiveResult.nextTask;
|
|
1355
1541
|
normalizedState = interactiveResult.state;
|
|
1356
1542
|
if (interactiveResult.output !== undefined) {
|
|
@@ -1370,11 +1556,12 @@ class AXPWorkflowManager {
|
|
|
1370
1556
|
};
|
|
1371
1557
|
}
|
|
1372
1558
|
catch (error) {
|
|
1373
|
-
|
|
1559
|
+
const { message, code } = getWorkflowEngineErrorInfo(error);
|
|
1374
1560
|
return {
|
|
1375
1561
|
success: false,
|
|
1376
1562
|
instanceId,
|
|
1377
|
-
error:
|
|
1563
|
+
error: message,
|
|
1564
|
+
errorCode: code,
|
|
1378
1565
|
};
|
|
1379
1566
|
}
|
|
1380
1567
|
}
|
|
@@ -1420,10 +1607,74 @@ class AXPWorkflowManager {
|
|
|
1420
1607
|
return null;
|
|
1421
1608
|
}
|
|
1422
1609
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1610
|
+
/**
|
|
1611
|
+
* Claim a pooled workflow task (assign current user on the bookmark without advancing the workflow).
|
|
1612
|
+
* Supported only when the injected workflow engine implements {@link AXPWorkflowEngine.claimTask}.
|
|
1613
|
+
*/
|
|
1614
|
+
async claimTask(instanceId, bookmarkId, stepId) {
|
|
1615
|
+
const claim = this.workflowEngine.claimTask?.bind(this.workflowEngine);
|
|
1616
|
+
if (!claim) {
|
|
1617
|
+
return {
|
|
1618
|
+
success: false,
|
|
1619
|
+
instanceId,
|
|
1620
|
+
error: 'Claim task is not supported by this workflow engine',
|
|
1621
|
+
};
|
|
1622
|
+
}
|
|
1623
|
+
try {
|
|
1624
|
+
const result = await claim({ instanceId, bookmarkId, stepId });
|
|
1625
|
+
return {
|
|
1626
|
+
success: result.success,
|
|
1627
|
+
instanceId,
|
|
1628
|
+
error: result.error,
|
|
1629
|
+
errorCode: result.errorCode,
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
catch (error) {
|
|
1633
|
+
const { message, code } = getWorkflowEngineErrorInfo(error);
|
|
1634
|
+
return {
|
|
1635
|
+
success: false,
|
|
1636
|
+
instanceId,
|
|
1637
|
+
error: message,
|
|
1638
|
+
errorCode: code,
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Reassign a human-task bookmark to the current user without advancing the workflow.
|
|
1644
|
+
* Supported only when the injected workflow engine implements {@link AXPWorkflowEngine.reassignTaskToSelf}.
|
|
1645
|
+
*/
|
|
1646
|
+
async reassignTaskToSelf(instanceId, bookmarkId, stepId) {
|
|
1647
|
+
const reassign = this.workflowEngine.reassignTaskToSelf?.bind(this.workflowEngine);
|
|
1648
|
+
if (!reassign) {
|
|
1649
|
+
return {
|
|
1650
|
+
success: false,
|
|
1651
|
+
instanceId,
|
|
1652
|
+
error: 'Reassign task is not supported by this workflow engine',
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
try {
|
|
1656
|
+
const result = await reassign({ instanceId, bookmarkId, stepId });
|
|
1657
|
+
return {
|
|
1658
|
+
success: result.success,
|
|
1659
|
+
instanceId,
|
|
1660
|
+
error: result.error,
|
|
1661
|
+
errorCode: result.errorCode,
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
catch (error) {
|
|
1665
|
+
const { message, code } = getWorkflowEngineErrorInfo(error);
|
|
1666
|
+
return {
|
|
1667
|
+
success: false,
|
|
1668
|
+
instanceId,
|
|
1669
|
+
error: message,
|
|
1670
|
+
errorCode: code,
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1675
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowManager, providedIn: 'root' }); }
|
|
1425
1676
|
}
|
|
1426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowManager, decorators: [{
|
|
1427
1678
|
type: Injectable,
|
|
1428
1679
|
args: [{
|
|
1429
1680
|
providedIn: 'root',
|
|
@@ -1458,6 +1709,7 @@ class AXPWorkflowLocalEngine {
|
|
|
1458
1709
|
//#region ---- Services & Dependencies ----
|
|
1459
1710
|
this.activityDefinitionService = inject(AXPActivityDefinitionService);
|
|
1460
1711
|
this.workflowProviders = inject(AXP_WORKFLOW_PROVIDER, { optional: true }) || [];
|
|
1712
|
+
this.multiLanguageResolver = inject(AXTranslationService);
|
|
1461
1713
|
//#endregion
|
|
1462
1714
|
//#region ---- Instance Storage ----
|
|
1463
1715
|
/**
|
|
@@ -1559,9 +1811,10 @@ class AXPWorkflowLocalEngine {
|
|
|
1559
1811
|
throw new Error(`Workflow instance not found: ${request.instanceId}`);
|
|
1560
1812
|
}
|
|
1561
1813
|
// Store activity result (from external execution)
|
|
1814
|
+
const outcome = request.outcome ?? 'Done';
|
|
1562
1815
|
localState.activityResults.set(request.stepId, {
|
|
1563
1816
|
output: request.userInput || {},
|
|
1564
|
-
outcome
|
|
1817
|
+
outcome,
|
|
1565
1818
|
});
|
|
1566
1819
|
localState.completedActivities.add(request.stepId);
|
|
1567
1820
|
// Store activity output for expression evaluation
|
|
@@ -1577,6 +1830,11 @@ class AXPWorkflowLocalEngine {
|
|
|
1577
1830
|
...(request.userInput || {}),
|
|
1578
1831
|
};
|
|
1579
1832
|
}
|
|
1833
|
+
localState.state.variables = {
|
|
1834
|
+
...localState.state.variables,
|
|
1835
|
+
[`${request.stepId}_outcome`]: outcome,
|
|
1836
|
+
[`${request.stepId}_activityOutput`]: request.userInput || {},
|
|
1837
|
+
};
|
|
1580
1838
|
// Mark activity as completed and continue progression
|
|
1581
1839
|
// Continue progressing workflow steps (skipping backend activities)
|
|
1582
1840
|
const nextTask = await this.executeWorkflowSteps(localState);
|
|
@@ -1589,7 +1847,7 @@ class AXPWorkflowLocalEngine {
|
|
|
1589
1847
|
}
|
|
1590
1848
|
return {
|
|
1591
1849
|
output: request.userInput || {},
|
|
1592
|
-
outcomes: { [
|
|
1850
|
+
outcomes: { [outcome]: true },
|
|
1593
1851
|
state: localState.state,
|
|
1594
1852
|
nextTask: nextTask || null,
|
|
1595
1853
|
};
|
|
@@ -1650,13 +1908,13 @@ class AXPWorkflowLocalEngine {
|
|
|
1650
1908
|
const connections = graph.connections || [];
|
|
1651
1909
|
// Build activity map
|
|
1652
1910
|
const activityMap = new Map();
|
|
1653
|
-
activities.forEach(activity => {
|
|
1911
|
+
activities.forEach((activity) => {
|
|
1654
1912
|
activityMap.set(activity.id, activity);
|
|
1655
1913
|
});
|
|
1656
1914
|
// Build connection graph
|
|
1657
1915
|
const outgoingConnections = new Map();
|
|
1658
1916
|
const incomingConnections = new Map();
|
|
1659
|
-
connections.forEach(conn => {
|
|
1917
|
+
connections.forEach((conn) => {
|
|
1660
1918
|
const sourceId = conn.source.activtyName;
|
|
1661
1919
|
const targetId = conn.target.activtyName;
|
|
1662
1920
|
if (!outgoingConnections.has(sourceId)) {
|
|
@@ -1713,7 +1971,7 @@ class AXPWorkflowLocalEngine {
|
|
|
1713
1971
|
found: !!activityDefinition,
|
|
1714
1972
|
});
|
|
1715
1973
|
const executionMode = activityDefinition?.executionMode || 'frontend';
|
|
1716
|
-
const activityTitle = activityDefinition?.title;
|
|
1974
|
+
const activityTitle = this.multiLanguageResolver.resolve(activityDefinition?.title) || activityDefinition?.name;
|
|
1717
1975
|
// Handle backend activities: skip
|
|
1718
1976
|
if (executionMode === 'backend') {
|
|
1719
1977
|
console.log(`[WorkflowLocalEngine] ⏭️ Skipping backend activity: ${activity.name} (${activity.id})`);
|
|
@@ -1792,9 +2050,10 @@ class AXPWorkflowLocalEngine {
|
|
|
1792
2050
|
throw new Error(`Workflow instance not found: ${request.instanceId}`);
|
|
1793
2051
|
}
|
|
1794
2052
|
// Store activity result
|
|
2053
|
+
const outcome = request.outcome ?? 'Done';
|
|
1795
2054
|
localState.activityResults.set(request.activityNode, {
|
|
1796
2055
|
output: request.output || {},
|
|
1797
|
-
outcome
|
|
2056
|
+
outcome,
|
|
1798
2057
|
});
|
|
1799
2058
|
localState.completedActivities.add(request.activityNode);
|
|
1800
2059
|
// Store outputs for expression evaluation
|
|
@@ -1819,15 +2078,15 @@ class AXPWorkflowLocalEngine {
|
|
|
1819
2078
|
}
|
|
1820
2079
|
return {
|
|
1821
2080
|
output: request.output || {},
|
|
1822
|
-
outcomes: { [
|
|
2081
|
+
outcomes: { [outcome]: true },
|
|
1823
2082
|
nextTask: nextTask || null,
|
|
1824
2083
|
state: localState.state,
|
|
1825
2084
|
};
|
|
1826
2085
|
}
|
|
1827
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1828
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2086
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowLocalEngine, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2087
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowLocalEngine }); }
|
|
1829
2088
|
}
|
|
1830
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2089
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowLocalEngine, decorators: [{
|
|
1831
2090
|
type: Injectable
|
|
1832
2091
|
}] });
|
|
1833
2092
|
|
|
@@ -2248,10 +2507,10 @@ class AXPWorkflowDefinitionService {
|
|
|
2248
2507
|
this.pendingWorkflowsRequests.clear();
|
|
2249
2508
|
this.pendingWorkflowRequests.clear();
|
|
2250
2509
|
}
|
|
2251
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2252
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2510
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowDefinitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2511
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowDefinitionService, providedIn: 'root' }); }
|
|
2253
2512
|
}
|
|
2254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowDefinitionService, decorators: [{
|
|
2255
2514
|
type: Injectable,
|
|
2256
2515
|
args: [{
|
|
2257
2516
|
providedIn: 'root',
|
|
@@ -2343,9 +2602,9 @@ class AXPWorkflowModule {
|
|
|
2343
2602
|
f();
|
|
2344
2603
|
});
|
|
2345
2604
|
}
|
|
2346
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2347
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2348
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2605
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowModule, deps: [{ token: 'AXPWorkflowModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2606
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowModule }); }
|
|
2607
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowModule, providers: [
|
|
2349
2608
|
AXPWorkflowLocalEngine,
|
|
2350
2609
|
{
|
|
2351
2610
|
provide: AXP_WORKFLOW_ENGINE,
|
|
@@ -2354,7 +2613,7 @@ class AXPWorkflowModule {
|
|
|
2354
2613
|
AXPWorkflowManager,
|
|
2355
2614
|
] }); }
|
|
2356
2615
|
}
|
|
2357
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2616
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPWorkflowModule, decorators: [{
|
|
2358
2617
|
type: NgModule,
|
|
2359
2618
|
args: [{
|
|
2360
2619
|
imports: [],
|
|
@@ -2380,5 +2639,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2380
2639
|
* Generated bundle index. Do not edit.
|
|
2381
2640
|
*/
|
|
2382
2641
|
|
|
2383
|
-
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 };
|
|
2642
|
+
export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionService, AXPWorkflowEngineError, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowLocalEngine, AXPWorkflowManager, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_CATEGORY_PROVIDER, AXP_WORKFLOW_ENGINE, AXP_WORKFLOW_ERROR_CODES, AXP_WORKFLOW_PROVIDER, AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES, ActivityExecutor, WorkflowExpressionScopeService, axpIsWorkflowTaskBoardActivityType, createWorkFlowEvent, getWorkflowEngineErrorCode, getWorkflowEngineErrorInfo, ofType };
|
|
2384
2643
|
//# sourceMappingURL=acorex-platform-workflow.mjs.map
|