@acorex/platform 20.6.0-next.0 → 20.6.0-next.2

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 (116) hide show
  1. package/common/index.d.ts +5 -1
  2. package/core/index.d.ts +443 -3
  3. package/fesm2022/acorex-platform-auth.mjs +19 -19
  4. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  5. package/fesm2022/{acorex-platform-common-common-settings.provider-9OHien_H.mjs → acorex-platform-common-common-settings.provider-CLb2KMfv.mjs} +4 -4
  6. package/fesm2022/acorex-platform-common-common-settings.provider-CLb2KMfv.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-common.mjs +104 -104
  8. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-core.mjs +460 -55
  10. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-domain.mjs +37 -38
  12. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-builder.mjs +22 -18
  14. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-components.mjs +444 -262
  16. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-designer.mjs +84 -84
  18. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  19. package/fesm2022/{acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs → acorex-platform-layout-entity-create-entity.command-BsLbiAdA.mjs} +4 -4
  20. package/fesm2022/acorex-platform-layout-entity-create-entity.command-BsLbiAdA.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-layout-entity.mjs +150 -148
  22. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-layout-views.mjs +20 -20
  24. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-layout-widget-core.mjs +144 -123
  26. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  27. package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C_3IWNkj.mjs → acorex-platform-layout-widgets-button-widget-designer.component-lHfg4JFJ.mjs} +4 -4
  28. package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-lHfg4JFJ.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CJltEgut.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CMSnecnD.mjs} +4 -4
  30. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CMSnecnD.mjs.map +1 -0
  31. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-pM-TIuk0.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-DN-sIFYe.mjs} +4 -4
  32. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-DN-sIFYe.mjs.map +1 -0
  33. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-BqI96-fU.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-Bn9w0SEz.mjs} +4 -4
  34. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-Bn9w0SEz.mjs.map +1 -0
  35. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-view.component-C-AhenaM.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-view.component-B8mgcvoX.mjs} +4 -4
  36. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-B8mgcvoX.mjs.map +1 -0
  37. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-edit.component-DCAya5ne.mjs → acorex-platform-layout-widgets-extra-properties-widget-edit.component-Bhof2SY8.mjs} +4 -4
  38. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-Bhof2SY8.mjs.map +1 -0
  39. package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-view.component-D-PnBqLb.mjs → acorex-platform-layout-widgets-extra-properties-widget-view.component-CeQIvKVV.mjs} +4 -4
  40. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-CeQIvKVV.mjs.map +1 -0
  41. package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-CGEHOyKT.mjs → acorex-platform-layout-widgets-file-list-popup.component-BOP7jFp4.mjs} +5 -5
  42. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-BOP7jFp4.mjs.map +1 -0
  43. package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-Bss0xUcu.mjs → acorex-platform-layout-widgets-page-widget-designer.component-C57lyBs3.mjs} +4 -4
  44. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-C57lyBs3.mjs.map +1 -0
  45. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Cy9mHnNP.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-fr77M8Z0.mjs} +5 -5
  46. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-fr77M8Z0.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-DznLtuer.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-CvZTRhct.mjs} +4 -4
  48. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-CvZTRhct.mjs.map +1 -0
  49. package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-ndOUSFi9.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-DHES_0ot.mjs} +4 -4
  50. package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-DHES_0ot.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-layout-widgets.mjs +1506 -617
  52. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  53. package/fesm2022/acorex-platform-native.mjs +7 -7
  54. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  55. package/fesm2022/acorex-platform-runtime.mjs +49 -42
  56. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  57. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-B1PT6FtZ.mjs → acorex-platform-themes-default-entity-master-create-view.component-C_XmJV7Y.mjs} +5 -5
  58. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-C_XmJV7Y.mjs.map +1 -0
  59. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-ccqB5ShI.mjs → acorex-platform-themes-default-entity-master-list-view.component-BkY9HXcT.mjs} +51 -17
  60. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BkY9HXcT.mjs.map +1 -0
  61. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-4g19A3eI.mjs → acorex-platform-themes-default-entity-master-modify-view.component-DJPDil7w.mjs} +5 -5
  62. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-DJPDil7w.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B8gx5cG7.mjs → acorex-platform-themes-default-entity-master-single-view.component-BArdGNfr.mjs} +8 -8
  64. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BArdGNfr.mjs.map +1 -0
  65. package/fesm2022/{acorex-platform-themes-default-error-401.component-CcvGfdhu.mjs → acorex-platform-themes-default-error-401.component-D7rEInHg.mjs} +4 -4
  66. package/fesm2022/acorex-platform-themes-default-error-401.component-D7rEInHg.mjs.map +1 -0
  67. package/fesm2022/{acorex-platform-themes-default-error-404.component-4-CaEsnV.mjs → acorex-platform-themes-default-error-404.component-BTZlVrd8.mjs} +4 -4
  68. package/fesm2022/acorex-platform-themes-default-error-404.component-BTZlVrd8.mjs.map +1 -0
  69. package/fesm2022/acorex-platform-themes-default-error-offline.component-BhvEi6nX.mjs +19 -0
  70. package/fesm2022/acorex-platform-themes-default-error-offline.component-BhvEi6nX.mjs.map +1 -0
  71. package/fesm2022/acorex-platform-themes-default.mjs +39 -39
  72. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  73. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-Dc_Txe32.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BXV40gay.mjs} +4 -4
  74. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BXV40gay.mjs.map +1 -0
  75. package/fesm2022/{acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs → acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs} +18 -18
  76. package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +1 -0
  77. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-hgWLhhle.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-BpIf4s53.mjs} +4 -4
  78. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-BpIf4s53.mjs.map +1 -0
  79. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-CY3JZK_W.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-C9gvfQfX.mjs} +4 -4
  80. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-C9gvfQfX.mjs.map +1 -0
  81. package/fesm2022/acorex-platform-themes-shared.mjs +55 -55
  82. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  83. package/fesm2022/acorex-platform-workflow.mjs +1476 -28
  84. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  85. package/layout/builder/index.d.ts +6 -2
  86. package/layout/components/index.d.ts +25 -1
  87. package/layout/widget-core/index.d.ts +7 -0
  88. package/layout/widgets/index.d.ts +169 -13
  89. package/package.json +9 -9
  90. package/workflow/index.d.ts +1536 -3
  91. package/fesm2022/acorex-platform-common-common-settings.provider-9OHien_H.mjs.map +0 -1
  92. package/fesm2022/acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs.map +0 -1
  93. package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C_3IWNkj.mjs.map +0 -1
  94. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CJltEgut.mjs.map +0 -1
  95. package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-pM-TIuk0.mjs.map +0 -1
  96. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-BqI96-fU.mjs.map +0 -1
  97. package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-C-AhenaM.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-DCAya5ne.mjs.map +0 -1
  99. package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-D-PnBqLb.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CGEHOyKT.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-Bss0xUcu.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Cy9mHnNP.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-DznLtuer.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-ndOUSFi9.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-B1PT6FtZ.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-ccqB5ShI.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-4g19A3eI.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B8gx5cG7.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-themes-default-error-401.component-CcvGfdhu.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-themes-default-error-404.component-4-CaEsnV.mjs.map +0 -1
  111. package/fesm2022/acorex-platform-themes-default-error-offline.component-BNecbFEj.mjs +0 -19
  112. package/fesm2022/acorex-platform-themes-default-error-offline.component-BNecbFEj.mjs.map +0 -1
  113. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-Dc_Txe32.mjs.map +0 -1
  114. package/fesm2022/acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs.map +0 -1
  115. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-hgWLhhle.mjs.map +0 -1
  116. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-CY3JZK_W.mjs.map +0 -1
@@ -1,8 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, Optional, Inject, NgModule } from '@angular/core';
2
+ import { Injectable, inject, InjectionToken, Optional, SkipSelf, Inject, NgModule } from '@angular/core';
3
3
  import { Subject, filter } from 'rxjs';
4
4
  import { cloneDeep, get, set } from 'lodash-es';
5
5
  import { setSmart } from '@acorex/platform/core';
6
+ import { AXPCommandService, AXPCommandRegistry, AXPQueryService, provideCommandSetups, AXP_COMMAND_SETUP } from '@acorex/platform/runtime';
7
+ import { AXDialogService } from '@acorex/components/dialog';
8
+ import { AXTranslationService } from '@acorex/core/translation';
9
+ import { AXToastService } from '@acorex/components/toast';
10
+ import { Router } from '@angular/router';
6
11
 
7
12
  class AXPWorkflowError extends Error {
8
13
  constructor(message, inner = null) {
@@ -22,10 +27,10 @@ class AXPWorkflowEventService {
22
27
  get events$() {
23
28
  return this.eventSubject.asObservable();
24
29
  }
25
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
26
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowEventService, providedIn: 'root' }); }
30
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowEventService, providedIn: 'root' }); }
27
32
  }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowEventService, decorators: [{
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowEventService, decorators: [{
29
34
  type: Injectable,
30
35
  args: [{
31
36
  providedIn: 'root',
@@ -115,10 +120,10 @@ class AXPWorkflowRegistryService {
115
120
  });
116
121
  }
117
122
  }
118
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
119
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowRegistryService, providedIn: 'root' }); }
123
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
124
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowRegistryService, providedIn: 'root' }); }
120
125
  }
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowRegistryService, decorators: [{
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowRegistryService, decorators: [{
122
127
  type: Injectable,
123
128
  args: [{
124
129
  providedIn: 'root',
@@ -157,17 +162,17 @@ class AXPWorkflowAction {
157
162
  dispatch(event) {
158
163
  this.eventService.dispatch(event);
159
164
  }
160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowAction, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
161
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowAction }); }
165
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowAction, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
166
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowAction }); }
162
167
  }
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowAction, decorators: [{
168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowAction, decorators: [{
164
169
  type: Injectable
165
170
  }] });
166
171
  class AXPWorkflowFunction {
167
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowFunction, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
168
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowFunction }); }
172
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowFunction, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
173
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowFunction }); }
169
174
  }
170
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowFunction, decorators: [{
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowFunction, decorators: [{
171
176
  type: Injectable
172
177
  }] });
173
178
  function createWorkFlowEvent(type) {
@@ -183,10 +188,10 @@ class AXPWorkflowDecideAction extends AXPWorkflowAction {
183
188
  async execute(context) {
184
189
  // its a fake action
185
190
  }
186
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowDecideAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
187
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowDecideAction, providedIn: 'root' }); }
191
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowDecideAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
192
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowDecideAction, providedIn: 'root' }); }
188
193
  }
189
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowDecideAction, decorators: [{
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowDecideAction, decorators: [{
190
195
  type: Injectable,
191
196
  args: [{
192
197
  providedIn: 'root',
@@ -372,10 +377,10 @@ class AXPWorkflowService {
372
377
  }
373
378
  return this.injector.get(functionType);
374
379
  }
375
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowService, deps: [{ token: AXPWorkflowRegistryService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
376
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowService, providedIn: 'root' }); }
380
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowService, deps: [{ token: AXPWorkflowRegistryService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
381
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowService, providedIn: 'root' }); }
377
382
  }
378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowService, decorators: [{
383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowService, decorators: [{
379
384
  type: Injectable,
380
385
  args: [{
381
386
  providedIn: 'root',
@@ -400,21 +405,1456 @@ class AXPStartWorkflowAction extends AXPWorkflowAction {
400
405
  throw e;
401
406
  }
402
407
  }
403
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPStartWorkflowAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
404
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPStartWorkflowAction, providedIn: 'root' }); }
408
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPStartWorkflowAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
409
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPStartWorkflowAction, providedIn: 'root' }); }
405
410
  }
406
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPStartWorkflowAction, decorators: [{
411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPStartWorkflowAction, decorators: [{
407
412
  type: Injectable,
408
413
  args: [{
409
414
  providedIn: 'root',
410
415
  }]
411
416
  }] });
412
417
 
418
+ /**
419
+ * Base abstract class for activities.
420
+ * Extend this to create custom activities.
421
+ */
422
+ class Activity {
423
+ constructor(type, name) {
424
+ this.type = type;
425
+ this.name = name;
426
+ }
427
+ /**
428
+ * Helper method that returns Done outcome by default.
429
+ */
430
+ createResult(output, outcome = 'Done') {
431
+ return {
432
+ output,
433
+ outcomes: { [outcome]: true }
434
+ };
435
+ }
436
+ }
437
+ /**
438
+ * Activity registry for registering and creating activities.
439
+ */
440
+ class ActivityRegistry {
441
+ constructor() {
442
+ this.registry = new Map();
443
+ this.descriptors = new Map();
444
+ }
445
+ /**
446
+ * Register an activity type.
447
+ */
448
+ register(type, factory, descriptor) {
449
+ this.registry.set(type, factory);
450
+ this.descriptors.set(type, descriptor);
451
+ }
452
+ /**
453
+ * Create an activity instance.
454
+ */
455
+ create(type) {
456
+ const factory = this.registry.get(type);
457
+ if (!factory) {
458
+ throw new Error(`Unknown activity type: ${type}`);
459
+ }
460
+ return factory();
461
+ }
462
+ /**
463
+ * Get activity descriptor.
464
+ */
465
+ getDescriptor(type) {
466
+ return this.descriptors.get(type);
467
+ }
468
+ /**
469
+ * Get all registered types.
470
+ */
471
+ getTypes() {
472
+ return Array.from(this.registry.keys());
473
+ }
474
+ /**
475
+ * Get all descriptors.
476
+ */
477
+ getAllDescriptors() {
478
+ return Array.from(this.descriptors.values());
479
+ }
480
+ /**
481
+ * Get descriptors by category.
482
+ */
483
+ getDescriptorsByCategory(category) {
484
+ return this.getAllDescriptors().filter(d => d.category === category);
485
+ }
486
+ }
487
+
488
+ /**
489
+ * Injection token for activity providers.
490
+ */
491
+ const AXP_ACTIVITY_PROVIDER = new InjectionToken('AXP_ACTIVITY_PROVIDER');
492
+ /**
493
+ * Activity Provider Service.
494
+ * Collects all activity providers and manages activity registration.
495
+ */
496
+ class AXPActivityProviderService {
497
+ constructor() {
498
+ this.activityDescriptors = new Map();
499
+ this.categories = [];
500
+ this.providers = [];
501
+ this.categoryProviders = [];
502
+ this.initialized = false;
503
+ this.commandService = inject(AXPCommandService);
504
+ this.commandRegistry = inject(AXPCommandRegistry);
505
+ }
506
+ /**
507
+ * Register an activity provider.
508
+ */
509
+ registerProvider(provider) {
510
+ this.providers.push(provider);
511
+ if (this.initialized) {
512
+ this.initializeProvider(provider);
513
+ }
514
+ }
515
+ /**
516
+ * Register a category provider.
517
+ */
518
+ registerCategoryProvider(provider) {
519
+ this.categoryProviders.push(provider);
520
+ if (this.initialized) {
521
+ this.initializeCategoryProvider(provider);
522
+ }
523
+ }
524
+ /**
525
+ * Initialize all providers.
526
+ */
527
+ async initialize() {
528
+ if (this.initialized)
529
+ return;
530
+ // Initialize category providers first
531
+ for (const provider of this.categoryProviders) {
532
+ await this.initializeCategoryProvider(provider);
533
+ }
534
+ // Initialize activity providers
535
+ for (const provider of this.providers) {
536
+ await this.initializeProvider(provider);
537
+ }
538
+ this.initialized = true;
539
+ }
540
+ /**
541
+ * Get activity descriptor by key.
542
+ */
543
+ getDescriptor(key) {
544
+ return this.activityDescriptors.get(key);
545
+ }
546
+ /**
547
+ * Get all activity descriptors.
548
+ */
549
+ getAllDescriptors() {
550
+ return Array.from(this.activityDescriptors.values());
551
+ }
552
+ /**
553
+ * Get descriptors by category.
554
+ */
555
+ getDescriptorsByCategory(category) {
556
+ return this.getAllDescriptors().filter(d => d.category === category);
557
+ }
558
+ /**
559
+ * Get all categories.
560
+ */
561
+ getCategories() {
562
+ return [...this.categories].sort((a, b) => (a.order || 999) - (b.order || 999));
563
+ }
564
+ /**
565
+ * Create an activity instance by key using AXPCommandService.
566
+ */
567
+ async createActivity(key) {
568
+ try {
569
+ // Check if command exists
570
+ if (!this.commandService.exists(key)) {
571
+ return null;
572
+ }
573
+ // Get command loader from registry
574
+ const loader = this.commandRegistry.getLoader(key);
575
+ if (!loader) {
576
+ return null;
577
+ }
578
+ // Create command instance
579
+ const command = await loader();
580
+ return command;
581
+ }
582
+ catch (error) {
583
+ return null;
584
+ }
585
+ }
586
+ // ============================================
587
+ // PRIVATE METHODS
588
+ // ============================================
589
+ async initializeProvider(provider) {
590
+ const context = {
591
+ registerActivity: (config) => {
592
+ this.activityDescriptors.set(config.key, config.descriptor);
593
+ }
594
+ };
595
+ await provider.provide(context);
596
+ }
597
+ async initializeCategoryProvider(provider) {
598
+ const context = {
599
+ registerCategories: (categories) => {
600
+ this.categories.push(...categories);
601
+ }
602
+ };
603
+ await provider.provide(context);
604
+ }
605
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPActivityProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
606
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPActivityProviderService, providedIn: 'root' }); }
607
+ }
608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPActivityProviderService, decorators: [{
609
+ type: Injectable,
610
+ args: [{
611
+ providedIn: 'root'
612
+ }]
613
+ }] });
614
+
615
+ /**
616
+ * Injection token for activity category providers.
617
+ */
618
+ const AXP_ACTIVITY_CATEGORY_PROVIDER = new InjectionToken('AXP_ACTIVITY_CATEGORY_PROVIDER');
619
+ class AXPActivityCategoryProviderService {
620
+ constructor(parent, providers = []) {
621
+ this.parent = parent;
622
+ this.providers = providers;
623
+ this.categories = new Map();
624
+ this.isInitialized = false;
625
+ if (!parent) {
626
+ this.initialize();
627
+ }
628
+ }
629
+ async initialize() {
630
+ if (this.isInitialized) {
631
+ return;
632
+ }
633
+ for (const provider of this.providers) {
634
+ await provider.provide({
635
+ registerCategories: (categories) => {
636
+ categories.forEach(cat => this.categories.set(cat.name, cat));
637
+ }
638
+ });
639
+ }
640
+ this.isInitialized = true;
641
+ }
642
+ getAllCategories() {
643
+ return Array.from(this.categories.values()).sort((a, b) => (a.order || 0) - (b.order || 0));
644
+ }
645
+ getCategory(name) {
646
+ return this.categories.get(name);
647
+ }
648
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPActivityCategoryProviderService, deps: [{ token: AXPActivityCategoryProviderService, optional: true, skipSelf: true }, { token: AXP_ACTIVITY_CATEGORY_PROVIDER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
649
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPActivityCategoryProviderService, providedIn: 'root' }); }
650
+ }
651
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPActivityCategoryProviderService, decorators: [{
652
+ type: Injectable,
653
+ args: [{ providedIn: 'root' }]
654
+ }], ctorParameters: () => [{ type: AXPActivityCategoryProviderService, decorators: [{
655
+ type: Optional
656
+ }, {
657
+ type: SkipSelf
658
+ }] }, { type: undefined, decorators: [{
659
+ type: Optional
660
+ }, {
661
+ type: Inject,
662
+ args: [AXP_ACTIVITY_CATEGORY_PROVIDER]
663
+ }] }] });
664
+
665
+ /**
666
+ * Abstract service for workflow execution operations.
667
+ *
668
+ * This service handles communication with backend for workflow execution.
669
+ *
670
+ * Implementation should be provided in connectivity layer:
671
+ * - Mock implementation: @acorex/connectivity/mock
672
+ * - API implementation: @acorex/connectivity/api
673
+ *
674
+ * @example
675
+ * ```typescript
676
+ * // In connectivity/mock
677
+ * @Injectable()
678
+ * export class AXCWorkflowExecutionService implements AXPWorkflowExecutionService {
679
+ * async startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse> {
680
+ * // Mock implementation
681
+ * }
682
+ * }
683
+ *
684
+ * // In connectivity/api
685
+ * @Injectable()
686
+ * export class AXCWorkflowExecutionService implements AXPWorkflowExecutionService {
687
+ * constructor(private http: HttpClient) {}
688
+ *
689
+ * async startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse> {
690
+ * return firstValueFrom(
691
+ * this.http.post<AXPStartWorkflowExecutionResponse>(
692
+ * `${this.config.baseUrl}/api/workflows/${request.workflowId}/start`,
693
+ * { input: request.input }
694
+ * )
695
+ * );
696
+ * }
697
+ * }
698
+ * ```
699
+ */
700
+ class AXPWorkflowExecutionService {
701
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowExecutionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
702
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowExecutionService }); }
703
+ }
704
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowExecutionService, decorators: [{
705
+ type: Injectable
706
+ }] });
707
+
708
+ //#endregion
709
+ /**
710
+ * Production Workflow Coordinator.
711
+ *
712
+ * Separates frontend/backend execution:
713
+ * - Frontend activities: Execute with AXPCommand in browser
714
+ * - Backend activities: Execute via API calls to backend
715
+ * - State caching: Caches workflow state in client for performance
716
+ *
717
+ * ✅ Suitable for production use.
718
+ */
719
+ class WorkflowCoordinator {
720
+ constructor() {
721
+ //#region ---- Services & Dependencies ----
722
+ this.workflowExecutionService = inject(AXPWorkflowExecutionService);
723
+ this.commandService = inject(AXPCommandService);
724
+ //#endregion
725
+ //#region ---- State Cache (Client-side for Performance) ----
726
+ /**
727
+ * Cache workflow states in memory for quick access.
728
+ * Key: executionId
729
+ * Value: AXPWorkflowExecutionState
730
+ */
731
+ this.stateCache = new Map();
732
+ }
733
+ //#endregion
734
+ //#region ---- Public Methods ----
735
+ /**
736
+ * Start workflow execution in backend.
737
+ *
738
+ * Backend decides what to do: returns pendingTask or indicates completion.
739
+ * Frontend only calls API - no business logic here.
740
+ *
741
+ * @param workflowId - Workflow ID
742
+ * @param input - Initial input data
743
+ * @returns Execution result with pendingTask (if any)
744
+ *
745
+ * @example
746
+ * ```typescript
747
+ * const result = await coordinator.startWorkflow('my-workflow', { userId: '123' });
748
+ *
749
+ * if (result.pendingTask) {
750
+ * // Execute task if frontend, or wait for backend to complete
751
+ * if (result.pendingTask.executionMode === 'frontend') {
752
+ * await coordinator.executeTask(result.pendingTask);
753
+ * await coordinator.completeTask(result.executionId, result.pendingTask, outcome, output);
754
+ * }
755
+ * }
756
+ * ```
757
+ */
758
+ async startWorkflow(workflowId, input = {}) {
759
+ try {
760
+ const execution = await this.startWorkflowExecution(workflowId, input);
761
+ return {
762
+ success: true,
763
+ output: execution.state.output,
764
+ nextTask: execution.pendingTask || null,
765
+ executionId: execution.executionId,
766
+ state: execution.state
767
+ };
768
+ }
769
+ catch (error) {
770
+ return {
771
+ success: false,
772
+ error: error.message || 'Failed to start workflow',
773
+ nextTask: null
774
+ };
775
+ }
776
+ }
777
+ /**
778
+ * Execute a frontend task using AXPCommand.
779
+ *
780
+ * Only executes if task.executionMode is 'frontend' or 'both'.
781
+ * Backend tasks are handled automatically by backend.
782
+ *
783
+ * @param task - Task to execute
784
+ * @returns Execution result with output and outcome
785
+ */
786
+ async executeTask(task) {
787
+ // Only execute frontend tasks
788
+ if (task.executionMode !== 'frontend' && task.executionMode !== 'both') {
789
+ throw new Error(`Task '${task.activityId}' is not a frontend task. Backend handles it automatically.`);
790
+ }
791
+ return await this.executeFrontendActivity(task);
792
+ }
793
+ /**
794
+ * Complete a task and get next task from backend.
795
+ *
796
+ * Sends task result to backend API.
797
+ * Backend decides: next task, fail, or complete workflow.
798
+ *
799
+ * @param executionId - Execution ID
800
+ * @param task - Completed task
801
+ * @param outcome - Task outcome (e.g., 'Done', 'Confirmed', 'Cancelled')
802
+ * @param output - Task output/result
803
+ * @returns Next task from backend (if any)
804
+ */
805
+ async completeTask(executionId, task, outcome, output) {
806
+ try {
807
+ // Send result to backend - backend decides next step
808
+ const response = await this.workflowExecutionService.resumeExecution({
809
+ executionId,
810
+ stepId: task.activityId,
811
+ outcome,
812
+ userInput: output
813
+ });
814
+ // Update cache
815
+ if (response.state) {
816
+ this.stateCache.set(executionId, response.state);
817
+ }
818
+ return {
819
+ success: true,
820
+ output: response.output,
821
+ nextTask: response.nextTask || null,
822
+ executionId,
823
+ state: response.state
824
+ };
825
+ }
826
+ catch (error) {
827
+ return {
828
+ success: false,
829
+ error: error.message || 'Failed to complete task',
830
+ nextTask: null
831
+ };
832
+ }
833
+ }
834
+ /**
835
+ * Execute workflow by ID (backward compatibility).
836
+ *
837
+ * @deprecated Use startWorkflow + executeTask + completeTask pattern instead.
838
+ * This method is kept for backward compatibility but will be removed.
839
+ */
840
+ async executeWorkflowById(workflowId, input = {}) {
841
+ // Just start workflow - caller should handle task execution
842
+ return await this.startWorkflow(workflowId, input);
843
+ }
844
+ /**
845
+ * Resume a suspended workflow (e.g., after user interaction).
846
+ *
847
+ * Backend determines nextStep based on outcome and outcomeConnections.
848
+ * Client only provides executionId, stepId, outcome, and optional userInput.
849
+ *
850
+ * @param executionId - Workflow execution ID
851
+ * @param stepId - Step ID that was waiting for user input
852
+ * @param outcome - User action outcome (e.g., 'Confirmed', 'Cancelled', 'Submitted')
853
+ * @param userInput - Optional user input data
854
+ */
855
+ async resumeWorkflow(executionId, stepId, outcome, userInput) {
856
+ try {
857
+ // Backend handles everything: checks outcomeConnections and determines nextStep
858
+ const response = await this.workflowExecutionService.resumeExecution({
859
+ executionId,
860
+ stepId,
861
+ outcome,
862
+ userInput
863
+ });
864
+ // Update cache with state from backend
865
+ if (response.state) {
866
+ this.stateCache.set(executionId, response.state);
867
+ }
868
+ return {
869
+ success: true,
870
+ output: response.output,
871
+ nextTask: response.nextTask || null, // Backend determines this from outcomeConnections
872
+ executionId,
873
+ state: response.state
874
+ };
875
+ }
876
+ catch (error) {
877
+ return {
878
+ success: false,
879
+ error: error.message || 'Failed to resume workflow',
880
+ nextTask: null
881
+ };
882
+ }
883
+ }
884
+ /**
885
+ * Get workflow execution state (from cache or backend).
886
+ */
887
+ async getWorkflowState(executionId) {
888
+ // Check cache first
889
+ const cached = this.stateCache.get(executionId);
890
+ if (cached) {
891
+ // Cache is valid for 5 minutes
892
+ const cacheAge = Date.now() - cached.lastUpdated.getTime();
893
+ if (cacheAge < 5 * 60 * 1000) {
894
+ return cached;
895
+ }
896
+ }
897
+ // Fetch from backend
898
+ try {
899
+ const state = await this.workflowExecutionService.getExecutionState({
900
+ executionId
901
+ });
902
+ // Update cache
903
+ this.stateCache.set(executionId, state);
904
+ return state;
905
+ }
906
+ catch {
907
+ return null;
908
+ }
909
+ }
910
+ /**
911
+ * Start step-based execution (only current step, not full workflow).
912
+ *
913
+ * Use this when you only need to execute one step at a time.
914
+ * Perfect for form-based workflows where user interacts with forms.
915
+ *
916
+ * @param workflowId - Workflow ID
917
+ * @param stepId - Initial step ID to execute
918
+ * @param input - Initial input data
919
+ * @returns Execution info with executionId and initial state
920
+ *
921
+ * @example
922
+ * ```typescript
923
+ * // Start login form step
924
+ * const execution = await coordinator.startStepExecution(
925
+ * 'login-workflow',
926
+ * 'login-form-step',
927
+ * {}
928
+ * );
929
+ *
930
+ * // Save executionId for resume after refresh
931
+ * localStorage.setItem('execution-id', execution.executionId);
932
+ * ```
933
+ */
934
+ async startStepExecution(workflowId, stepId, input = {}) {
935
+ // Start workflow execution in backend
936
+ const execution = await this.startWorkflowExecution(workflowId, input);
937
+ // Update state with current step
938
+ const stateWithStep = {
939
+ ...execution.state,
940
+ currentStepId: stepId,
941
+ status: 'running'
942
+ };
943
+ // Update cache
944
+ this.stateCache.set(execution.executionId, stateWithStep);
945
+ return {
946
+ executionId: execution.executionId,
947
+ state: stateWithStep
948
+ };
949
+ }
950
+ /**
951
+ * Get next task from backend after backend task completion.
952
+ *
953
+ * Use this when backend task completes - backend will return next task.
954
+ * For frontend tasks, use executeTask + completeTask instead.
955
+ *
956
+ * @param executionId - Execution ID
957
+ * @returns Next task from backend (if any)
958
+ */
959
+ async getNextTask(executionId) {
960
+ try {
961
+ // Backend handles everything: executes backend tasks and returns next task
962
+ const response = await this.workflowExecutionService.executeCurrentStep({
963
+ executionId
964
+ });
965
+ // Update cache
966
+ if (response.state) {
967
+ this.stateCache.set(executionId, response.state);
968
+ }
969
+ return {
970
+ success: true,
971
+ output: response.output,
972
+ nextTask: response.nextTask || null,
973
+ executionId,
974
+ state: response.state
975
+ };
976
+ }
977
+ catch (error) {
978
+ return {
979
+ success: false,
980
+ error: error.message || 'Failed to get next task',
981
+ nextTask: null
982
+ };
983
+ }
984
+ }
985
+ //#endregion
986
+ //#region ---- Private Methods ----
987
+ /**
988
+ * Execute a frontend activity using CommandBus.
989
+ *
990
+ * Frontend activities are executed in the browser using AXPCommandService.
991
+ * Activities can also be executed in both frontend and backend (hybrid mode).
992
+ *
993
+ * @param task - Frontend task to execute
994
+ * @returns Execution result with output and outcome
995
+ */
996
+ async executeFrontendActivity(task) {
997
+ try {
998
+ // Check if command exists
999
+ if (!this.commandService.exists(task.activityType)) {
1000
+ console.warn(`[WorkflowCoordinator] Frontend activity '${task.activityType}' is not registered. Skipping execution.`);
1001
+ return {
1002
+ output: null,
1003
+ outcome: 'Done'
1004
+ };
1005
+ }
1006
+ // Execute activity via CommandBus
1007
+ // Activities registered as AXPCommand return {output, outcomes}
1008
+ const result = await this.commandService.execute(task.activityType, task.input || task.config || {});
1009
+ // Extract outcome from outcomes (usually 'Done' or first key)
1010
+ let outcome = 'Done';
1011
+ if (result?.outcomes) {
1012
+ // Prefer 'Done' if exists, otherwise use first outcome key
1013
+ outcome = result.outcomes['Done'] ? 'Done' : Object.keys(result.outcomes)[0] || 'Done';
1014
+ }
1015
+ return {
1016
+ output: result?.output || result,
1017
+ outcome
1018
+ };
1019
+ }
1020
+ catch (error) {
1021
+ console.error(`[WorkflowCoordinator] Error executing frontend activity '${task.activityType}':`, error);
1022
+ return {
1023
+ output: { error: error.message || 'Unknown error' },
1024
+ outcome: 'Failed'
1025
+ };
1026
+ }
1027
+ }
1028
+ /**
1029
+ * Start workflow execution in backend.
1030
+ * Backend returns executionId, initial state, and first task to execute.
1031
+ */
1032
+ async startWorkflowExecution(workflowId, input) {
1033
+ const response = await this.workflowExecutionService.startExecution({
1034
+ workflowId,
1035
+ input
1036
+ });
1037
+ // Cache state
1038
+ this.stateCache.set(response.executionId, response.state);
1039
+ return {
1040
+ executionId: response.executionId,
1041
+ state: response.state,
1042
+ pendingTask: response.pendingTask
1043
+ };
1044
+ }
1045
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WorkflowCoordinator, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1046
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WorkflowCoordinator, providedIn: 'root' }); }
1047
+ }
1048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WorkflowCoordinator, decorators: [{
1049
+ type: Injectable,
1050
+ args: [{
1051
+ providedIn: 'root'
1052
+ }]
1053
+ }] });
1054
+
1055
+ /**
1056
+ * Types and interfaces for Workflow Execution Service.
1057
+ */
1058
+
1059
+ // Production Workflow Coordinator (Frontend/Backend Separation)
1060
+
1061
+ /**
1062
+ * WriteLine Activity - Simple console logging activity.
1063
+ *
1064
+ * Usage:
1065
+ * ```typescript
1066
+ * const activity = new WriteLine();
1067
+ * await activity.execute({ text: 'Hello World' });
1068
+ * ```
1069
+ */
1070
+ class WriteLine extends Activity {
1071
+ constructor() {
1072
+ super('WriteLine');
1073
+ }
1074
+ async execute(input) {
1075
+ const text = input.text || '';
1076
+ if (text !== undefined && text !== null) {
1077
+ console.log(`[WriteLine] ${text}`);
1078
+ }
1079
+ return this.createResult(undefined, 'Done');
1080
+ }
1081
+ }
1082
+
1083
+ var writeLine_activity = /*#__PURE__*/Object.freeze({
1084
+ __proto__: null,
1085
+ WriteLine: WriteLine
1086
+ });
1087
+
1088
+ /**
1089
+ * Sequence Activity - Executes activities in sequential order.
1090
+ *
1091
+ * Usage:
1092
+ * ```typescript
1093
+ * const sequence = new Sequence();
1094
+ * sequence.activities = [activity1, activity2, activity3];
1095
+ * await sequence.execute({});
1096
+ * ```
1097
+ */
1098
+ class Sequence extends Activity {
1099
+ constructor() {
1100
+ super('Sequence');
1101
+ /**
1102
+ * Activities to execute in sequence.
1103
+ */
1104
+ this.activities = [];
1105
+ }
1106
+ async execute(input) {
1107
+ // Execute all activities in sequence
1108
+ for (const activity of this.activities) {
1109
+ await activity.execute(input);
1110
+ }
1111
+ return this.createResult(undefined, 'Done');
1112
+ }
1113
+ }
1114
+
1115
+ var sequence_activity = /*#__PURE__*/Object.freeze({
1116
+ __proto__: null,
1117
+ Sequence: Sequence
1118
+ });
1119
+
1120
+ /**
1121
+ * Show Confirm Dialog Activity - Displays confirmation dialog to user.
1122
+ *
1123
+ * Has two outcomes:
1124
+ * - 'Confirmed': User clicked confirm/yes
1125
+ * - 'Cancelled': User clicked cancel/no
1126
+ *
1127
+ * Usage:
1128
+ * ```typescript
1129
+ * const dialog = new ShowConfirmDialog();
1130
+ * await dialog.execute({
1131
+ * title: 'Confirm Delete',
1132
+ * message: 'Are you sure?',
1133
+ * color: 'danger'
1134
+ * });
1135
+ * ```
1136
+ */
1137
+ class ShowConfirmDialog extends Activity {
1138
+ //#endregion
1139
+ constructor() {
1140
+ super('ShowConfirmDialog');
1141
+ //#region ---- Services & Dependencies ----
1142
+ this.dialogService = inject(AXDialogService);
1143
+ this.translationService = inject(AXTranslationService);
1144
+ }
1145
+ async execute(input) {
1146
+ const { title = '', message = '', color = 'primary', defaultAction = 'cancel', align = 'horizontal', backdrop = false } = input;
1147
+ // Translate title and message only if they start with '@' (translation key)
1148
+ // Otherwise use the text as-is
1149
+ const translatedTitle = title
1150
+ ? (title.startsWith('@')
1151
+ ? await this.translationService.translateAsync(title) || title
1152
+ : title)
1153
+ : '';
1154
+ const translatedMessage = message
1155
+ ? (message.startsWith('@')
1156
+ ? await this.translationService.translateAsync(message) || message
1157
+ : message)
1158
+ : '';
1159
+ try {
1160
+ const confirmResult = await this.dialogService.confirm(translatedTitle, translatedMessage, color, align, backdrop, defaultAction);
1161
+ const result = confirmResult.result;
1162
+ const action = result ? 'confirm' : 'cancel';
1163
+ return this.createResult({
1164
+ result,
1165
+ action
1166
+ }, result ? 'Confirmed' : 'Cancelled');
1167
+ }
1168
+ catch (err) {
1169
+ console.error('[ShowConfirmDialog] Error showing dialog:', err);
1170
+ return this.createResult({
1171
+ result: false,
1172
+ action: 'error'
1173
+ }, 'Cancelled');
1174
+ }
1175
+ }
1176
+ }
1177
+
1178
+ var showConfirmDialog_activity = /*#__PURE__*/Object.freeze({
1179
+ __proto__: null,
1180
+ ShowConfirmDialog: ShowConfirmDialog
1181
+ });
1182
+
1183
+ /**
1184
+ * Show Alert Dialog Activity - Displays alert dialog to user.
1185
+ *
1186
+ * Has one outcome:
1187
+ * - 'Done': User clicked OK
1188
+ *
1189
+ * Usage:
1190
+ * ```typescript
1191
+ * const dialog = new ShowAlertDialog();
1192
+ * await dialog.execute({
1193
+ * title: 'Alert',
1194
+ * message: 'This is an alert',
1195
+ * color: 'info'
1196
+ * });
1197
+ * ```
1198
+ */
1199
+ class ShowAlertDialog extends Activity {
1200
+ //#endregion
1201
+ constructor() {
1202
+ super('ShowAlertDialog');
1203
+ //#region ---- Services & Dependencies ----
1204
+ this.dialogService = inject(AXDialogService);
1205
+ this.translationService = inject(AXTranslationService);
1206
+ }
1207
+ async execute(input) {
1208
+ const { title = '', message = '', color = 'primary' } = input;
1209
+ // Translate title and message only if they start with '@' (translation key)
1210
+ // Otherwise use the text as-is
1211
+ const translatedTitle = title
1212
+ ? (title.startsWith('@')
1213
+ ? await this.translationService.translateAsync(title) || title
1214
+ : title)
1215
+ : '';
1216
+ const translatedMessage = message
1217
+ ? (message.startsWith('@')
1218
+ ? await this.translationService.translateAsync(message) || message
1219
+ : message)
1220
+ : '';
1221
+ try {
1222
+ await this.dialogService.alert(translatedTitle, translatedMessage, color);
1223
+ return this.createResult({
1224
+ result: true,
1225
+ action: 'ok'
1226
+ }, 'Done');
1227
+ }
1228
+ catch (err) {
1229
+ console.error('[ShowAlertDialog] Error showing dialog:', err);
1230
+ return this.createResult({
1231
+ result: false,
1232
+ action: 'error'
1233
+ }, 'Done');
1234
+ }
1235
+ }
1236
+ }
1237
+
1238
+ var showAlertDialog_activity = /*#__PURE__*/Object.freeze({
1239
+ __proto__: null,
1240
+ ShowAlertDialog: ShowAlertDialog
1241
+ });
1242
+
1243
+ /**
1244
+ * Show Toast Activity - Displays toast notification to user.
1245
+ *
1246
+ * Usage:
1247
+ * ```typescript
1248
+ * const toast = new ShowToast();
1249
+ * await toast.execute({
1250
+ * color: 'success',
1251
+ * title: 'Success',
1252
+ * message: 'Operation completed successfully!'
1253
+ * });
1254
+ * ```
1255
+ */
1256
+ class ShowToast extends Activity {
1257
+ constructor() {
1258
+ super('ShowToast');
1259
+ this.toastService = inject(AXToastService);
1260
+ this.translationService = inject(AXTranslationService);
1261
+ }
1262
+ async execute(input) {
1263
+ const { color = 'primary', title = '', message = '', duration = 3000 } = input;
1264
+ // Translate title and message only if they start with '@' (translation key)
1265
+ // Otherwise use the text as-is
1266
+ const translatedTitle = title
1267
+ ? (title.startsWith('@')
1268
+ ? await this.translationService.translateAsync(title) || title
1269
+ : title)
1270
+ : '';
1271
+ const translatedMessage = message
1272
+ ? (message.startsWith('@')
1273
+ ? await this.translationService.translateAsync(message) || message
1274
+ : message)
1275
+ : '';
1276
+ try {
1277
+ await this.toastService.show({
1278
+ color: color,
1279
+ title: translatedTitle,
1280
+ content: translatedMessage,
1281
+ closeButton: true,
1282
+ timeOut: duration,
1283
+ timeOutProgress: true,
1284
+ });
1285
+ return this.createResult(undefined, 'Done');
1286
+ }
1287
+ catch (err) {
1288
+ console.error('[ShowToast] Error showing toast:', err);
1289
+ return this.createResult(undefined, 'Error');
1290
+ }
1291
+ }
1292
+ }
1293
+
1294
+ var showToast_activity = /*#__PURE__*/Object.freeze({
1295
+ __proto__: null,
1296
+ ShowToast: ShowToast
1297
+ });
1298
+
1299
+ /**
1300
+ * Navigate Activity - Navigates to different pages/routes.
1301
+ *
1302
+ * Usage:
1303
+ * ```typescript
1304
+ * const navigate = new Navigate();
1305
+ * await navigate.execute({
1306
+ * mode: 'route',
1307
+ * route: '/users',
1308
+ * params: { id: '123' }
1309
+ * });
1310
+ * ```
1311
+ */
1312
+ class Navigate extends Activity {
1313
+ constructor() {
1314
+ super('Navigate');
1315
+ this.router = inject(Router);
1316
+ }
1317
+ async execute(input) {
1318
+ const { mode = 'route', route = '', params = {}, queryParams = {}, entity = '', entityId = '', url = '' } = input;
1319
+ try {
1320
+ switch (mode) {
1321
+ case 'route':
1322
+ await this.router.navigate([route], { queryParams });
1323
+ break;
1324
+ case 'entity-details':
1325
+ const detailsRoute = `/entities/${entity}/details/${entityId}`;
1326
+ await this.router.navigate([detailsRoute], { queryParams });
1327
+ break;
1328
+ case 'entity-list':
1329
+ const listRoute = `/entities/${entity}`;
1330
+ await this.router.navigate([listRoute], { queryParams });
1331
+ break;
1332
+ case 'external':
1333
+ if (url) {
1334
+ window.open(url, '_blank');
1335
+ }
1336
+ break;
1337
+ default:
1338
+ console.error(`[Navigate] Unknown navigation mode: ${mode}`);
1339
+ return this.createResult(undefined, 'Error');
1340
+ }
1341
+ return this.createResult(undefined, 'Done');
1342
+ }
1343
+ catch (err) {
1344
+ console.error('[Navigate] Error navigating:', err);
1345
+ return this.createResult(undefined, 'Error');
1346
+ }
1347
+ }
1348
+ }
1349
+
1350
+ var navigate_activity = /*#__PURE__*/Object.freeze({
1351
+ __proto__: null,
1352
+ Navigate: Navigate
1353
+ });
1354
+
1355
+ /**
1356
+ * Set Variable Activity - Sets a variable value in workflow context.
1357
+ *
1358
+ * Usage:
1359
+ * ```typescript
1360
+ * const setVar = new SetVariable();
1361
+ * await setVar.execute({
1362
+ * variableName: 'userId',
1363
+ * value: '12345'
1364
+ * });
1365
+ * ```
1366
+ */
1367
+ class SetVariable extends Activity {
1368
+ constructor() {
1369
+ super('workflow-activity:set-variable', 'Set Variable');
1370
+ }
1371
+ async execute(input) {
1372
+ const { variableName, value } = input;
1373
+ try {
1374
+ // In a real implementation, this would set the variable in workflow context
1375
+ // For now, we'll just log it
1376
+ console.log(`[SetVariable] Setting ${variableName} = ${JSON.stringify(value)}`);
1377
+ return this.createResult(undefined, 'Done');
1378
+ }
1379
+ catch (err) {
1380
+ console.error('[SetVariable] Error setting variable:', err);
1381
+ return this.createResult(undefined, 'Error');
1382
+ }
1383
+ }
1384
+ }
1385
+
1386
+ var setVariable_activity = /*#__PURE__*/Object.freeze({
1387
+ __proto__: null,
1388
+ SetVariable: SetVariable
1389
+ });
1390
+
1391
+ /**
1392
+ * Dispatch Event Activity - Dispatches an event to the system.
1393
+ *
1394
+ * Usage:
1395
+ * ```typescript
1396
+ * const dispatch = new DispatchEvent();
1397
+ * await dispatch.execute({
1398
+ * eventName: 'user-created',
1399
+ * eventData: { userId: '123', name: 'John' }
1400
+ * });
1401
+ * ```
1402
+ */
1403
+ class DispatchEvent extends Activity {
1404
+ constructor() {
1405
+ super('DispatchEvent');
1406
+ }
1407
+ async execute(input) {
1408
+ const { eventName, eventData } = input;
1409
+ try {
1410
+ // In a real implementation, this would dispatch the event through an event bus
1411
+ // For now, we'll just log it
1412
+ console.log(`[DispatchEvent] Dispatching event: ${eventName}`, eventData);
1413
+ return this.createResult(undefined, 'Done');
1414
+ }
1415
+ catch (err) {
1416
+ console.error('[DispatchEvent] Error dispatching event:', err);
1417
+ return this.createResult(undefined, 'Error');
1418
+ }
1419
+ }
1420
+ }
1421
+
1422
+ var dispatchEvent_activity = /*#__PURE__*/Object.freeze({
1423
+ __proto__: null,
1424
+ DispatchEvent: DispatchEvent
1425
+ });
1426
+
1427
+ /**
1428
+ * If Activity - Conditional execution based on a condition.
1429
+ *
1430
+ * Usage:
1431
+ * ```typescript
1432
+ * const ifActivity = new If();
1433
+ * ifActivity.condition = '{{user.isAdmin}}';
1434
+ * ifActivity.thenActivities = [activity1, activity2];
1435
+ * ifActivity.elseActivities = [activity3];
1436
+ * ```
1437
+ */
1438
+ class If extends Activity {
1439
+ constructor() {
1440
+ super('If');
1441
+ }
1442
+ async execute(input) {
1443
+ const { condition, thenActivities = [], elseActivities = [] } = input;
1444
+ try {
1445
+ // Evaluate condition (simplified - in real implementation, use expression evaluator)
1446
+ const conditionResult = this.evaluateCondition(condition);
1447
+ let result;
1448
+ let activities;
1449
+ if (conditionResult) {
1450
+ activities = thenActivities;
1451
+ result = { branch: 'then' };
1452
+ }
1453
+ else {
1454
+ activities = elseActivities;
1455
+ result = { branch: 'else' };
1456
+ }
1457
+ // Execute activities in the chosen branch
1458
+ for (const activity of activities) {
1459
+ await activity.execute(input);
1460
+ }
1461
+ return this.createResult(result, conditionResult ? 'Then' : 'Else');
1462
+ }
1463
+ catch (err) {
1464
+ console.error('[If] Error evaluating condition:', err);
1465
+ return this.createResult({ branch: 'error' }, 'Error');
1466
+ }
1467
+ }
1468
+ evaluateCondition(condition) {
1469
+ if (typeof condition === 'boolean') {
1470
+ return condition;
1471
+ }
1472
+ if (typeof condition === 'string') {
1473
+ // Simple evaluation - in real implementation, use proper expression evaluator
1474
+ return condition === 'true' || condition === '1' || condition === 'yes';
1475
+ }
1476
+ return false;
1477
+ }
1478
+ }
1479
+
1480
+ var if_activity = /*#__PURE__*/Object.freeze({
1481
+ __proto__: null,
1482
+ If: If
1483
+ });
1484
+
1485
+ /**
1486
+ * While Activity - Loop execution while condition is true.
1487
+ *
1488
+ * Usage:
1489
+ * ```typescript
1490
+ * const whileActivity = new While();
1491
+ * whileActivity.condition = '{{counter < 10}}';
1492
+ * whileActivity.activities = [incrementActivity, logActivity];
1493
+ * ```
1494
+ */
1495
+ class While extends Activity {
1496
+ constructor() {
1497
+ super('While');
1498
+ }
1499
+ async execute(input) {
1500
+ const { condition, activities = [], maxIterations = 1000 } = input;
1501
+ try {
1502
+ let iteration = 0;
1503
+ let conditionResult = this.evaluateCondition(condition);
1504
+ while (conditionResult && iteration < maxIterations) {
1505
+ // Execute activities in the loop
1506
+ for (const activity of activities) {
1507
+ await activity.execute(input);
1508
+ }
1509
+ iteration++;
1510
+ conditionResult = this.evaluateCondition(condition);
1511
+ }
1512
+ const result = {
1513
+ iterations: iteration,
1514
+ completed: iteration < maxIterations
1515
+ };
1516
+ return this.createResult(result, 'Done');
1517
+ }
1518
+ catch (err) {
1519
+ console.error('[While] Error in loop execution:', err);
1520
+ return this.createResult({ iterations: 0, completed: false }, 'Error');
1521
+ }
1522
+ }
1523
+ evaluateCondition(condition) {
1524
+ if (typeof condition === 'boolean') {
1525
+ return condition;
1526
+ }
1527
+ if (typeof condition === 'string') {
1528
+ // Simple evaluation - in real implementation, use proper expression evaluator
1529
+ return condition === 'true' || condition === '1' || condition === 'yes';
1530
+ }
1531
+ return false;
1532
+ }
1533
+ }
1534
+
1535
+ var while_activity = /*#__PURE__*/Object.freeze({
1536
+ __proto__: null,
1537
+ While: While
1538
+ });
1539
+
1540
+ /**
1541
+ * ForEach Activity - Iterates over a collection of items.
1542
+ *
1543
+ * Usage:
1544
+ * ```typescript
1545
+ * const forEach = new ForEach();
1546
+ * await forEach.execute({
1547
+ * items: ['item1', 'item2', 'item3'],
1548
+ * activities: [processItemActivity]
1549
+ * });
1550
+ * ```
1551
+ */
1552
+ class ForEach extends Activity {
1553
+ constructor() {
1554
+ super('ForEach');
1555
+ }
1556
+ async execute(input) {
1557
+ const { items = [], activities = [], itemVariableName = 'currentItem', indexVariableName = 'currentIndex' } = input;
1558
+ try {
1559
+ const results = [];
1560
+ for (let index = 0; index < items.length; index++) {
1561
+ const currentItem = items[index];
1562
+ // Create context with current item and index
1563
+ const itemContext = {
1564
+ ...input,
1565
+ [itemVariableName]: currentItem,
1566
+ [indexVariableName]: index
1567
+ };
1568
+ // Execute activities for current item
1569
+ for (const activity of activities) {
1570
+ await activity.execute(itemContext);
1571
+ }
1572
+ results.push({
1573
+ item: currentItem,
1574
+ index,
1575
+ processed: true
1576
+ });
1577
+ }
1578
+ const result = {
1579
+ totalItems: items.length,
1580
+ processedItems: results.length,
1581
+ results
1582
+ };
1583
+ return this.createResult(result, 'Done');
1584
+ }
1585
+ catch (err) {
1586
+ console.error('[ForEach] Error in iteration:', err);
1587
+ return this.createResult({ totalItems: 0, processedItems: 0, results: [] }, 'Error');
1588
+ }
1589
+ }
1590
+ }
1591
+
1592
+ var forEach_activity = /*#__PURE__*/Object.freeze({
1593
+ __proto__: null,
1594
+ ForEach: ForEach
1595
+ });
1596
+
1597
+ /**
1598
+ * Execute Command Activity - Executes a command through Command Bus.
1599
+ *
1600
+ * Usage:
1601
+ * ```typescript
1602
+ * const executeCmd = new ExecuteCommand();
1603
+ * await executeCmd.execute({
1604
+ * commandKey: 'UserManagement.CreateUser',
1605
+ * input: { name: 'John', email: 'john@example.com' }
1606
+ * });
1607
+ * ```
1608
+ */
1609
+ class ExecuteCommand extends Activity {
1610
+ constructor() {
1611
+ super('workflow-activity:execute-command', 'Execute Command');
1612
+ this.commandService = inject(AXPCommandService);
1613
+ }
1614
+ async execute(input) {
1615
+ const { commandKey, input: commandInput = {} } = input;
1616
+ try {
1617
+ // Check if command exists
1618
+ if (!this.commandService.exists(commandKey)) {
1619
+ console.warn(`[ExecuteCommand] Command '${commandKey}' is not registered. Simulating execution.`);
1620
+ // Simulate command execution for unregistered commands
1621
+ const result = {
1622
+ commandKey,
1623
+ success: true,
1624
+ output: commandInput,
1625
+ executedAt: new Date().toISOString(),
1626
+ simulated: true
1627
+ };
1628
+ return this.createResult(result, 'Done');
1629
+ }
1630
+ // Execute command through Command Bus
1631
+ const result = await this.commandService.execute(commandKey, commandInput);
1632
+ return this.createResult({
1633
+ commandKey,
1634
+ success: true,
1635
+ output: result,
1636
+ executedAt: new Date().toISOString()
1637
+ }, 'Done');
1638
+ }
1639
+ catch (err) {
1640
+ console.error('[ExecuteCommand] Error executing command:', err);
1641
+ return this.createResult({
1642
+ commandKey,
1643
+ success: false,
1644
+ error: err instanceof Error ? err.message : 'Unknown error'
1645
+ }, 'Failed');
1646
+ }
1647
+ }
1648
+ }
1649
+
1650
+ var executeCommand_activity = /*#__PURE__*/Object.freeze({
1651
+ __proto__: null,
1652
+ ExecuteCommand: ExecuteCommand
1653
+ });
1654
+
1655
+ /**
1656
+ * Execute Query Activity - Executes a query through Query Bus.
1657
+ *
1658
+ * Usage:
1659
+ * ```typescript
1660
+ * const executeQuery = new ExecuteQuery();
1661
+ * await executeQuery.execute({
1662
+ * queryKey: 'UserManagement.GetUsers',
1663
+ * input: { page: 1, pageSize: 10 }
1664
+ * });
1665
+ * ```
1666
+ */
1667
+ class ExecuteQuery extends Activity {
1668
+ constructor() {
1669
+ super('workflow-activity:execute-query', 'Execute Query');
1670
+ this.queryService = inject(AXPQueryService);
1671
+ }
1672
+ async execute(input) {
1673
+ const { queryKey, input: queryInput = {} } = input;
1674
+ try {
1675
+ // Check if query exists
1676
+ if (!this.queryService.exists(queryKey)) {
1677
+ console.warn(`[ExecuteQuery] Query '${queryKey}' is not registered. Simulating execution.`);
1678
+ // Simulate query execution for unregistered queries
1679
+ const result = {
1680
+ queryKey,
1681
+ success: true,
1682
+ data: [],
1683
+ totalCount: 0,
1684
+ executedAt: new Date().toISOString(),
1685
+ simulated: true
1686
+ };
1687
+ return this.createResult(result, 'Done');
1688
+ }
1689
+ // Execute query through Query Bus
1690
+ const result = await this.queryService.fetch(queryKey, queryInput);
1691
+ return this.createResult({
1692
+ queryKey,
1693
+ success: true,
1694
+ data: result,
1695
+ totalCount: Array.isArray(result) ? result.length : (result?.totalCount || 0),
1696
+ executedAt: new Date().toISOString()
1697
+ }, 'Done');
1698
+ }
1699
+ catch (err) {
1700
+ console.error('[ExecuteQuery] Error executing query:', err);
1701
+ return this.createResult({
1702
+ queryKey,
1703
+ success: false,
1704
+ error: err instanceof Error ? err.message : 'Unknown error'
1705
+ }, 'Failed');
1706
+ }
1707
+ }
1708
+ }
1709
+
1710
+ var executeQuery_activity = /*#__PURE__*/Object.freeze({
1711
+ __proto__: null,
1712
+ ExecuteQuery: ExecuteQuery
1713
+ });
1714
+
1715
+ /**
1716
+ * Start Activity - Marks the start point of a workflow.
1717
+ *
1718
+ * This is a visual marker activity that doesn't perform any actual work.
1719
+ * It's used in workflow designers to clearly indicate where a workflow begins.
1720
+ *
1721
+ * Usage:
1722
+ * ```typescript
1723
+ * const start = new StartActivity();
1724
+ * await start.execute({});
1725
+ * ```
1726
+ */
1727
+ class StartActivity extends Activity {
1728
+ constructor() {
1729
+ super('StartActivity');
1730
+ }
1731
+ async execute(input) {
1732
+ // This activity is a visual marker only
1733
+ // It immediately completes and allows workflow to proceed
1734
+ console.log('[StartActivity] Workflow started');
1735
+ return this.createResult(undefined, 'Done');
1736
+ }
1737
+ }
1738
+
1739
+ var startActivity_activity = /*#__PURE__*/Object.freeze({
1740
+ __proto__: null,
1741
+ StartActivity: StartActivity
1742
+ });
1743
+
1744
+ /**
1745
+ * End Activity - Marks the end point of a workflow.
1746
+ *
1747
+ * This is a visual marker activity that terminates the workflow execution.
1748
+ * When this activity is reached, the workflow completes successfully.
1749
+ *
1750
+ * Usage:
1751
+ * ```typescript
1752
+ * const end = new EndActivity();
1753
+ * await end.execute({});
1754
+ * ```
1755
+ */
1756
+ class EndActivity extends Activity {
1757
+ constructor() {
1758
+ super('EndActivity');
1759
+ }
1760
+ async execute(input) {
1761
+ // This activity marks the end of workflow execution
1762
+ console.log('[EndActivity] Workflow completed');
1763
+ return this.createResult(undefined, 'Done');
1764
+ }
1765
+ }
1766
+
1767
+ var endActivity_activity = /*#__PURE__*/Object.freeze({
1768
+ __proto__: null,
1769
+ EndActivity: EndActivity
1770
+ });
1771
+
1772
+ /**
1773
+ * Command setups for all built-in workflow activities.
1774
+ * Registers activities as AXPCommand instances.
1775
+ */
1776
+ const provideWorkflowActivityCommands = () => provideCommandSetups([
1777
+ // Workflow Markers
1778
+ {
1779
+ key: 'workflow-activity:start',
1780
+ command: () => Promise.resolve().then(function () { return startActivity_activity; }).then(m => m.StartActivity),
1781
+ },
1782
+ {
1783
+ key: 'workflow-activity:end',
1784
+ command: () => Promise.resolve().then(function () { return endActivity_activity; }).then(m => m.EndActivity),
1785
+ },
1786
+ // Console Activities
1787
+ {
1788
+ key: 'workflow-activity:write-line',
1789
+ command: () => Promise.resolve().then(function () { return writeLine_activity; }).then(m => m.WriteLine),
1790
+ },
1791
+ // Control Flow Activities
1792
+ {
1793
+ key: 'workflow-activity:sequence',
1794
+ command: () => Promise.resolve().then(function () { return sequence_activity; }).then(m => m.Sequence),
1795
+ },
1796
+ {
1797
+ key: 'workflow-activity:if',
1798
+ command: () => Promise.resolve().then(function () { return if_activity; }).then(m => m.If),
1799
+ },
1800
+ {
1801
+ key: 'workflow-activity:while',
1802
+ command: () => Promise.resolve().then(function () { return while_activity; }).then(m => m.While),
1803
+ },
1804
+ {
1805
+ key: 'workflow-activity:for-each',
1806
+ command: () => Promise.resolve().then(function () { return forEach_activity; }).then(m => m.ForEach),
1807
+ },
1808
+ // Dialog Activities
1809
+ {
1810
+ key: 'workflow-activity:show-confirm-dialog',
1811
+ command: () => Promise.resolve().then(function () { return showConfirmDialog_activity; }).then(m => m.ShowConfirmDialog),
1812
+ },
1813
+ {
1814
+ key: 'workflow-activity:show-alert-dialog',
1815
+ command: () => Promise.resolve().then(function () { return showAlertDialog_activity; }).then(m => m.ShowAlertDialog),
1816
+ },
1817
+ // Notification Activities
1818
+ {
1819
+ key: 'workflow-activity:show-toast',
1820
+ command: () => Promise.resolve().then(function () { return showToast_activity; }).then(m => m.ShowToast),
1821
+ },
1822
+ // Event Activities
1823
+ {
1824
+ key: 'workflow-activity:dispatch-event',
1825
+ command: () => Promise.resolve().then(function () { return dispatchEvent_activity; }).then(m => m.DispatchEvent),
1826
+ },
1827
+ // Variable Activities
1828
+ {
1829
+ key: 'workflow-activity:set-variable',
1830
+ command: () => Promise.resolve().then(function () { return setVariable_activity; }).then(m => m.SetVariable),
1831
+ },
1832
+ // Command & Query Activities
1833
+ {
1834
+ key: 'workflow-activity:execute-command',
1835
+ command: () => Promise.resolve().then(function () { return executeCommand_activity; }).then(m => m.ExecuteCommand),
1836
+ },
1837
+ {
1838
+ key: 'workflow-activity:execute-query',
1839
+ command: () => Promise.resolve().then(function () { return executeQuery_activity; }).then(m => m.ExecuteQuery),
1840
+ },
1841
+ // Navigation Activities
1842
+ {
1843
+ key: 'workflow-activity:navigate',
1844
+ command: () => Promise.resolve().then(function () { return navigate_activity; }).then(m => m.Navigate),
1845
+ },
1846
+ ]);
1847
+
1848
+ // Built-in Activities
1849
+
1850
+ // Workflow Definition Types (Storage/Database)
1851
+
413
1852
  class AXPWorkflowModule {
414
1853
  static forRoot(config) {
415
1854
  return {
416
1855
  ngModule: AXPWorkflowModule,
417
1856
  providers: [
1857
+ provideWorkflowActivityCommands(),
418
1858
  {
419
1859
  provide: 'AXPWorkflowModuleFactory',
420
1860
  useFactory: (registry) => () => {
@@ -451,6 +1891,8 @@ class AXPWorkflowModule {
451
1891
  return {
452
1892
  ngModule: AXPWorkflowModule,
453
1893
  providers: [
1894
+ // Built-in activities are already registered in forRoot via @NgModule providers
1895
+ // No need to register again in forChild
454
1896
  {
455
1897
  provide: 'AXPWorkflowModuleFactory',
456
1898
  useFactory: (registry) => () => {
@@ -487,21 +1929,27 @@ class AXPWorkflowModule {
487
1929
  * @ignore
488
1930
  */
489
1931
  constructor(instances) {
1932
+ // Inject AXP_COMMAND_SETUP to trigger command registration factory
1933
+ this._commandSetup = inject(AXP_COMMAND_SETUP, { optional: true });
490
1934
  instances?.forEach((f) => {
491
1935
  f();
492
1936
  });
493
1937
  }
494
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowModule, deps: [{ token: 'AXPWorkflowModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
495
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowModule }); }
496
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowModule }); }
1938
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowModule, deps: [{ token: 'AXPWorkflowModuleFactory', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
1939
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowModule }); }
1940
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowModule, providers: [
1941
+ provideWorkflowActivityCommands(),
1942
+ ] }); }
497
1943
  }
498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWorkflowModule, decorators: [{
1944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AXPWorkflowModule, decorators: [{
499
1945
  type: NgModule,
500
1946
  args: [{
501
1947
  imports: [],
502
1948
  exports: [],
503
1949
  declarations: [],
504
- providers: [],
1950
+ providers: [
1951
+ provideWorkflowActivityCommands(),
1952
+ ],
505
1953
  }]
506
1954
  }], ctorParameters: () => [{ type: undefined, decorators: [{
507
1955
  type: Optional
@@ -514,5 +1962,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
514
1962
  * Generated bundle index. Do not edit.
515
1963
  */
516
1964
 
517
- export { AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, createWorkFlowEvent, ofType };
1965
+ export { AXPActivityCategoryProviderService, AXPActivityProviderService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowExecutionService, AXPWorkflowFunction, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, Activity, ActivityRegistry, DispatchEvent, EndActivity, ExecuteCommand, ExecuteQuery, ForEach, If, Navigate, Sequence, SetVariable, ShowAlertDialog, ShowConfirmDialog, ShowToast, StartActivity, While, WorkflowCoordinator, WriteLine, createWorkFlowEvent, ofType, provideWorkflowActivityCommands };
518
1966
  //# sourceMappingURL=acorex-platform-workflow.mjs.map