@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,7 +1,11 @@
1
1
  import * as rxjs from 'rxjs';
2
2
  import { Observable } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
- import { Type, ModuleWithProviders, Injector } from '@angular/core';
4
+ import { Type, ModuleWithProviders, Injector, InjectionToken } from '@angular/core';
5
+ import { AXPValidationRules } from '@acorex/platform/core';
6
+ import { AXPCommand } from '@acorex/platform/runtime';
7
+ import { AXPWidgetTypesMap } from '@acorex/platform/layout/widget-core';
8
+ import { AXStyleColorType } from '@acorex/cdk/common';
5
9
 
6
10
  declare class AXPWorkflowError extends Error {
7
11
  inner: Error | null;
@@ -111,6 +115,7 @@ interface AXPWorkflowModuleConfigs {
111
115
  };
112
116
  }
113
117
  declare class AXPWorkflowModule {
118
+ private _commandSetup;
114
119
  static forRoot(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule>;
115
120
  static forChild(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule>;
116
121
  /**
@@ -144,5 +149,1533 @@ declare class AXPWorkflowService {
144
149
  static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowService>;
145
150
  }
146
151
 
147
- export { AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, createWorkFlowEvent, ofType };
148
- export type { AXPWorkflow, AXPWorkflowActionInput, AXPWorkflowCondition, AXPWorkflowConditionType, AXPWorkflowEvent, AXPWorkflowModuleConfigs, AXPWorkflowNextStep, AXPWorkflowStep };
152
+ interface ActivityPropertyWidget {
153
+ type: AXPWidgetTypesMap[keyof AXPWidgetTypesMap] | string;
154
+ options?: Record<string, any>;
155
+ }
156
+ /**
157
+ * Simple activity interface - just a command with outcomes.
158
+ * All activities are AXPCommand for unified execution through Command Bus.
159
+ */
160
+ interface IActivity<TInput = any, TOutput = any> extends AXPCommand<TInput, {
161
+ output: TOutput;
162
+ outcomes: Record<string, any>;
163
+ }> {
164
+ /**
165
+ * Activity type name.
166
+ * Example: "WriteLine", "ShowDialog", "CreateUserCommand"
167
+ */
168
+ type: string;
169
+ /**
170
+ * Display name for UI.
171
+ */
172
+ name?: string;
173
+ /**
174
+ * Execute the activity as a command.
175
+ * @param input - Activity input data
176
+ * @returns Promise with output and outcomes
177
+ */
178
+ execute(input: TInput): Promise<{
179
+ output: TOutput;
180
+ outcomes: Record<string, any>;
181
+ }>;
182
+ }
183
+ /**
184
+ * Base abstract class for activities.
185
+ * Extend this to create custom activities.
186
+ */
187
+ declare abstract class Activity<TInput = any, TOutput = any> implements IActivity<TInput, TOutput> {
188
+ type: string;
189
+ name?: string;
190
+ constructor(type: string, name?: string);
191
+ /**
192
+ * Execute the activity as a command.
193
+ * Override this method in subclasses to implement activity logic.
194
+ */
195
+ abstract execute(input: TInput): Promise<{
196
+ output: TOutput;
197
+ outcomes: Record<string, any>;
198
+ }>;
199
+ /**
200
+ * Helper method that returns Done outcome by default.
201
+ */
202
+ protected createResult(output: TOutput, outcome?: string): {
203
+ output: TOutput;
204
+ outcomes: Record<string, any>;
205
+ };
206
+ }
207
+ /**
208
+ * Activity descriptor - metadata about an activity type.
209
+ */
210
+ interface ActivityDescriptor {
211
+ /**
212
+ * Activity type name.
213
+ */
214
+ type: string;
215
+ /**
216
+ * Display name for UI.
217
+ */
218
+ displayName: string;
219
+ /**
220
+ * Description of what the activity does.
221
+ */
222
+ description?: string;
223
+ /**
224
+ * Category for grouping in toolbox.
225
+ */
226
+ category: string;
227
+ /**
228
+ * Icon name or class.
229
+ */
230
+ icon?: string;
231
+ /**
232
+ * Where this activity should be executed.
233
+ * - 'frontend': Execute in browser (UI activities, console, events)
234
+ * - 'backend': Execute in backend (business logic, API calls)
235
+ * - 'both': Execute in both frontend and backend (hybrid activities)
236
+ *
237
+ * Default: 'frontend'
238
+ */
239
+ executionMode?: 'frontend' | 'backend' | 'both';
240
+ /**
241
+ * Input descriptors.
242
+ */
243
+ inputs: InputDescriptor[];
244
+ /**
245
+ * Output descriptors.
246
+ */
247
+ outputs: OutputDescriptor[];
248
+ /**
249
+ * Static outcomes (exit points).
250
+ * Example: ['Done', 'Success', 'Failed']
251
+ */
252
+ outcomes?: string[];
253
+ /**
254
+ * Whether this activity is browsable in the toolbox.
255
+ * Default: true
256
+ */
257
+ isBrowsable?: boolean;
258
+ /**
259
+ * Whether this activity is a container (can have children).
260
+ * Default: false
261
+ */
262
+ isContainer?: boolean;
263
+ }
264
+ /**
265
+ * Input property descriptor.
266
+ * Similar to AXPEntityProperty structure.
267
+ */
268
+ interface InputDescriptor {
269
+ name: string;
270
+ title: string;
271
+ description?: string;
272
+ schema: {
273
+ dataType: string;
274
+ nullable?: boolean;
275
+ readonly?: boolean;
276
+ hidden?: boolean | string;
277
+ defaultValue?: any | string | ((context: any | null) => any);
278
+ interface?: ActivityPropertyWidget;
279
+ };
280
+ validations?: AXPValidationRules;
281
+ }
282
+ /**
283
+ * Output property descriptor.
284
+ */
285
+ interface OutputDescriptor {
286
+ name: string;
287
+ title: string;
288
+ description?: string;
289
+ schema: {
290
+ dataType: string;
291
+ };
292
+ }
293
+ /**
294
+ * Activity registry for registering and creating activities.
295
+ */
296
+ declare class ActivityRegistry {
297
+ private registry;
298
+ private descriptors;
299
+ /**
300
+ * Register an activity type.
301
+ */
302
+ register(type: string, factory: () => IActivity, descriptor: ActivityDescriptor): void;
303
+ /**
304
+ * Create an activity instance.
305
+ */
306
+ create(type: string): IActivity;
307
+ /**
308
+ * Get activity descriptor.
309
+ */
310
+ getDescriptor(type: string): ActivityDescriptor | undefined;
311
+ /**
312
+ * Get all registered types.
313
+ */
314
+ getTypes(): string[];
315
+ /**
316
+ * Get all descriptors.
317
+ */
318
+ getAllDescriptors(): ActivityDescriptor[];
319
+ /**
320
+ * Get descriptors by category.
321
+ */
322
+ getDescriptorsByCategory(category: string): ActivityDescriptor[];
323
+ }
324
+
325
+ /**
326
+ * Base entity with versioning support.
327
+ */
328
+ interface VersionedEntity {
329
+ version: number;
330
+ isLatest: boolean;
331
+ isPublished: boolean;
332
+ }
333
+ /**
334
+ * Simple workflow definition stored in database.
335
+ */
336
+ interface WorkflowDefinition extends VersionedEntity {
337
+ /**
338
+ * Logical definition ID (same across all versions).
339
+ */
340
+ definitionId: string;
341
+ /**
342
+ * Human-readable name.
343
+ */
344
+ name?: string;
345
+ /**
346
+ * Description of what the workflow does.
347
+ */
348
+ description?: string;
349
+ /**
350
+ * Materializer name for deserialization.
351
+ */
352
+ materializerName: string;
353
+ /**
354
+ * JSON data (for simple workflows).
355
+ */
356
+ stringData?: string;
357
+ /**
358
+ * Binary data (for complex workflows).
359
+ */
360
+ binaryData?: Uint8Array;
361
+ }
362
+ /**
363
+ * Simple variable definition.
364
+ */
365
+ interface Variable {
366
+ id: string;
367
+ name: string;
368
+ typeName: string;
369
+ value?: any;
370
+ }
371
+ /**
372
+ * Simple input definition.
373
+ * Similar to AXPEntityProperty structure.
374
+ */
375
+ interface InputDefinition {
376
+ name: string;
377
+ title: string;
378
+ description?: string;
379
+ schema: {
380
+ dataType: string;
381
+ nullable?: boolean;
382
+ readonly?: boolean;
383
+ hidden?: boolean | string;
384
+ defaultValue?: any | string | ((context: any | null) => any);
385
+ interface?: ActivityPropertyWidget;
386
+ };
387
+ validations?: AXPValidationRules;
388
+ }
389
+ /**
390
+ * Simple output definition.
391
+ */
392
+ interface OutputDefinition {
393
+ name: string;
394
+ title: string;
395
+ description?: string;
396
+ schema: {
397
+ dataType: string;
398
+ };
399
+ }
400
+ /**
401
+ * Common workflow properties.
402
+ */
403
+ interface WorkflowCommon {
404
+ options: WorkflowOptions;
405
+ variables: Variable[];
406
+ inputs: InputDefinition[];
407
+ outputs: OutputDefinition[];
408
+ outcomes: string[];
409
+ customProperties: Record<string, any>;
410
+ isReadonly: boolean;
411
+ isSystem: boolean;
412
+ }
413
+ /**
414
+ * Workflow configuration options.
415
+ */
416
+ interface WorkflowOptions {
417
+ usableAsActivity: boolean;
418
+ autoUpdateConsumingWorkflows: boolean;
419
+ activationStrategyType?: string;
420
+ }
421
+
422
+ /**
423
+ * Simple workflow definition - just a tree of activities.
424
+ */
425
+ interface AXPWorkflowEngine {
426
+ /**
427
+ * Workflow ID.
428
+ */
429
+ id: string;
430
+ /**
431
+ * Workflow name.
432
+ */
433
+ name: string;
434
+ /**
435
+ * Workflow description.
436
+ */
437
+ description?: string;
438
+ /**
439
+ * Workflow version.
440
+ */
441
+ version: number;
442
+ /**
443
+ * Root activity to execute.
444
+ */
445
+ root: IActivity;
446
+ /**
447
+ * All activities in this workflow (flat list for easy access).
448
+ */
449
+ activities: IActivity[];
450
+ }
451
+ /**
452
+ * Simple workflow step - for backward compatibility with old system.
453
+ */
454
+ interface AXPWorkflowEngineStep {
455
+ /**
456
+ * Step ID.
457
+ */
458
+ id: string;
459
+ /**
460
+ * Activity type to execute.
461
+ */
462
+ type: string;
463
+ /**
464
+ * Activity name.
465
+ */
466
+ name?: string;
467
+ /**
468
+ * Input properties for the activity.
469
+ */
470
+ properties?: Record<string, any>;
471
+ /**
472
+ * Next steps based on outcomes.
473
+ */
474
+ nextSteps?: {
475
+ outcome: string;
476
+ stepId: string;
477
+ }[];
478
+ }
479
+ /**
480
+ * Simple workflow definition for backward compatibility.
481
+ */
482
+ interface AXPSimpleWorkflowEngine {
483
+ /**
484
+ * Workflow ID.
485
+ */
486
+ id: string;
487
+ /**
488
+ * Workflow name.
489
+ */
490
+ name: string;
491
+ /**
492
+ * Start step ID.
493
+ */
494
+ startStepId: string;
495
+ /**
496
+ * All steps in this workflow.
497
+ */
498
+ steps: Record<string, AXPWorkflowEngineStep>;
499
+ }
500
+
501
+ interface ActivityCategoryDescriptor {
502
+ name: string;
503
+ displayName: string;
504
+ description?: string;
505
+ icon?: string;
506
+ color?: string;
507
+ order?: number;
508
+ isVisible?: boolean;
509
+ tags?: string[];
510
+ }
511
+ interface AXPActivityCategoryProviderContext {
512
+ registerCategories(categories: ActivityCategoryDescriptor[]): void;
513
+ }
514
+ interface AXPActivityCategoryProvider {
515
+ provide(context: AXPActivityCategoryProviderContext): Promise<void> | void;
516
+ }
517
+ /**
518
+ * Injection token for activity category providers.
519
+ */
520
+ declare const AXP_ACTIVITY_CATEGORY_PROVIDER: InjectionToken<AXPActivityCategoryProvider[]>;
521
+ declare class AXPActivityCategoryProviderService {
522
+ private parent?;
523
+ private providers;
524
+ private categories;
525
+ private isInitialized;
526
+ constructor(parent?: AXPActivityCategoryProviderService | undefined, providers?: AXPActivityCategoryProvider[]);
527
+ private initialize;
528
+ getAllCategories(): ActivityCategoryDescriptor[];
529
+ getCategory(name: string): ActivityCategoryDescriptor | undefined;
530
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPActivityCategoryProviderService, [{ optional: true; skipSelf: true; }, { optional: true; }]>;
531
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPActivityCategoryProviderService>;
532
+ }
533
+
534
+ /**
535
+ * Context for registering activities in a provider.
536
+ */
537
+ interface AXPActivityProviderContext {
538
+ /**
539
+ * Register an activity with its descriptor.
540
+ */
541
+ registerActivity(config: {
542
+ key: string;
543
+ descriptor: ActivityDescriptor;
544
+ }): void;
545
+ }
546
+ /**
547
+ * Interface for activity providers.
548
+ * Modules implement this to register their activities.
549
+ */
550
+ interface AXPActivityProvider {
551
+ /**
552
+ * Provide activities to the system.
553
+ */
554
+ provide(context: AXPActivityProviderContext): Promise<void> | void;
555
+ }
556
+ /**
557
+ * Injection token for activity providers.
558
+ */
559
+ declare const AXP_ACTIVITY_PROVIDER: InjectionToken<AXPActivityProvider[]>;
560
+ /**
561
+ * Category definition for activity categorization.
562
+ */
563
+ interface ActivityCategory {
564
+ name: string;
565
+ displayName: string;
566
+ description?: string;
567
+ icon?: string;
568
+ color?: string;
569
+ order?: number;
570
+ isVisible?: boolean;
571
+ tags?: string[];
572
+ }
573
+ /**
574
+ * Activity Provider Service.
575
+ * Collects all activity providers and manages activity registration.
576
+ */
577
+ declare class AXPActivityProviderService {
578
+ private activityDescriptors;
579
+ private categories;
580
+ private providers;
581
+ private categoryProviders;
582
+ private initialized;
583
+ private readonly commandService;
584
+ private readonly commandRegistry;
585
+ /**
586
+ * Register an activity provider.
587
+ */
588
+ registerProvider(provider: AXPActivityProvider): void;
589
+ /**
590
+ * Register a category provider.
591
+ */
592
+ registerCategoryProvider(provider: AXPActivityCategoryProvider): void;
593
+ /**
594
+ * Initialize all providers.
595
+ */
596
+ initialize(): Promise<void>;
597
+ /**
598
+ * Get activity descriptor by key.
599
+ */
600
+ getDescriptor(key: string): ActivityDescriptor | undefined;
601
+ /**
602
+ * Get all activity descriptors.
603
+ */
604
+ getAllDescriptors(): ActivityDescriptor[];
605
+ /**
606
+ * Get descriptors by category.
607
+ */
608
+ getDescriptorsByCategory(category: string): ActivityDescriptor[];
609
+ /**
610
+ * Get all categories.
611
+ */
612
+ getCategories(): ActivityCategory[];
613
+ /**
614
+ * Create an activity instance by key using AXPCommandService.
615
+ */
616
+ createActivity(key: string): Promise<IActivity | null>;
617
+ private initializeProvider;
618
+ private initializeCategoryProvider;
619
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPActivityProviderService, never>;
620
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPActivityProviderService>;
621
+ }
622
+
623
+ /**
624
+ * Types and interfaces for Workflow Execution Service.
625
+ */
626
+
627
+ /**
628
+ * Represents a workflow task that needs to be executed.
629
+ * Inspired by Temporal's Activity Tasks and Camunda's External Tasks.
630
+ */
631
+ interface AXPWorkflowTask {
632
+ /**
633
+ * Unique token for this task (used for completion/security).
634
+ */
635
+ taskToken: string;
636
+ /**
637
+ * Activity ID from workflow definition.
638
+ */
639
+ activityId: string;
640
+ /**
641
+ * Activity type (e.g., 'workflow-activity:show-toast').
642
+ */
643
+ activityType: string;
644
+ /**
645
+ * Human-readable activity name.
646
+ */
647
+ activityName?: string;
648
+ /**
649
+ * Where this task should be executed.
650
+ * - 'frontend': Execute in browser (UI activities, console, events)
651
+ * - 'backend': Execute in backend (business logic, API calls)
652
+ * - 'both': Execute in both frontend and backend (hybrid activities)
653
+ */
654
+ executionMode: 'frontend' | 'backend' | 'both';
655
+ /**
656
+ * Input data for the activity (for frontend activities).
657
+ */
658
+ input?: Record<string, any>;
659
+ /**
660
+ * Configuration for the activity (for frontend activities).
661
+ */
662
+ config?: Record<string, any>;
663
+ }
664
+ /**
665
+ * Request to start a workflow execution.
666
+ */
667
+ interface AXPStartWorkflowExecutionRequest {
668
+ /**
669
+ * Workflow ID to execute.
670
+ */
671
+ workflowId: string;
672
+ /**
673
+ * Initial input data for workflow.
674
+ */
675
+ input: Record<string, any>;
676
+ }
677
+ /**
678
+ * Response after starting workflow execution.
679
+ */
680
+ interface AXPStartWorkflowExecutionResponse {
681
+ /**
682
+ * Unique execution ID for this workflow run.
683
+ */
684
+ executionId: string;
685
+ /**
686
+ * Current workflow state.
687
+ */
688
+ state: AXPWorkflowExecutionState;
689
+ /**
690
+ * First task to execute (determined by backend).
691
+ * Client should execute this task based on executionMode.
692
+ */
693
+ pendingTask?: AXPWorkflowTask | null;
694
+ }
695
+ /**
696
+ * Request to execute a backend activity.
697
+ */
698
+ interface AXPExecuteBackendActivityRequest {
699
+ /**
700
+ * Workflow ID.
701
+ */
702
+ workflowId: string;
703
+ /**
704
+ * Execution ID.
705
+ */
706
+ executionId: string;
707
+ /**
708
+ * Activity type (e.g., 'workflow-activity:execute-command').
709
+ */
710
+ activityType: string;
711
+ /**
712
+ * Activity ID from workflow definition.
713
+ */
714
+ activityId: string;
715
+ /**
716
+ * Activity properties (input data).
717
+ */
718
+ properties: Record<string, any>;
719
+ /**
720
+ * Current workflow state (optional, for context).
721
+ */
722
+ workflowState?: Partial<AXPWorkflowExecutionState>;
723
+ }
724
+ /**
725
+ * Response after executing backend activity.
726
+ */
727
+ interface AXPExecuteBackendActivityResponse {
728
+ /**
729
+ * Activity execution output.
730
+ */
731
+ output: any;
732
+ /**
733
+ * Activity execution outcomes.
734
+ */
735
+ outcomes: Record<string, any>;
736
+ /**
737
+ * Next task to execute (if any).
738
+ */
739
+ nextTask?: AXPWorkflowTask | null;
740
+ /**
741
+ * Updated workflow state.
742
+ */
743
+ state: AXPWorkflowExecutionState;
744
+ }
745
+ /**
746
+ * Request to resume a suspended workflow.
747
+ */
748
+ interface AXPResumeWorkflowExecutionRequest {
749
+ /**
750
+ * Execution ID.
751
+ */
752
+ executionId: string;
753
+ /**
754
+ * Step ID that was waiting for user input.
755
+ */
756
+ stepId: string;
757
+ /**
758
+ * User action outcome (e.g., 'Confirmed', 'Cancelled').
759
+ */
760
+ outcome: string;
761
+ /**
762
+ * Optional user input data.
763
+ */
764
+ userInput?: any;
765
+ }
766
+ /**
767
+ * Response after resuming workflow.
768
+ */
769
+ interface AXPResumeWorkflowExecutionResponse {
770
+ /**
771
+ * Activity execution output.
772
+ */
773
+ output: any;
774
+ /**
775
+ * Activity execution outcomes.
776
+ */
777
+ outcomes: Record<string, any>;
778
+ /**
779
+ * Next task to execute (if any).
780
+ */
781
+ nextTask?: AXPWorkflowTask | null;
782
+ /**
783
+ * Updated workflow state.
784
+ */
785
+ state: AXPWorkflowExecutionState;
786
+ }
787
+ /**
788
+ * Request to get workflow execution state.
789
+ */
790
+ interface AXPGetWorkflowExecutionStateRequest {
791
+ /**
792
+ * Execution ID.
793
+ */
794
+ executionId: string;
795
+ }
796
+ /**
797
+ * Request to execute current step from execution state.
798
+ */
799
+ interface AXPExecuteCurrentStepRequest {
800
+ /**
801
+ * Execution ID.
802
+ */
803
+ executionId: string;
804
+ }
805
+ /**
806
+ * Response after executing current step.
807
+ */
808
+ interface AXPExecuteCurrentStepResponse {
809
+ /**
810
+ * Step execution output.
811
+ */
812
+ output: any;
813
+ /**
814
+ * Step execution outcomes.
815
+ */
816
+ outcomes: Record<string, any>;
817
+ /**
818
+ * Next task to execute (if any, determined by backend from outcomeConnections).
819
+ */
820
+ nextTask?: AXPWorkflowTask | null;
821
+ /**
822
+ * Updated workflow state.
823
+ */
824
+ state: AXPWorkflowExecutionState;
825
+ }
826
+ /**
827
+ * Request to get workflow definition.
828
+ */
829
+ interface AXPGetWorkflowDefinitionRequest {
830
+ /**
831
+ * Workflow ID or definition ID.
832
+ */
833
+ workflowId: string;
834
+ }
835
+ /**
836
+ * Response with workflow definition.
837
+ */
838
+ interface AXPGetWorkflowDefinitionResponse {
839
+ /**
840
+ * Workflow definition (executable format).
841
+ */
842
+ workflow: AXPWorkflowEngine;
843
+ }
844
+ /**
845
+ * Workflow execution state (managed by backend, cached in client).
846
+ */
847
+ interface AXPWorkflowExecutionState {
848
+ /**
849
+ * Unique execution ID.
850
+ */
851
+ executionId: string;
852
+ /**
853
+ * Workflow ID.
854
+ */
855
+ workflowId: string;
856
+ /**
857
+ * Current execution status.
858
+ */
859
+ status: 'running' | 'completed' | 'suspended' | 'error';
860
+ /**
861
+ * Current step ID (if suspended or running).
862
+ */
863
+ currentStepId?: string;
864
+ /**
865
+ * Workflow variables (state).
866
+ */
867
+ variables: Record<string, any>;
868
+ /**
869
+ * Initial input data.
870
+ */
871
+ input: Record<string, any>;
872
+ /**
873
+ * Final output data (if completed).
874
+ */
875
+ output?: Record<string, any>;
876
+ /**
877
+ * Last update timestamp.
878
+ */
879
+ lastUpdated: Date;
880
+ }
881
+ /**
882
+ * Request to complete a task.
883
+ */
884
+ interface AXPCompleteTaskRequest {
885
+ /**
886
+ * Task token from the pending task.
887
+ */
888
+ taskToken: string;
889
+ /**
890
+ * Task execution result.
891
+ */
892
+ result?: any;
893
+ /**
894
+ * Error message if task failed.
895
+ */
896
+ error?: string;
897
+ }
898
+ /**
899
+ * Response after completing a task.
900
+ */
901
+ interface AXPCompleteTaskResponse {
902
+ /**
903
+ * Updated workflow state.
904
+ */
905
+ state: AXPWorkflowExecutionState;
906
+ /**
907
+ * Next task to execute (if any).
908
+ */
909
+ nextTask?: AXPWorkflowTask | null;
910
+ }
911
+
912
+ /**
913
+ * Workflow execution result.
914
+ */
915
+ interface WorkflowExecutionResult {
916
+ success: boolean;
917
+ output?: any;
918
+ error?: string;
919
+ nextTask?: AXPWorkflowTask | null;
920
+ executionId?: string;
921
+ state?: AXPWorkflowExecutionState;
922
+ }
923
+ /**
924
+ * Production Workflow Coordinator.
925
+ *
926
+ * Separates frontend/backend execution:
927
+ * - Frontend activities: Execute with AXPCommand in browser
928
+ * - Backend activities: Execute via API calls to backend
929
+ * - State caching: Caches workflow state in client for performance
930
+ *
931
+ * ✅ Suitable for production use.
932
+ */
933
+ declare class WorkflowCoordinator {
934
+ private readonly workflowExecutionService;
935
+ private readonly commandService;
936
+ /**
937
+ * Cache workflow states in memory for quick access.
938
+ * Key: executionId
939
+ * Value: AXPWorkflowExecutionState
940
+ */
941
+ private stateCache;
942
+ /**
943
+ * Start workflow execution in backend.
944
+ *
945
+ * Backend decides what to do: returns pendingTask or indicates completion.
946
+ * Frontend only calls API - no business logic here.
947
+ *
948
+ * @param workflowId - Workflow ID
949
+ * @param input - Initial input data
950
+ * @returns Execution result with pendingTask (if any)
951
+ *
952
+ * @example
953
+ * ```typescript
954
+ * const result = await coordinator.startWorkflow('my-workflow', { userId: '123' });
955
+ *
956
+ * if (result.pendingTask) {
957
+ * // Execute task if frontend, or wait for backend to complete
958
+ * if (result.pendingTask.executionMode === 'frontend') {
959
+ * await coordinator.executeTask(result.pendingTask);
960
+ * await coordinator.completeTask(result.executionId, result.pendingTask, outcome, output);
961
+ * }
962
+ * }
963
+ * ```
964
+ */
965
+ startWorkflow(workflowId: string, input?: Record<string, any>): Promise<WorkflowExecutionResult>;
966
+ /**
967
+ * Execute a frontend task using AXPCommand.
968
+ *
969
+ * Only executes if task.executionMode is 'frontend' or 'both'.
970
+ * Backend tasks are handled automatically by backend.
971
+ *
972
+ * @param task - Task to execute
973
+ * @returns Execution result with output and outcome
974
+ */
975
+ executeTask(task: AXPWorkflowTask): Promise<{
976
+ output: any;
977
+ outcome: string;
978
+ }>;
979
+ /**
980
+ * Complete a task and get next task from backend.
981
+ *
982
+ * Sends task result to backend API.
983
+ * Backend decides: next task, fail, or complete workflow.
984
+ *
985
+ * @param executionId - Execution ID
986
+ * @param task - Completed task
987
+ * @param outcome - Task outcome (e.g., 'Done', 'Confirmed', 'Cancelled')
988
+ * @param output - Task output/result
989
+ * @returns Next task from backend (if any)
990
+ */
991
+ completeTask(executionId: string, task: AXPWorkflowTask, outcome: string, output?: any): Promise<WorkflowExecutionResult>;
992
+ /**
993
+ * Execute workflow by ID (backward compatibility).
994
+ *
995
+ * @deprecated Use startWorkflow + executeTask + completeTask pattern instead.
996
+ * This method is kept for backward compatibility but will be removed.
997
+ */
998
+ executeWorkflowById(workflowId: string, input?: Record<string, any>): Promise<WorkflowExecutionResult>;
999
+ /**
1000
+ * Resume a suspended workflow (e.g., after user interaction).
1001
+ *
1002
+ * Backend determines nextStep based on outcome and outcomeConnections.
1003
+ * Client only provides executionId, stepId, outcome, and optional userInput.
1004
+ *
1005
+ * @param executionId - Workflow execution ID
1006
+ * @param stepId - Step ID that was waiting for user input
1007
+ * @param outcome - User action outcome (e.g., 'Confirmed', 'Cancelled', 'Submitted')
1008
+ * @param userInput - Optional user input data
1009
+ */
1010
+ resumeWorkflow(executionId: string, stepId: string, outcome: string, userInput?: any): Promise<WorkflowExecutionResult>;
1011
+ /**
1012
+ * Get workflow execution state (from cache or backend).
1013
+ */
1014
+ getWorkflowState(executionId: string): Promise<AXPWorkflowExecutionState | null>;
1015
+ /**
1016
+ * Start step-based execution (only current step, not full workflow).
1017
+ *
1018
+ * Use this when you only need to execute one step at a time.
1019
+ * Perfect for form-based workflows where user interacts with forms.
1020
+ *
1021
+ * @param workflowId - Workflow ID
1022
+ * @param stepId - Initial step ID to execute
1023
+ * @param input - Initial input data
1024
+ * @returns Execution info with executionId and initial state
1025
+ *
1026
+ * @example
1027
+ * ```typescript
1028
+ * // Start login form step
1029
+ * const execution = await coordinator.startStepExecution(
1030
+ * 'login-workflow',
1031
+ * 'login-form-step',
1032
+ * {}
1033
+ * );
1034
+ *
1035
+ * // Save executionId for resume after refresh
1036
+ * localStorage.setItem('execution-id', execution.executionId);
1037
+ * ```
1038
+ */
1039
+ startStepExecution(workflowId: string, stepId: string, input?: Record<string, any>): Promise<{
1040
+ executionId: string;
1041
+ state: AXPWorkflowExecutionState;
1042
+ }>;
1043
+ /**
1044
+ * Get next task from backend after backend task completion.
1045
+ *
1046
+ * Use this when backend task completes - backend will return next task.
1047
+ * For frontend tasks, use executeTask + completeTask instead.
1048
+ *
1049
+ * @param executionId - Execution ID
1050
+ * @returns Next task from backend (if any)
1051
+ */
1052
+ getNextTask(executionId: string): Promise<WorkflowExecutionResult>;
1053
+ /**
1054
+ * Execute a frontend activity using CommandBus.
1055
+ *
1056
+ * Frontend activities are executed in the browser using AXPCommandService.
1057
+ * Activities can also be executed in both frontend and backend (hybrid mode).
1058
+ *
1059
+ * @param task - Frontend task to execute
1060
+ * @returns Execution result with output and outcome
1061
+ */
1062
+ private executeFrontendActivity;
1063
+ /**
1064
+ * Start workflow execution in backend.
1065
+ * Backend returns executionId, initial state, and first task to execute.
1066
+ */
1067
+ private startWorkflowExecution;
1068
+ static ɵfac: i0.ɵɵFactoryDeclaration<WorkflowCoordinator, never>;
1069
+ static ɵprov: i0.ɵɵInjectableDeclaration<WorkflowCoordinator>;
1070
+ }
1071
+
1072
+ /**
1073
+ * Abstract service for workflow execution operations.
1074
+ *
1075
+ * This service handles communication with backend for workflow execution.
1076
+ *
1077
+ * Implementation should be provided in connectivity layer:
1078
+ * - Mock implementation: @acorex/connectivity/mock
1079
+ * - API implementation: @acorex/connectivity/api
1080
+ *
1081
+ * @example
1082
+ * ```typescript
1083
+ * // In connectivity/mock
1084
+ * @Injectable()
1085
+ * export class AXCWorkflowExecutionService implements AXPWorkflowExecutionService {
1086
+ * async startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse> {
1087
+ * // Mock implementation
1088
+ * }
1089
+ * }
1090
+ *
1091
+ * // In connectivity/api
1092
+ * @Injectable()
1093
+ * export class AXCWorkflowExecutionService implements AXPWorkflowExecutionService {
1094
+ * constructor(private http: HttpClient) {}
1095
+ *
1096
+ * async startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse> {
1097
+ * return firstValueFrom(
1098
+ * this.http.post<AXPStartWorkflowExecutionResponse>(
1099
+ * `${this.config.baseUrl}/api/workflows/${request.workflowId}/start`,
1100
+ * { input: request.input }
1101
+ * )
1102
+ * );
1103
+ * }
1104
+ * }
1105
+ * ```
1106
+ */
1107
+ declare abstract class AXPWorkflowExecutionService {
1108
+ /**
1109
+ * Start a new workflow execution.
1110
+ *
1111
+ * Creates a new workflow execution instance in backend and returns execution ID.
1112
+ *
1113
+ * @param request - Start execution request
1114
+ * @returns Execution response with executionId and initial state
1115
+ *
1116
+ * @example
1117
+ * ```typescript
1118
+ * const response = await workflowExecutionService.startExecution({
1119
+ * workflowId: 'my-workflow',
1120
+ * input: { userId: '123', action: 'create' }
1121
+ * });
1122
+ *
1123
+ * console.log('Execution ID:', response.executionId);
1124
+ * console.log('Initial State:', response.state);
1125
+ * ```
1126
+ */
1127
+ abstract startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse>;
1128
+ /**
1129
+ * Execute a backend activity.
1130
+ *
1131
+ * Executes an activity that should run in backend (e.g., execute-command, execute-query, set-variable).
1132
+ *
1133
+ * @param request - Backend activity execution request
1134
+ * @returns Activity execution response with output and updated state
1135
+ *
1136
+ * @example
1137
+ * ```typescript
1138
+ * const response = await workflowExecutionService.executeBackendActivity({
1139
+ * workflowId: 'my-workflow',
1140
+ * executionId: 'exec-123',
1141
+ * activityType: 'workflow-activity:execute-command',
1142
+ * activityId: 'cmd-1',
1143
+ * properties: {
1144
+ * commandKey: 'Entity:Create',
1145
+ * input: { entity: 'User', data: {...} }
1146
+ * },
1147
+ * workflowState: { variables: {...} }
1148
+ * });
1149
+ *
1150
+ * console.log('Output:', response.output);
1151
+ * console.log('Updated State:', response.state);
1152
+ * ```
1153
+ */
1154
+ abstract executeBackendActivity(request: AXPExecuteBackendActivityRequest): Promise<AXPExecuteBackendActivityResponse>;
1155
+ /**
1156
+ * Resume a suspended workflow execution.
1157
+ *
1158
+ * Resumes workflow execution after user interaction (e.g., after show-dialog).
1159
+ *
1160
+ * @param request - Resume execution request
1161
+ * @returns Resume response with next step and updated state
1162
+ *
1163
+ * @example
1164
+ * ```typescript
1165
+ * const response = await workflowExecutionService.resumeExecution({
1166
+ * executionId: 'exec-123',
1167
+ * stepId: 'step-dialog-1',
1168
+ * outcome: 'Confirmed',
1169
+ * userInput: { confirmed: true }
1170
+ * });
1171
+ *
1172
+ * console.log('Next Step:', response.nextStep);
1173
+ * console.log('Updated State:', response.state);
1174
+ * ```
1175
+ */
1176
+ abstract resumeExecution(request: AXPResumeWorkflowExecutionRequest): Promise<AXPResumeWorkflowExecutionResponse>;
1177
+ /**
1178
+ * Get current workflow execution state.
1179
+ *
1180
+ * Retrieves current state of a workflow execution from backend.
1181
+ *
1182
+ * @param request - Get state request
1183
+ * @returns Current workflow execution state
1184
+ *
1185
+ * @example
1186
+ * ```typescript
1187
+ * const state = await workflowExecutionService.getExecutionState({
1188
+ * executionId: 'exec-123'
1189
+ * });
1190
+ *
1191
+ * console.log('Status:', state.status);
1192
+ * console.log('Variables:', state.variables);
1193
+ * ```
1194
+ */
1195
+ abstract getExecutionState(request: AXPGetWorkflowExecutionStateRequest): Promise<AXPWorkflowExecutionState>;
1196
+ /**
1197
+ * Get workflow definition by ID.
1198
+ *
1199
+ * Retrieves workflow definition from backend.
1200
+ *
1201
+ * @param request - Get workflow definition request
1202
+ * @returns Workflow definition in executable format
1203
+ *
1204
+ * @example
1205
+ * ```typescript
1206
+ * const response = await workflowExecutionService.getWorkflowDefinition({
1207
+ * workflowId: 'my-workflow'
1208
+ * });
1209
+ *
1210
+ * console.log('Workflow:', response.workflow);
1211
+ * ```
1212
+ */
1213
+ abstract getWorkflowDefinition(request: AXPGetWorkflowDefinitionRequest): Promise<AXPGetWorkflowDefinitionResponse>;
1214
+ /**
1215
+ * Execute current step from execution state.
1216
+ *
1217
+ * Backend handles everything:
1218
+ * - Gets execution state
1219
+ * - Gets workflow definition
1220
+ * - Finds current step
1221
+ * - Executes step (or returns step info for frontend execution)
1222
+ * - Determines next step based on outcomeConnections
1223
+ *
1224
+ * @param request - Execute current step request
1225
+ * @returns Step execution response with output, outcomes, and next step
1226
+ *
1227
+ * @example
1228
+ * ```typescript
1229
+ * const response = await workflowExecutionService.executeCurrentStep({
1230
+ * executionId: 'exec-123'
1231
+ * });
1232
+ *
1233
+ * console.log('Output:', response.output);
1234
+ * console.log('Next Step:', response.nextStep);
1235
+ * ```
1236
+ */
1237
+ abstract executeCurrentStep(request: AXPExecuteCurrentStepRequest): Promise<AXPExecuteCurrentStepResponse>;
1238
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPWorkflowExecutionService, never>;
1239
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowExecutionService>;
1240
+ }
1241
+
1242
+ /**
1243
+ * WriteLine Activity - Simple console logging activity.
1244
+ *
1245
+ * Usage:
1246
+ * ```typescript
1247
+ * const activity = new WriteLine();
1248
+ * await activity.execute({ text: 'Hello World' });
1249
+ * ```
1250
+ */
1251
+ declare class WriteLine extends Activity<{
1252
+ text?: string;
1253
+ }, void> {
1254
+ constructor();
1255
+ execute(input: {
1256
+ text?: string;
1257
+ }): Promise<{
1258
+ output: void;
1259
+ outcomes: Record<string, any>;
1260
+ }>;
1261
+ }
1262
+
1263
+ /**
1264
+ * Sequence Activity - Executes activities in sequential order.
1265
+ *
1266
+ * Usage:
1267
+ * ```typescript
1268
+ * const sequence = new Sequence();
1269
+ * sequence.activities = [activity1, activity2, activity3];
1270
+ * await sequence.execute({});
1271
+ * ```
1272
+ */
1273
+ declare class Sequence extends Activity<{}, void> {
1274
+ /**
1275
+ * Activities to execute in sequence.
1276
+ */
1277
+ activities: IActivity[];
1278
+ constructor();
1279
+ execute(input: {}): Promise<{
1280
+ output: void;
1281
+ outcomes: Record<string, any>;
1282
+ }>;
1283
+ }
1284
+
1285
+ /**
1286
+ * Show Confirm Dialog Activity - Displays confirmation dialog to user.
1287
+ *
1288
+ * Has two outcomes:
1289
+ * - 'Confirmed': User clicked confirm/yes
1290
+ * - 'Cancelled': User clicked cancel/no
1291
+ *
1292
+ * Usage:
1293
+ * ```typescript
1294
+ * const dialog = new ShowConfirmDialog();
1295
+ * await dialog.execute({
1296
+ * title: 'Confirm Delete',
1297
+ * message: 'Are you sure?',
1298
+ * color: 'danger'
1299
+ * });
1300
+ * ```
1301
+ */
1302
+ declare class ShowConfirmDialog extends Activity<{
1303
+ title?: string;
1304
+ message?: string;
1305
+ color?: AXStyleColorType;
1306
+ defaultAction?: 'confirm' | 'cancel';
1307
+ align?: 'horizontal' | 'vertical';
1308
+ backdrop?: boolean;
1309
+ }, {
1310
+ result: boolean;
1311
+ action: string;
1312
+ }> {
1313
+ private readonly dialogService;
1314
+ private readonly translationService;
1315
+ constructor();
1316
+ execute(input: {
1317
+ title?: string;
1318
+ message?: string;
1319
+ color?: AXStyleColorType;
1320
+ defaultAction?: 'confirm' | 'cancel';
1321
+ align?: 'horizontal' | 'vertical';
1322
+ backdrop?: boolean;
1323
+ }): Promise<{
1324
+ output: {
1325
+ result: boolean;
1326
+ action: string;
1327
+ };
1328
+ outcomes: Record<string, any>;
1329
+ }>;
1330
+ }
1331
+
1332
+ /**
1333
+ * Show Alert Dialog Activity - Displays alert dialog to user.
1334
+ *
1335
+ * Has one outcome:
1336
+ * - 'Done': User clicked OK
1337
+ *
1338
+ * Usage:
1339
+ * ```typescript
1340
+ * const dialog = new ShowAlertDialog();
1341
+ * await dialog.execute({
1342
+ * title: 'Alert',
1343
+ * message: 'This is an alert',
1344
+ * color: 'info'
1345
+ * });
1346
+ * ```
1347
+ */
1348
+ declare class ShowAlertDialog extends Activity<{
1349
+ title?: string;
1350
+ message?: string;
1351
+ color?: AXStyleColorType;
1352
+ }, {
1353
+ result: boolean;
1354
+ action: string;
1355
+ }> {
1356
+ private readonly dialogService;
1357
+ private readonly translationService;
1358
+ constructor();
1359
+ execute(input: {
1360
+ title?: string;
1361
+ message?: string;
1362
+ color?: AXStyleColorType;
1363
+ }): Promise<{
1364
+ output: {
1365
+ result: boolean;
1366
+ action: string;
1367
+ };
1368
+ outcomes: Record<string, any>;
1369
+ }>;
1370
+ }
1371
+
1372
+ /**
1373
+ * Show Toast Activity - Displays toast notification to user.
1374
+ *
1375
+ * Usage:
1376
+ * ```typescript
1377
+ * const toast = new ShowToast();
1378
+ * await toast.execute({
1379
+ * color: 'success',
1380
+ * title: 'Success',
1381
+ * message: 'Operation completed successfully!'
1382
+ * });
1383
+ * ```
1384
+ */
1385
+ declare class ShowToast extends Activity<{
1386
+ color?: AXStyleColorType;
1387
+ title?: string;
1388
+ message?: string;
1389
+ duration?: number;
1390
+ }, void> {
1391
+ private readonly toastService;
1392
+ private readonly translationService;
1393
+ constructor();
1394
+ execute(input: {
1395
+ color?: AXStyleColorType;
1396
+ title?: string;
1397
+ message?: string;
1398
+ duration?: number;
1399
+ }): Promise<{
1400
+ output: void;
1401
+ outcomes: Record<string, any>;
1402
+ }>;
1403
+ }
1404
+
1405
+ /**
1406
+ * Navigate Activity - Navigates to different pages/routes.
1407
+ *
1408
+ * Usage:
1409
+ * ```typescript
1410
+ * const navigate = new Navigate();
1411
+ * await navigate.execute({
1412
+ * mode: 'route',
1413
+ * route: '/users',
1414
+ * params: { id: '123' }
1415
+ * });
1416
+ * ```
1417
+ */
1418
+ declare class Navigate extends Activity<{
1419
+ mode?: 'route' | 'entity-details' | 'entity-list' | 'external';
1420
+ route?: string;
1421
+ params?: Record<string, any>;
1422
+ queryParams?: Record<string, any>;
1423
+ entity?: string;
1424
+ entityId?: string;
1425
+ url?: string;
1426
+ }, void> {
1427
+ private readonly router;
1428
+ constructor();
1429
+ execute(input: {
1430
+ mode?: 'route' | 'entity-details' | 'entity-list' | 'external';
1431
+ route?: string;
1432
+ params?: Record<string, any>;
1433
+ queryParams?: Record<string, any>;
1434
+ entity?: string;
1435
+ entityId?: string;
1436
+ url?: string;
1437
+ }): Promise<{
1438
+ output: void;
1439
+ outcomes: Record<string, any>;
1440
+ }>;
1441
+ }
1442
+
1443
+ /**
1444
+ * Set Variable Activity - Sets a variable value in workflow context.
1445
+ *
1446
+ * Usage:
1447
+ * ```typescript
1448
+ * const setVar = new SetVariable();
1449
+ * await setVar.execute({
1450
+ * variableName: 'userId',
1451
+ * value: '12345'
1452
+ * });
1453
+ * ```
1454
+ */
1455
+ declare class SetVariable extends Activity<{
1456
+ variableName: string;
1457
+ value: any;
1458
+ }, void> {
1459
+ constructor();
1460
+ execute(input: {
1461
+ variableName: string;
1462
+ value: any;
1463
+ }): Promise<{
1464
+ output: void;
1465
+ outcomes: Record<string, any>;
1466
+ }>;
1467
+ }
1468
+
1469
+ /**
1470
+ * Dispatch Event Activity - Dispatches an event to the system.
1471
+ *
1472
+ * Usage:
1473
+ * ```typescript
1474
+ * const dispatch = new DispatchEvent();
1475
+ * await dispatch.execute({
1476
+ * eventName: 'user-created',
1477
+ * eventData: { userId: '123', name: 'John' }
1478
+ * });
1479
+ * ```
1480
+ */
1481
+ declare class DispatchEvent extends Activity<{
1482
+ eventName: string;
1483
+ eventData?: any;
1484
+ }, void> {
1485
+ constructor();
1486
+ execute(input: {
1487
+ eventName: string;
1488
+ eventData?: any;
1489
+ }): Promise<{
1490
+ output: void;
1491
+ outcomes: Record<string, any>;
1492
+ }>;
1493
+ }
1494
+
1495
+ /**
1496
+ * If Activity - Conditional execution based on a condition.
1497
+ *
1498
+ * Usage:
1499
+ * ```typescript
1500
+ * const ifActivity = new If();
1501
+ * ifActivity.condition = '{{user.isAdmin}}';
1502
+ * ifActivity.thenActivities = [activity1, activity2];
1503
+ * ifActivity.elseActivities = [activity3];
1504
+ * ```
1505
+ */
1506
+ declare class If extends Activity<{
1507
+ condition: string | boolean;
1508
+ thenActivities?: IActivity[];
1509
+ elseActivities?: IActivity[];
1510
+ }, any> {
1511
+ constructor();
1512
+ execute(input: {
1513
+ condition: string | boolean;
1514
+ thenActivities?: IActivity[];
1515
+ elseActivities?: IActivity[];
1516
+ }): Promise<{
1517
+ output: any;
1518
+ outcomes: Record<string, any>;
1519
+ }>;
1520
+ private evaluateCondition;
1521
+ }
1522
+
1523
+ /**
1524
+ * While Activity - Loop execution while condition is true.
1525
+ *
1526
+ * Usage:
1527
+ * ```typescript
1528
+ * const whileActivity = new While();
1529
+ * whileActivity.condition = '{{counter < 10}}';
1530
+ * whileActivity.activities = [incrementActivity, logActivity];
1531
+ * ```
1532
+ */
1533
+ declare class While extends Activity<{
1534
+ condition: string | boolean;
1535
+ activities?: IActivity[];
1536
+ maxIterations?: number;
1537
+ }, any> {
1538
+ constructor();
1539
+ execute(input: {
1540
+ condition: string | boolean;
1541
+ activities?: IActivity[];
1542
+ maxIterations?: number;
1543
+ }): Promise<{
1544
+ output: any;
1545
+ outcomes: Record<string, any>;
1546
+ }>;
1547
+ private evaluateCondition;
1548
+ }
1549
+
1550
+ /**
1551
+ * ForEach Activity - Iterates over a collection of items.
1552
+ *
1553
+ * Usage:
1554
+ * ```typescript
1555
+ * const forEach = new ForEach();
1556
+ * await forEach.execute({
1557
+ * items: ['item1', 'item2', 'item3'],
1558
+ * activities: [processItemActivity]
1559
+ * });
1560
+ * ```
1561
+ */
1562
+ declare class ForEach extends Activity<{
1563
+ items: any[];
1564
+ activities?: IActivity[];
1565
+ itemVariableName?: string;
1566
+ indexVariableName?: string;
1567
+ }, any> {
1568
+ constructor();
1569
+ execute(input: {
1570
+ items: any[];
1571
+ activities?: IActivity[];
1572
+ itemVariableName?: string;
1573
+ indexVariableName?: string;
1574
+ }): Promise<{
1575
+ output: any;
1576
+ outcomes: Record<string, any>;
1577
+ }>;
1578
+ }
1579
+
1580
+ /**
1581
+ * Execute Command Activity - Executes a command through Command Bus.
1582
+ *
1583
+ * Usage:
1584
+ * ```typescript
1585
+ * const executeCmd = new ExecuteCommand();
1586
+ * await executeCmd.execute({
1587
+ * commandKey: 'UserManagement.CreateUser',
1588
+ * input: { name: 'John', email: 'john@example.com' }
1589
+ * });
1590
+ * ```
1591
+ */
1592
+ declare class ExecuteCommand extends Activity<{
1593
+ commandKey: string;
1594
+ input?: any;
1595
+ }, any> {
1596
+ private readonly commandService;
1597
+ constructor();
1598
+ execute(input: {
1599
+ commandKey: string;
1600
+ input?: any;
1601
+ }): Promise<{
1602
+ output: any;
1603
+ outcomes: Record<string, any>;
1604
+ }>;
1605
+ }
1606
+
1607
+ /**
1608
+ * Execute Query Activity - Executes a query through Query Bus.
1609
+ *
1610
+ * Usage:
1611
+ * ```typescript
1612
+ * const executeQuery = new ExecuteQuery();
1613
+ * await executeQuery.execute({
1614
+ * queryKey: 'UserManagement.GetUsers',
1615
+ * input: { page: 1, pageSize: 10 }
1616
+ * });
1617
+ * ```
1618
+ */
1619
+ declare class ExecuteQuery extends Activity<{
1620
+ queryKey: string;
1621
+ input?: any;
1622
+ }, any> {
1623
+ private readonly queryService;
1624
+ constructor();
1625
+ execute(input: {
1626
+ queryKey: string;
1627
+ input?: any;
1628
+ }): Promise<{
1629
+ output: any;
1630
+ outcomes: Record<string, any>;
1631
+ }>;
1632
+ }
1633
+
1634
+ /**
1635
+ * Start Activity - Marks the start point of a workflow.
1636
+ *
1637
+ * This is a visual marker activity that doesn't perform any actual work.
1638
+ * It's used in workflow designers to clearly indicate where a workflow begins.
1639
+ *
1640
+ * Usage:
1641
+ * ```typescript
1642
+ * const start = new StartActivity();
1643
+ * await start.execute({});
1644
+ * ```
1645
+ */
1646
+ declare class StartActivity extends Activity<Record<string, never>, void> {
1647
+ constructor();
1648
+ execute(input: Record<string, never>): Promise<{
1649
+ output: void;
1650
+ outcomes: Record<string, any>;
1651
+ }>;
1652
+ }
1653
+
1654
+ /**
1655
+ * End Activity - Marks the end point of a workflow.
1656
+ *
1657
+ * This is a visual marker activity that terminates the workflow execution.
1658
+ * When this activity is reached, the workflow completes successfully.
1659
+ *
1660
+ * Usage:
1661
+ * ```typescript
1662
+ * const end = new EndActivity();
1663
+ * await end.execute({});
1664
+ * ```
1665
+ */
1666
+ declare class EndActivity extends Activity<Record<string, never>, void> {
1667
+ constructor();
1668
+ execute(input: Record<string, never>): Promise<{
1669
+ output: void;
1670
+ outcomes: Record<string, any>;
1671
+ }>;
1672
+ }
1673
+
1674
+ /**
1675
+ * Command setups for all built-in workflow activities.
1676
+ * Registers activities as AXPCommand instances.
1677
+ */
1678
+ declare const provideWorkflowActivityCommands: () => i0.EnvironmentProviders;
1679
+
1680
+ 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 };
1681
+ export type { AXPActivityCategoryProvider, AXPActivityCategoryProviderContext, AXPActivityProvider, AXPActivityProviderContext, AXPCompleteTaskRequest, AXPCompleteTaskResponse, AXPExecuteBackendActivityRequest, AXPExecuteBackendActivityResponse, AXPExecuteCurrentStepRequest, AXPExecuteCurrentStepResponse, AXPGetWorkflowDefinitionRequest, AXPGetWorkflowDefinitionResponse, AXPGetWorkflowExecutionStateRequest, AXPResumeWorkflowExecutionRequest, AXPResumeWorkflowExecutionResponse, AXPSimpleWorkflowEngine, AXPStartWorkflowExecutionRequest, AXPStartWorkflowExecutionResponse, AXPWorkflow, AXPWorkflowActionInput, AXPWorkflowCondition, AXPWorkflowConditionType, AXPWorkflowEngine, AXPWorkflowEngineStep, AXPWorkflowEvent, AXPWorkflowExecutionState, AXPWorkflowModuleConfigs, AXPWorkflowNextStep, AXPWorkflowStep, AXPWorkflowTask, ActivityCategory, ActivityCategoryDescriptor, ActivityDescriptor, ActivityPropertyWidget, IActivity, InputDefinition, InputDescriptor, OutputDefinition, OutputDescriptor, Variable, VersionedEntity, WorkflowCommon, WorkflowDefinition, WorkflowExecutionResult, WorkflowOptions };