verben-workflow-ui 0.5.83 → 0.5.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -2
- package/esm2022/src/lib/base/core/base-data-page.facade.mjs +412 -0
- package/esm2022/src/lib/base/core/base-data-page.service.mjs +140 -0
- package/esm2022/src/lib/base/core/base-data-page.state.mjs +216 -0
- package/esm2022/src/lib/base/handlers/filter-handler.service.mjs +138 -0
- package/esm2022/src/lib/base/handlers/search-handler.service.mjs +31 -0
- package/esm2022/src/lib/base/handlers/sort-handler.service.mjs +73 -0
- package/esm2022/src/lib/base/index.mjs +2 -0
- package/esm2022/src/lib/base/models/api-payload.mjs +7 -0
- package/esm2022/src/lib/base/models/page-config.interface.mjs +2 -0
- package/esm2022/src/lib/base/models/page-filter-tab-option.interface.mjs +2 -0
- package/esm2022/src/lib/base/public-api.mjs +14 -0
- package/esm2022/src/lib/base/utils/column-helpers.mjs +55 -0
- package/esm2022/src/lib/base/verben-workflow-ui-src-lib-base.mjs +5 -0
- package/esm2022/src/lib/components/actors/actors.component.mjs +156 -110
- package/esm2022/src/lib/components/actors/actors.config.mjs +49 -0
- package/esm2022/src/lib/components/actors/actors.facade.mjs +46 -242
- package/esm2022/src/lib/components/actors/actors.form.component.mjs +20 -24
- package/esm2022/src/lib/components/actors/actors.service.mjs +49 -62
- package/esm2022/src/lib/components/actors/actors.state.mjs +11 -80
- package/esm2022/src/lib/components/designer/components/node-selector.component.mjs +1 -3
- package/esm2022/src/lib/components/designer/components/wf-designer.component.mjs +1 -4
- package/esm2022/src/lib/components/designer/services/node-precondition.service.mjs +1 -2
- package/esm2022/src/lib/components/designer/services/wf-mapper.service.mjs +1 -2
- package/esm2022/src/lib/components/designer/services/wf-persistence.service.mjs +27 -25
- package/esm2022/src/lib/components/flowable-status/flowable-status.component.mjs +169 -102
- package/esm2022/src/lib/components/flowable-status/flowable-status.config.mjs +47 -0
- package/esm2022/src/lib/components/flowable-status/flowable-status.facade.mjs +56 -203
- package/esm2022/src/lib/components/flowable-status/flowable-status.service.mjs +25 -44
- package/esm2022/src/lib/components/flowable-status/flowable-status.state.mjs +10 -80
- package/esm2022/src/lib/components/form-control/form-control.component.mjs +1 -3
- package/esm2022/src/lib/components/form-group/form-fields/form-fields.component.mjs +2 -8
- package/esm2022/src/lib/components/form-group/form-group.component.mjs +2 -10
- package/esm2022/src/lib/components/form-response/form-response.component.mjs +1 -5
- package/esm2022/src/lib/components/form-timer/form-timer.component.mjs +1 -4
- package/esm2022/src/lib/components/forms/forms.component.mjs +1 -1
- package/esm2022/src/lib/components/my-queue/my-queue.component.mjs +3 -3
- package/esm2022/src/lib/components/my-queue/my-queue.facade.mjs +6 -25
- package/esm2022/src/lib/components/my-queue/my-queue.state.mjs +4 -4
- package/esm2022/src/lib/components/my-queue/tasks.form.component.mjs +1 -4
- package/esm2022/src/lib/components/operation-popup/operation-popup.component.mjs +1 -13
- package/esm2022/src/lib/components/operation-popup/operation-popup.facade.mjs +1 -15
- package/esm2022/src/lib/components/stage-details/stage-details.component.mjs +1 -3
- package/esm2022/src/lib/components/task-history/task-history.component.mjs +1 -5
- package/esm2022/src/lib/components/task-notification/task-notification.component.mjs +1 -1
- package/esm2022/src/lib/components/tasks/tasks.component.mjs +10 -5
- package/esm2022/src/lib/components/tasks/tasks.facade.mjs +23 -26
- package/esm2022/src/lib/components/tasks/tasks.form.component.mjs +1 -4
- package/esm2022/src/lib/components/tasks/tasks.state.mjs +11 -3
- package/esm2022/src/lib/components/wf/wf.component.mjs +1 -2
- package/esm2022/src/lib/components/workflow/workflow.component.mjs +2 -8
- package/esm2022/src/lib/components/workflow-designer/action-dialog/action-dialog.component.mjs +16 -10
- package/esm2022/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.mjs +10 -2
- package/esm2022/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.mjs +12 -1
- package/esm2022/src/lib/components/workflow-designer/decision-popup/decision-popup.component.mjs +20 -1
- package/esm2022/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.mjs +105 -66
- package/esm2022/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.mjs +14 -1
- package/esm2022/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.mjs +16 -12
- package/esm2022/src/lib/components/workflow-designer/services/connection.service.mjs +17 -2
- package/esm2022/src/lib/components/workflow-designer/services/node-management.service.mjs +23 -2
- package/esm2022/src/lib/components/workflow-designer/services/popup.service.mjs +10 -5
- package/esm2022/src/lib/components/workflow-designer/services/swimlane.service.mjs +16 -3
- package/esm2022/src/lib/components/workflow-designer/services/transformer.service.mjs +16 -1
- package/esm2022/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.mjs +16 -14
- package/esm2022/src/lib/components/workflow-designer/stage-node/stage-node.component.mjs +15 -6
- package/esm2022/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.mjs +15 -8
- package/esm2022/src/lib/components/workflow-designer/workflow-data.service.mjs +25 -1
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.component.mjs +75 -23
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.module.mjs +20 -1
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.state.mjs +181 -18
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.types.mjs +1 -1
- package/esm2022/src/lib/components/workflows/public-api.mjs +4 -1
- package/esm2022/src/lib/components/workflows/workflow-form/workflow-form.component.mjs +1 -5
- package/esm2022/src/lib/components/workflows/workflows.api.mjs +63 -0
- package/esm2022/src/lib/components/workflows/workflows.component.mjs +194 -148
- package/esm2022/src/lib/components/workflows/workflows.config.mjs +50 -0
- package/esm2022/src/lib/components/workflows/workflows.facade.mjs +106 -298
- package/esm2022/src/lib/components/workflows/workflows.service.mjs +58 -117
- package/esm2022/src/lib/components/workflows/workflows.state.mjs +12 -81
- package/esm2022/src/lib/services/environment.service.mjs +1 -2
- package/esm2022/src/lib/services/http-web-request.service.mjs +12 -10
- package/esm2022/src/lib/services/util.service.mjs +18 -16
- package/esm2022/src/lib/shared/components/base-data-view.component.mjs +1 -5
- package/fesm2022/verben-workflow-ui-src-lib-base.mjs +1055 -0
- package/fesm2022/verben-workflow-ui-src-lib-base.mjs.map +1 -0
- package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs +314 -508
- package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs +26 -31
- package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs +289 -417
- package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs +0 -2
- package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs +2 -16
- package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs +0 -4
- package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs +0 -3
- package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +8 -30
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs +0 -26
- package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs +0 -2
- package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs +0 -4
- package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +37 -30
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs +0 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs +603 -158
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs +1 -7
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs +427 -623
- package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-services.mjs +28 -25
- package/fesm2022/verben-workflow-ui-src-lib-services.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-shared.mjs +0 -4
- package/fesm2022/verben-workflow-ui-src-lib-shared.mjs.map +1 -1
- package/package.json +47 -41
- package/src/lib/base/README.md +146 -0
- package/src/lib/base/core/base-data-page.facade.d.ts +138 -0
- package/src/lib/base/core/base-data-page.service.d.ts +61 -0
- package/src/lib/base/core/base-data-page.state.d.ts +73 -0
- package/src/lib/base/handlers/filter-handler.service.d.ts +34 -0
- package/src/lib/base/handlers/search-handler.service.d.ts +20 -0
- package/src/lib/base/handlers/sort-handler.service.d.ts +30 -0
- package/src/lib/base/index.d.ts +1 -0
- package/src/lib/base/models/api-payload.d.ts +2 -0
- package/src/lib/base/models/page-config.interface.d.ts +24 -0
- package/src/lib/base/models/page-filter-tab-option.interface.d.ts +19 -0
- package/src/lib/base/public-api.d.ts +9 -0
- package/src/lib/base/utils/column-helpers.d.ts +24 -0
- package/src/lib/components/actors/actors.component.d.ts +66 -18
- package/src/lib/components/actors/actors.config.d.ts +10 -0
- package/src/lib/components/actors/actors.facade.d.ts +19 -27
- package/src/lib/components/actors/actors.form.component.d.ts +8 -8
- package/src/lib/components/actors/actors.service.d.ts +23 -43
- package/src/lib/components/actors/actors.state.d.ts +10 -27
- package/src/lib/components/flowable-status/flowable-status.component.d.ts +64 -18
- package/src/lib/components/flowable-status/flowable-status.config.d.ts +11 -0
- package/src/lib/components/flowable-status/flowable-status.facade.d.ts +19 -25
- package/src/lib/components/flowable-status/flowable-status.service.d.ts +17 -29
- package/src/lib/components/flowable-status/flowable-status.state.d.ts +7 -26
- package/src/lib/components/tasks/tasks.component.d.ts +2 -1
- package/src/lib/components/tasks/tasks.facade.d.ts +5 -2
- package/src/lib/components/tasks/tasks.state.d.ts +10 -3
- package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.d.ts +1 -0
- package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.d.ts +3 -0
- package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.d.ts +104 -0
- package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.d.ts +6 -0
- package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/services/connection.service.d.ts +16 -0
- package/src/lib/components/workflow-designer/services/node-management.service.d.ts +22 -1
- package/src/lib/components/workflow-designer/services/popup.service.d.ts +9 -1
- package/src/lib/components/workflow-designer/services/swimlane.service.d.ts +15 -0
- package/src/lib/components/workflow-designer/services/transformer.service.d.ts +15 -0
- package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.d.ts +3 -0
- package/src/lib/components/workflow-designer/stage-node/stage-node.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/workflow-data.service.d.ts +24 -0
- package/src/lib/components/workflow-designer/workflow-designer.component.d.ts +74 -0
- package/src/lib/components/workflow-designer/workflow-designer.module.d.ts +19 -0
- package/src/lib/components/workflow-designer/workflow-designer.state.d.ts +179 -0
- package/src/lib/components/workflow-designer/workflow-designer.types.d.ts +80 -0
- package/src/lib/components/workflows/public-api.d.ts +1 -0
- package/src/lib/components/workflows/workflows.api.d.ts +38 -0
- package/src/lib/components/workflows/workflows.component.d.ts +78 -29
- package/src/lib/components/workflows/workflows.config.d.ts +10 -0
- package/src/lib/components/workflows/workflows.facade.d.ts +31 -28
- package/src/lib/components/workflows/workflows.service.d.ts +28 -74
- package/src/lib/components/workflows/workflows.state.d.ts +8 -26
- package/src/lib/services/http-web-request.service.d.ts +1 -1
- package/src/lib/services/util.service.d.ts +8 -0
- package/esm2022/src/lib/components/workflows/workflows.helper.mjs +0 -21
- package/src/lib/components/workflows/workflows.helper.d.ts +0 -3
package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.d.ts
CHANGED
|
@@ -7,11 +7,17 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
export declare class DesignerToolbarComponent {
|
|
8
8
|
private nodeService;
|
|
9
9
|
private swimlaneService;
|
|
10
|
+
/** Currently active tool, owned by the parent. */
|
|
10
11
|
selectedTool: ToolType;
|
|
12
|
+
/** Drives the save button's busy state. */
|
|
11
13
|
isSaving: boolean;
|
|
14
|
+
/** Workflow being edited; used for actor-tag scoping. */
|
|
12
15
|
workflowCode: string | null;
|
|
16
|
+
/** Request to open the actor-tags dialog. */
|
|
13
17
|
openActorTags: EventEmitter<void>;
|
|
18
|
+
/** A palette item was clicked; `null` when the active tool is deselected. */
|
|
14
19
|
toolSelected: EventEmitter<ToolType>;
|
|
20
|
+
/** The save button was pressed. */
|
|
15
21
|
saveWorkflow: EventEmitter<void>;
|
|
16
22
|
toolbarItems: ToolbarItem[];
|
|
17
23
|
constructor(nodeService: NodeManagementService, swimlaneService: SwimlaneService);
|
package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.d.ts
CHANGED
|
@@ -10,10 +10,14 @@ export declare class EscalationDialogComponent implements OnInit {
|
|
|
10
10
|
private dataService;
|
|
11
11
|
private utilService;
|
|
12
12
|
visible: boolean;
|
|
13
|
+
/** Owning workflow. Signal input. */
|
|
13
14
|
workflowCode: import("@angular/core").InputSignal<string>;
|
|
15
|
+
/** Stage the escalation attaches to. Signal input. */
|
|
14
16
|
stageCode: import("@angular/core").InputSignal<string>;
|
|
17
|
+
/** Which escalation kind is being configured. Signal input. */
|
|
15
18
|
type: import("@angular/core").InputSignal<EscalationType | undefined>;
|
|
16
19
|
closed: EventEmitter<any>;
|
|
20
|
+
/** Emitted after an escalation is successfully saved. */
|
|
17
21
|
created: EventEmitter<{}>;
|
|
18
22
|
escalation: WritableSignal<Escalation | null>;
|
|
19
23
|
reportSchedules: WritableSignal<ReportSchedule[]>;
|
|
@@ -2,6 +2,22 @@ import { Connection, ConnectionPoint } from '../workflow-designer.types';
|
|
|
2
2
|
import { WorkflowDesignerState } from '../workflow-designer.state';
|
|
3
3
|
import { NodeManagementService } from './node-management.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* ⚠️ **NOT ON THE LIVE PATH.** The only class that injects this is
|
|
7
|
+
* `TransformerService`, which is itself injected by nothing.
|
|
8
|
+
*
|
|
9
|
+
* It duplicates connection logic that lives in `WorkflowDesignerState`, and the
|
|
10
|
+
* two copies have **drifted apart**:
|
|
11
|
+
*
|
|
12
|
+
* - `connectionRules` here additionally allows `stage → form`; `state` does not.
|
|
13
|
+
* - `getConnectionData` / `getConnectionPathData` here add `+ 40` to the
|
|
14
|
+
* swimlane offset; `state` and the render template do not.
|
|
15
|
+
*
|
|
16
|
+
* Neither divergence is currently visible to users, precisely because this file
|
|
17
|
+
* does not run. Make connection changes in `WorkflowDesignerState`.
|
|
18
|
+
*
|
|
19
|
+
* @see ./docs/06-known-issues.md section A
|
|
20
|
+
*/
|
|
5
21
|
export declare class ConnectionService {
|
|
6
22
|
private state;
|
|
7
23
|
private nodeService;
|
|
@@ -2,11 +2,32 @@ import { Node, ToolType, ConnectionPoint } from '../workflow-designer.types';
|
|
|
2
2
|
import { WorkflowStage } from 'verben-workflow-ui/src/lib/models';
|
|
3
3
|
import { WorkflowDesignerState } from '../workflow-designer.state';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Node helpers used by `DesignerToolbarComponent` and `StageDialogComponent`.
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ **Partially adopted, and it has drifted from `WorkflowDesignerState`.**
|
|
9
|
+
* Most components use `state` directly; this service duplicates a subset of its
|
|
10
|
+
* logic. The copies are not identical — see {@link addNode} below and
|
|
11
|
+
* `./docs/06-known-issues.md` section A.
|
|
12
|
+
*
|
|
13
|
+
* Prefer `WorkflowDesignerState` for new work. If you must change behaviour
|
|
14
|
+
* here, check whether `state` needs the same change.
|
|
15
|
+
*/
|
|
5
16
|
export declare class NodeManagementService {
|
|
6
17
|
private state;
|
|
7
18
|
constructor(state: WorkflowDesignerState);
|
|
8
19
|
/**
|
|
9
|
-
* Adds a new node to the specified swimlane
|
|
20
|
+
* Adds a new node to the specified swimlane.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ **This disagrees with `WorkflowDesignerState.addNode` by 40px.** It
|
|
23
|
+
* subtracts an extra `- 40` "header height" that neither `state.addNode` nor
|
|
24
|
+
* the render template applies, so a node placed through this method lands
|
|
25
|
+
* 40px higher than one placed through the canvas.
|
|
26
|
+
*
|
|
27
|
+
* `state.addNode` is the correct one. Do not copy the `- 40` outward; the fix
|
|
28
|
+
* is to remove it here, which is tracked in `./docs/06-known-issues.md`.
|
|
29
|
+
*
|
|
30
|
+
* @param y **Absolute** canvas Y — same contract as `state.addNode`.
|
|
10
31
|
*/
|
|
11
32
|
addNode(swimlaneIndex: number, type: ToolType, x: number, y: number, stageData?: Partial<WorkflowStage>, workflowData?: {
|
|
12
33
|
id: string;
|
|
@@ -4,7 +4,15 @@ import { ConnectionPoint } from '../workflow-designer.types';
|
|
|
4
4
|
import { WorkflowDataService } from '../workflow-data.service';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* RxJS-based popup state manager for the workflow designer.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ **Barely adopted.** Only `StageDialogComponent` consumes this; the canvas
|
|
10
|
+
* re-implements popup visibility with local booleans. Two mechanisms coexist,
|
|
11
|
+
* so a popup change made here may not affect the popup you are looking at —
|
|
12
|
+
* check whether the component in question actually injects this service.
|
|
13
|
+
*
|
|
14
|
+
* Consolidating onto one mechanism is tracked in
|
|
15
|
+
* `./docs/06-known-issues.md` section C.
|
|
8
16
|
*/
|
|
9
17
|
export declare class PopupService {
|
|
10
18
|
private dataService;
|
|
@@ -2,8 +2,23 @@ import { SwimlaneItem } from '../workflow-designer.types';
|
|
|
2
2
|
import { Tag } from 'verben-workflow-ui/src/lib/models';
|
|
3
3
|
import { WorkflowDesignerState } from '../workflow-designer.state';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Swimlane helpers used by `DesignerToolbarComponent` and
|
|
7
|
+
* `SwimlaneDialogComponent`. Delegates to `WorkflowDesignerState`, which also
|
|
8
|
+
* implements much of this directly — see `./docs/01-architecture.md` for why
|
|
9
|
+
* both exist.
|
|
10
|
+
*/
|
|
5
11
|
export declare class SwimlaneService {
|
|
6
12
|
private state;
|
|
13
|
+
/**
|
|
14
|
+
* Swimlane band height in pixels.
|
|
15
|
+
*
|
|
16
|
+
* ⚠️ One of **four** separate declarations of this constant
|
|
17
|
+
* (`WorkflowDesignerState`, `DesignerCanvasComponent`,
|
|
18
|
+
* `NodeManagementService`, and here), plus bare `263` literals in templates.
|
|
19
|
+
* They agree today; nothing enforces that. Tracked in
|
|
20
|
+
* `./docs/06-known-issues.md` section B.
|
|
21
|
+
*/
|
|
7
22
|
readonly swimlaneHeight = 263;
|
|
8
23
|
constructor(state: WorkflowDesignerState);
|
|
9
24
|
/**
|
|
@@ -4,6 +4,21 @@ import { SwimlaneService } from './swimlane.service';
|
|
|
4
4
|
import { NodeManagementService } from './node-management.service';
|
|
5
5
|
import { ConnectionService } from './connection.service';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* ⚠️ **NOT ON THE LIVE PATH — injected by nothing.**
|
|
9
|
+
*
|
|
10
|
+
* This service appears in `WorkflowDesignerModule`'s `providers` array, which
|
|
11
|
+
* makes it look wired up, but no component injects it. Its
|
|
12
|
+
* `parseWorkflowData` and `transformToWorkflowModel` are stale duplicates of
|
|
13
|
+
* the implementations that actually run:
|
|
14
|
+
*
|
|
15
|
+
* - load → `WorkflowDesignerComponent.parseWorkflowData`
|
|
16
|
+
* - save → `WorkflowDesignerState.transformToWorkflowModel`
|
|
17
|
+
*
|
|
18
|
+
* Edit those. Changes here will pass review and do nothing at runtime.
|
|
19
|
+
*
|
|
20
|
+
* @see ./docs/06-known-issues.md section A — the split-brain problem
|
|
21
|
+
*/
|
|
7
22
|
export declare class TransformerService {
|
|
8
23
|
private state;
|
|
9
24
|
private swimlaneService;
|
|
@@ -10,9 +10,12 @@ export declare class StageDialogComponent implements OnInit {
|
|
|
10
10
|
private dataService;
|
|
11
11
|
private nodeService;
|
|
12
12
|
private popupService;
|
|
13
|
+
/** Signal input — read as `this.visible()`. */
|
|
13
14
|
visible: import("@angular/core").InputSignal<boolean>;
|
|
15
|
+
/** Stage being edited; empty object when creating. Read as `this.stageData()`. */
|
|
14
16
|
stageData: import("@angular/core").InputSignal<Partial<WorkflowStage>>;
|
|
15
17
|
closed: EventEmitter<any>;
|
|
18
|
+
/** Emits the edited stage properties for the parent to apply. */
|
|
16
19
|
saved: EventEmitter<Partial<WorkflowStage>>;
|
|
17
20
|
stageForm: FormGroup;
|
|
18
21
|
tags: Tag[];
|
|
@@ -7,9 +7,13 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
export declare class StageNodeComponent {
|
|
8
8
|
private state;
|
|
9
9
|
private dataService;
|
|
10
|
+
/** The node to render. */
|
|
10
11
|
node: Node;
|
|
12
|
+
/** Draws the entry-point indicator. */
|
|
11
13
|
isStartNode: boolean;
|
|
14
|
+
/** Renders the hexagonal subflow shape instead of the stage rectangle. */
|
|
12
15
|
isSubflow: boolean;
|
|
16
|
+
/** Backing stage record, for the label and icon states. */
|
|
13
17
|
stageData: Partial<WorkflowStage>;
|
|
14
18
|
get displayName(): string;
|
|
15
19
|
get truncatedDisplayName(): string;
|
|
@@ -9,16 +9,20 @@ export declare class SwimlaneDialogComponent implements OnInit {
|
|
|
9
9
|
private dataService;
|
|
10
10
|
private swimlaneService;
|
|
11
11
|
visible: boolean;
|
|
12
|
+
/** Edit mode when true; create mode when false. */
|
|
12
13
|
isEditing: boolean;
|
|
14
|
+
/** Current values when editing. Signal input — read as `this.swimlaneData()`. */
|
|
13
15
|
swimlaneData: import("@angular/core").InputSignal<{
|
|
14
16
|
name: string;
|
|
15
17
|
tags: Tag[];
|
|
16
18
|
} | null>;
|
|
17
19
|
closed: EventEmitter<any>;
|
|
20
|
+
/** Emits the confirmed name and tags, for both create and edit. */
|
|
18
21
|
created: EventEmitter<{
|
|
19
22
|
tags: Tag[];
|
|
20
23
|
name: string;
|
|
21
24
|
}>;
|
|
25
|
+
/** Requests deletion of the lane being edited. */
|
|
22
26
|
deleted: EventEmitter<void>;
|
|
23
27
|
searchQuery: string;
|
|
24
28
|
workflowName: string;
|
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
import { ActorTag, ErrorResponse, Escalation, FlowableStatus, Form, OperationAction, Paged, ReportSchedule, SwimLane, Tag, Workflow, WorkflowStage } from 'verben-workflow-ui/src/lib/models';
|
|
2
2
|
import { EnvironmentService, HttpWebRequestService, UtilService } from 'verben-workflow-ui/src/lib/services';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* HTTP layer for the workflow designer — a thin wrapper over
|
|
6
|
+
* `HttpWebRequestService` that picks an API base per call from
|
|
7
|
+
* `EnvironmentService.environment`.
|
|
8
|
+
*
|
|
9
|
+
* Bases used:
|
|
10
|
+
* - `WorkFlowAPI` — workflows, stages, actions, swimlanes, escalations, tags
|
|
11
|
+
* - `AuthAPI` — `GetTags` (actor tags) only
|
|
12
|
+
* - `ReportingAPI` — `GetReportSchedules` only
|
|
13
|
+
*
|
|
14
|
+
* Every method routes through {@link withLoader}, so the busy indicator is
|
|
15
|
+
* handled centrally; callers should not toggle it themselves.
|
|
16
|
+
*
|
|
17
|
+
* ## Save is batched, deletes are not
|
|
18
|
+
*
|
|
19
|
+
* `saveWorkflows` persists the whole workflow at the user's explicit save. The
|
|
20
|
+
* `delete*` methods fire immediately when the user confirms, from whichever
|
|
21
|
+
* component owns that UI. A delete is therefore **already committed** and is
|
|
22
|
+
* not undone by navigating away without saving.
|
|
23
|
+
*
|
|
24
|
+
* @see ./docs/08-api-reference.md — the full endpoint table
|
|
25
|
+
* @see ./docs/05-persistence.md — how the models map on load and save
|
|
26
|
+
*/
|
|
4
27
|
export declare class WorkflowDataService {
|
|
5
28
|
private httpService;
|
|
6
29
|
private envSvc;
|
|
7
30
|
private utilService;
|
|
31
|
+
/** In-flight request count backing the shared busy indicator. */
|
|
8
32
|
private pendingRequests;
|
|
9
33
|
constructor(httpService: HttpWebRequestService, envSvc: EnvironmentService, utilService: UtilService);
|
|
10
34
|
/**
|
|
@@ -6,12 +6,40 @@ import { WorkflowDataService } from './workflow-data.service';
|
|
|
6
6
|
import { WorkflowDesignerState } from './workflow-designer.state';
|
|
7
7
|
import { ToolType } from './workflow-designer.types';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* The workflow designer's root component and **the only thing
|
|
11
|
+
* `WorkflowDesignerModule` exports** — everything else in this folder is
|
|
12
|
+
* internal.
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <lib-workflow-designer [workflowCode]="'WOR-QG2LCX'"></lib-workflow-designer>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Responsibilities are deliberately narrow: load and save the workflow, host
|
|
19
|
+
* the toolbar and the lane/actor-tag dialogs, and translate toolbar tool
|
|
20
|
+
* selection plus canvas clicks into state mutations. The heavy lifting —
|
|
21
|
+
* rendering and all pointer interaction — belongs to
|
|
22
|
+
* {@link DesignerCanvasComponent}.
|
|
23
|
+
*
|
|
24
|
+
* ## Integration requirements
|
|
25
|
+
*
|
|
26
|
+
* Consuming apps must provide the `ENVIRONMENT` injection token and have a
|
|
27
|
+
* reachable Workflow API; the designer throws on construction without the
|
|
28
|
+
* former and renders empty without the latter. Note there are **no outputs** —
|
|
29
|
+
* saving is driven by the built-in toolbar button, and the host is not notified
|
|
30
|
+
* when it happens.
|
|
31
|
+
*
|
|
32
|
+
* @see ./docs/07-integration.md — full setup guide
|
|
33
|
+
* @see ./docs/01-architecture.md — how this fits with the canvas and state
|
|
34
|
+
*/
|
|
9
35
|
export declare class WorkflowDesignerComponent {
|
|
10
36
|
state: WorkflowDesignerState;
|
|
11
37
|
private dataService;
|
|
12
38
|
private utilService;
|
|
13
39
|
canvasRef: DesignerCanvasComponent;
|
|
40
|
+
/** Code of the workflow to load. `null` renders an empty canvas. */
|
|
14
41
|
workflowCode: string | null;
|
|
42
|
+
/** Active toolbar tool; `null` means pointer mode. */
|
|
15
43
|
selectedTool: ToolType;
|
|
16
44
|
showSwimlaneDialog: boolean;
|
|
17
45
|
showActorTagsDialog: boolean;
|
|
@@ -25,11 +53,57 @@ export declare class WorkflowDesignerComponent {
|
|
|
25
53
|
constructor(state: WorkflowDesignerState, dataService: WorkflowDataService, utilService: UtilService);
|
|
26
54
|
ngOnInit(): void;
|
|
27
55
|
saveWorkflow(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Fetches a workflow by code and hands the first result to
|
|
58
|
+
* {@link parseWorkflowData}. Called from `ngOnInit` when `workflowCode` is
|
|
59
|
+
* set.
|
|
60
|
+
*
|
|
61
|
+
* Failures are logged and swallowed — the canvas simply stays empty. If the
|
|
62
|
+
* designer renders blank, check the `ENVIRONMENT` provider and the
|
|
63
|
+
* `WorkFlowAPI` base URL before suspecting the code itself.
|
|
64
|
+
*/
|
|
28
65
|
loadWorkflow(code: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Maps an API `Workflow` into the designer's editing model — the load-side
|
|
68
|
+
* counterpart to `WorkflowDesignerState.transformToWorkflowModel`.
|
|
69
|
+
*
|
|
70
|
+
* Steps, in order:
|
|
71
|
+
* 1. Reset `swimlanes`, `connections`, and the `*Record` maps, and stash the
|
|
72
|
+
* full workflow for save-time state derivation.
|
|
73
|
+
* 2. Rebuild lanes sorted by `Position`, registering lane-id → index mappings.
|
|
74
|
+
* 3. Rebuild nodes from `Stages`, keyed by `IsSubProcess` into `subflow` or
|
|
75
|
+
* `stage` type, then generate their connection points.
|
|
76
|
+
* 4. Rebuild connections from `Actions`.
|
|
77
|
+
*
|
|
78
|
+
* Nodes are constructed **literally here** rather than through
|
|
79
|
+
* `state.addNode`, so that `stage.Code` is preserved as the node id and
|
|
80
|
+
* identity survives the round trip. That also means this path bypasses
|
|
81
|
+
* `addNode`'s coordinate conversion — stage coordinates come back from the
|
|
82
|
+
* API already lane-relative and are used as-is.
|
|
83
|
+
*
|
|
84
|
+
* ⚠️ **This is the live parser.** `TransformerService.parseWorkflowData` is a
|
|
85
|
+
* dead duplicate reached by nothing — edit this one. See
|
|
86
|
+
* `./docs/06-known-issues.md` section A.
|
|
87
|
+
*/
|
|
29
88
|
parseWorkflowData(workflow: Workflow): void;
|
|
30
89
|
findSwimlaneIndexByLaneId(laneId: string): number;
|
|
31
90
|
onToolSelected(tool: ToolType): void;
|
|
32
91
|
openSwimlaneDialog(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Handles a canvas click by branching on the active tool: opening the
|
|
94
|
+
* swimlane dialog, placing a stage/decision/form node, or starting the
|
|
95
|
+
* subflow picker. The tool resets to `null` after a successful placement.
|
|
96
|
+
*
|
|
97
|
+
* ⚠️ **Sentinel value.** `{ x: -1, y: laneIndex }` is not a position — it
|
|
98
|
+
* means "edit the swimlane at `laneIndex`", emitted by the lane's pencil
|
|
99
|
+
* button. It is intercepted before any placement logic runs. Any change to
|
|
100
|
+
* this method must preserve that check, and callers must never emit a
|
|
101
|
+
* genuine click with `x === -1`.
|
|
102
|
+
*
|
|
103
|
+
* Node placement passes the click Y through **absolute**, with the target
|
|
104
|
+
* lane derived as `Math.floor(event.y / 263)` — the canonical coordinate
|
|
105
|
+
* contract described in `./docs/02-coordinate-system.md`.
|
|
106
|
+
*/
|
|
33
107
|
handleCanvasPositionClick(event: {
|
|
34
108
|
x: number;
|
|
35
109
|
y: number;
|
|
@@ -15,6 +15,25 @@ import * as i13 from "verben-ng-ui";
|
|
|
15
15
|
import * as i14 from "@angular/forms";
|
|
16
16
|
import * as i15 from "verben-workflow-ui/src/lib/components/designer";
|
|
17
17
|
import * as i16 from "verben-reporting-ui";
|
|
18
|
+
/**
|
|
19
|
+
* The workflow designer feature module.
|
|
20
|
+
*
|
|
21
|
+
* 📖 **Documentation: [`./docs/README.md`](./docs/README.md)** — architecture,
|
|
22
|
+
* the coordinate system, data model, interactions, persistence, known issues,
|
|
23
|
+
* integration guide, API reference, and development workflow.
|
|
24
|
+
*
|
|
25
|
+
* Declares eleven components and exports exactly one,
|
|
26
|
+
* {@link WorkflowDesignerComponent}; everything else is internal.
|
|
27
|
+
*
|
|
28
|
+
* Requires `verben-ng-ui` (seven modules) and `verben-reporting-ui`
|
|
29
|
+
* (`EditorModule`) at runtime, and an `ENVIRONMENT` provider in the host app.
|
|
30
|
+
* See `./docs/07-integration.md`.
|
|
31
|
+
*
|
|
32
|
+
* Note: the five `services/` classes listed in `providers` are all
|
|
33
|
+
* `providedIn: 'root'` already, so those entries are redundant. Two of them
|
|
34
|
+
* (`TransformerService`, `ConnectionService`) are not reached from any UI path
|
|
35
|
+
* at all — see `./docs/06-known-issues.md`.
|
|
36
|
+
*/
|
|
18
37
|
export declare class WorkflowDesignerModule {
|
|
19
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<WorkflowDesignerModule, never>;
|
|
20
39
|
static ɵmod: i0.ɵɵNgModuleDeclaration<WorkflowDesignerModule, [typeof i1.WorkflowDesignerComponent, typeof i2.DesignerToolbarComponent, typeof i3.DesignerCanvasComponent, typeof i4.SwimlaneDialogComponent, typeof i5.StageNodeComponent, typeof i6.StageDialogComponent, typeof i7.ConditionsPopupComponent, typeof i8.DecisionPopupComponent, typeof i9.EscalationDialogComponent, typeof i10.ActionDialogComponent, typeof i11.ActorTagsDialogComponent], [typeof i12.CommonModule, typeof i13.VerbenDialogueModule, typeof i14.FormsModule, typeof i14.ReactiveFormsModule, typeof i13.VerbenPopUpModule, typeof i13.VerbenaButtonModule, typeof i13.DropDownModule, typeof i15.LabelEditorComponent, typeof i16.EditorModule, typeof i13.VerbenaInputModule, typeof i13.VerbenaSwitchModule, typeof i13.VerbenaTextareaModule], [typeof i1.WorkflowDesignerComponent]>;
|
|
@@ -1,9 +1,43 @@
|
|
|
1
1
|
import { SwimLane, Tag, Workflow, WorkflowAction, WorkflowStage } from 'verben-workflow-ui/src/lib/models';
|
|
2
2
|
import { Connection, ConnectionPoint, Node, SwimlaneItem, ToolType } from './workflow-designer.types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* The designer's single source of truth — and, in practice, its domain-logic
|
|
6
|
+
* god object. Holds the entire editing model plus most of the behaviour that
|
|
7
|
+
* operates on it: node placement, connection creation and routing, connection
|
|
8
|
+
* rules, swimlane management, and the whole save-time transform.
|
|
9
|
+
*
|
|
10
|
+
* ## How mutation works here
|
|
11
|
+
*
|
|
12
|
+
* This is a `providedIn: 'root'` singleton injected **by reference** into every
|
|
13
|
+
* component that touches the model. Components mutate its arrays directly
|
|
14
|
+
* (`state.connections.push(...)`) — there is no store, reducer, or action
|
|
15
|
+
* indirection. Change detection works because templates iterate
|
|
16
|
+
* `state.swimlanes` / `state.connections` with `@for`.
|
|
17
|
+
*
|
|
18
|
+
* The one deliberate exception is {@link moveNodeToSwimlane}, which reassigns
|
|
19
|
+
* arrays immutably so `@for` re-renders **both** the source and target lanes.
|
|
20
|
+
* In-place mutation is fine everywhere else, but not across two lanes at once.
|
|
21
|
+
*
|
|
22
|
+
* ## Before you change this class
|
|
23
|
+
*
|
|
24
|
+
* A parallel implementation exists under `services/` (`NodeManagementService`,
|
|
25
|
+
* `ConnectionService`, `TransformerService`, ...) that duplicates much of this
|
|
26
|
+
* logic. It is only partially wired in, and the copies have **drifted** — the
|
|
27
|
+
* two disagree on node placement offsets, connection endpoint offsets, and
|
|
28
|
+
* which node types may connect. This class is the live path; the services are
|
|
29
|
+
* mostly not. Change this one.
|
|
30
|
+
*
|
|
31
|
+
* @see ./docs/01-architecture.md — the split-brain problem in full
|
|
32
|
+
* @see ./docs/02-coordinate-system.md — read before touching any coordinate math
|
|
33
|
+
* @see ./docs/06-known-issues.md — the catalogued divergences
|
|
34
|
+
*/
|
|
4
35
|
export declare class WorkflowDesignerState {
|
|
36
|
+
/** Ordered lanes. Each owns its own nodes; there is no flat node list. */
|
|
5
37
|
swimlanes: SwimlaneItem[];
|
|
38
|
+
/** Id of the workflow's entry-point node. */
|
|
6
39
|
startNodeId: string | null;
|
|
40
|
+
/** All edges, flat across lanes. */
|
|
7
41
|
connections: Connection[];
|
|
8
42
|
draggingConnectionData: {
|
|
9
43
|
sourcePoint?: ConnectionPoint;
|
|
@@ -16,17 +50,88 @@ export declare class WorkflowDesignerState {
|
|
|
16
50
|
workflowFormId: string | null;
|
|
17
51
|
workflowFormName: string | null;
|
|
18
52
|
workflowId: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* The workflow exactly as loaded from the API.
|
|
55
|
+
*
|
|
56
|
+
* This and the three `*Record` maps below are kept so that save can tell new
|
|
57
|
+
* objects from changed ones and emit the correct `ObjectState`. Losing them
|
|
58
|
+
* makes every entity look new on the next save.
|
|
59
|
+
*/
|
|
19
60
|
workflow: Workflow | null;
|
|
61
|
+
/** Originally-loaded lanes, keyed by id. */
|
|
20
62
|
swimlaneRecord: Record<string, SwimLane>;
|
|
63
|
+
/** Originally-loaded stages, keyed by id. */
|
|
21
64
|
stageRecord: Record<string, WorkflowStage>;
|
|
65
|
+
/** Originally-loaded actions, keyed by id. */
|
|
22
66
|
actionRecord: Record<string, WorkflowAction>;
|
|
23
67
|
setWorkflowId(id: string): void;
|
|
24
68
|
laneIdToIndexMap: Map<string, number>;
|
|
69
|
+
/**
|
|
70
|
+
* Which node types each source type may connect to. Consulted by
|
|
71
|
+
* {@link canConnect} and {@link getAllowedTargetNodeTypes}.
|
|
72
|
+
*
|
|
73
|
+
* Forms are terminal sinks — they accept incoming edges but have no outgoing
|
|
74
|
+
* ones, which is why `form` maps to an empty list.
|
|
75
|
+
*
|
|
76
|
+
* ⚠️ `ConnectionService` holds a **different** copy of this table that also
|
|
77
|
+
* allows `stage → form`. The two have drifted; this one is the live path.
|
|
78
|
+
* See `./docs/06-known-issues.md` section A.
|
|
79
|
+
*/
|
|
25
80
|
private readonly connectionRules;
|
|
26
81
|
setWorkflowForm(formId: string | null, formName: string | null): void;
|
|
27
82
|
addSwimlane(name: string, tags: Tag[]): void;
|
|
28
83
|
registerLaneMapping(laneId: string, swimlaneIndex: number): void;
|
|
84
|
+
/**
|
|
85
|
+
* Builds the attachment points for a node, laid out to match its rendered
|
|
86
|
+
* shape. Returned coordinates are **relative to the node's own origin**.
|
|
87
|
+
*
|
|
88
|
+
* Layout per type:
|
|
89
|
+
* - **stage** — points every 50px along all four edges.
|
|
90
|
+
* - **decision** — one point at each of the diamond's four edge midpoints.
|
|
91
|
+
* - **form** — `left` (input) points only; forms are terminal sinks.
|
|
92
|
+
* - **subflow** — top, bottom, and two points on each of left and right.
|
|
93
|
+
*
|
|
94
|
+
* Regenerate these whenever a node's size or type changes, or connections
|
|
95
|
+
* will reference point ids that no longer exist.
|
|
96
|
+
*/
|
|
29
97
|
generateConnectionPoints(node: Node): ConnectionPoint[];
|
|
98
|
+
/**
|
|
99
|
+
* Creates a node in a swimlane and returns it (or `null` if the lane or type
|
|
100
|
+
* is invalid).
|
|
101
|
+
*
|
|
102
|
+
* ## Coordinate contract — callers must obey both halves
|
|
103
|
+
*
|
|
104
|
+
* 1. `y` must be an **absolute canvas Y**, not lane-relative. This method
|
|
105
|
+
* converts it internally (`y - swimlaneIndex * 263`).
|
|
106
|
+
* 2. `swimlaneIndex` must be the **drop-target** lane — the lane the node is
|
|
107
|
+
* landing in — not the lane a drag started from.
|
|
108
|
+
*
|
|
109
|
+
* Violating either half double-subtracts the lane offset and the node renders
|
|
110
|
+
* roughly one lane too high, attached to the wrong swimlane. That was the
|
|
111
|
+
* connection-drop bug; `designer-canvas.connection-drop.spec.ts` pins it.
|
|
112
|
+
*
|
|
113
|
+
* The canonical correct caller is toolbar placement in
|
|
114
|
+
* `workflow-designer.component.ts`:
|
|
115
|
+
*
|
|
116
|
+
* ```ts
|
|
117
|
+
* const swimlaneIndex = Math.floor(event.y / 263); // target lane from drop Y
|
|
118
|
+
* this.state.addNode(swimlaneIndex, 'stage', event.x, event.y /* absolute *\/);
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* The first node created in an empty workflow is automatically marked as the
|
|
122
|
+
* start node.
|
|
123
|
+
*
|
|
124
|
+
* ⚠️ `NodeManagementService.addNode` applies an extra `- 40` that this method
|
|
125
|
+
* and the render template do not. See `./docs/06-known-issues.md` section A.
|
|
126
|
+
*
|
|
127
|
+
* @param swimlaneIndex Target lane index (the lane the node lands in).
|
|
128
|
+
* @param type Node type; `'swimlane'` and `'action'` are rejected.
|
|
129
|
+
* @param x Canvas X.
|
|
130
|
+
* @param y **Absolute** canvas Y.
|
|
131
|
+
* @param useExistingId Reuse `stageData.Code` as the node id instead of
|
|
132
|
+
* generating one — used when rebuilding nodes from a loaded workflow so
|
|
133
|
+
* they keep their backend identity.
|
|
134
|
+
*/
|
|
30
135
|
addNode(swimlaneIndex: number, type: ToolType, x: number, y: number, stageData?: Partial<WorkflowStage>, workflowData?: {
|
|
31
136
|
id: string;
|
|
32
137
|
name: string;
|
|
@@ -41,6 +146,13 @@ export declare class WorkflowDesignerState {
|
|
|
41
146
|
updateConnectionDrag(currentX: number, currentY: number): void;
|
|
42
147
|
endConnectionDrag(): void;
|
|
43
148
|
isConnectionDragging(): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Endpoints for the **in-progress** connection preview line: from the source
|
|
151
|
+
* point (resolved to absolute canvas space) to the current cursor position.
|
|
152
|
+
*
|
|
153
|
+
* Returns `null` when no drag is active. For a *saved* connection's
|
|
154
|
+
* endpoints, use {@link getConnectionData} instead.
|
|
155
|
+
*/
|
|
44
156
|
getConnectionPathData(): {
|
|
45
157
|
startX: number;
|
|
46
158
|
startY: number;
|
|
@@ -48,7 +160,39 @@ export declare class WorkflowDesignerState {
|
|
|
48
160
|
endY: number;
|
|
49
161
|
sourceSwimlaneIndex: number;
|
|
50
162
|
} | null;
|
|
163
|
+
/**
|
|
164
|
+
* Completes the in-progress drag by pushing a `Connection` from the recorded
|
|
165
|
+
* source point to the given target, and returns it.
|
|
166
|
+
*
|
|
167
|
+
* Reads the source from {@link draggingConnectionData}, so it is only valid
|
|
168
|
+
* during a drag — returns `null` if no source was recorded.
|
|
169
|
+
*
|
|
170
|
+
* Note this does **not** check {@link canConnect}; callers are expected to
|
|
171
|
+
* have validated the pairing before calling. The new connection has an empty
|
|
172
|
+
* label and no action — those are filled in afterwards via the action dialog.
|
|
173
|
+
*/
|
|
51
174
|
createConnection(targetNodeId: string, targetPointId: string, targetSwimlaneIndex: number): Connection | null;
|
|
175
|
+
/**
|
|
176
|
+
* Resolves a saved connection's endpoints into **absolute canvas
|
|
177
|
+
* coordinates** for rendering:
|
|
178
|
+
*
|
|
179
|
+
* ```
|
|
180
|
+
* startY = sourceNode.y + sourcePoint.y + connection.sourceSwimlaneIndex * 263
|
|
181
|
+
* endY = targetNode.y + targetPoint.y + connection.targetSwimlaneIndex * 263
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* Both offsets are needed because `node.y` is lane-relative and `point.y` is
|
|
185
|
+
* node-relative.
|
|
186
|
+
*
|
|
187
|
+
* Returns `null` if either endpoint's node no longer exists — callers should
|
|
188
|
+
* treat that as "skip rendering this edge", not as an error.
|
|
189
|
+
*
|
|
190
|
+
* ⚠️ Relies on the connection's denormalised lane indices being current. A
|
|
191
|
+
* node moved between lanes without its connections updated renders detached.
|
|
192
|
+
*
|
|
193
|
+
* ⚠️ `ConnectionService.getConnectionData` adds a further `+ 40` here. The two
|
|
194
|
+
* disagree; this is the live path. See `./docs/06-known-issues.md` section A.
|
|
195
|
+
*/
|
|
52
196
|
getConnectionData(connection: Connection): {
|
|
53
197
|
startX: number;
|
|
54
198
|
startY: number;
|
|
@@ -57,7 +201,16 @@ export declare class WorkflowDesignerState {
|
|
|
57
201
|
sourceSwimlaneIndex: number;
|
|
58
202
|
targetSwimlaneIndex: number;
|
|
59
203
|
} | null;
|
|
204
|
+
/**
|
|
205
|
+
* Whether an edge from `sourceNodeType` to `targetNodeType` is permitted by
|
|
206
|
+
* {@link connectionRules}. Unknown types return `false`.
|
|
207
|
+
*/
|
|
60
208
|
canConnect(sourceNodeType: string, targetNodeType: string): boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Node types the in-progress drag is allowed to land on. Drives the choices
|
|
211
|
+
* offered in the node-type popup when a connection is dropped on empty
|
|
212
|
+
* canvas. Empty when no drag is active.
|
|
213
|
+
*/
|
|
61
214
|
getAllowedTargetNodeTypes(): string[];
|
|
62
215
|
/**
|
|
63
216
|
* Deletes a swimlane. Only succeeds when the lane has no nodes — stages must
|
|
@@ -76,6 +229,32 @@ export declare class WorkflowDesignerState {
|
|
|
76
229
|
*/
|
|
77
230
|
deleteSwimlane(index: number): boolean;
|
|
78
231
|
updateSwimlane(index: number, name: string, tags: Tag[]): void;
|
|
232
|
+
/**
|
|
233
|
+
* Rebuilds the full `Workflow` API model from the current editing state —
|
|
234
|
+
* the save-side counterpart to `parseWorkflowData` in
|
|
235
|
+
* `workflow-designer.component.ts`.
|
|
236
|
+
*
|
|
237
|
+
* Mapping:
|
|
238
|
+
* - swimlanes → `Lanes`
|
|
239
|
+
* - stage **and subflow** nodes → `Stages` (subflows carry `IsSubProcess: true`)
|
|
240
|
+
* - connections → `Actions`
|
|
241
|
+
*
|
|
242
|
+
* Each entity's `DataState` is derived by looking it up in `swimlaneRecord` /
|
|
243
|
+
* `stageRecord` / `actionRecord`: found means `Changed`, absent means `New`.
|
|
244
|
+
* Clearing those maps therefore makes everything save as new.
|
|
245
|
+
*
|
|
246
|
+
* ⚠️ Decision and form nodes are **not** emitted as stages — only `stage` and
|
|
247
|
+
* `subflow` are. Decision semantics survive through the conditions on their
|
|
248
|
+
* connections.
|
|
249
|
+
*
|
|
250
|
+
* ⚠️ When no workflow was loaded, the header is hard-coded (`Name: 'New
|
|
251
|
+
* Workflow'`, empty description, default assignment and status) because the
|
|
252
|
+
* designer has no UI for editing it. See `./docs/06-known-issues.md` section G.
|
|
253
|
+
*
|
|
254
|
+
* This only builds the payload; `WorkflowDataService.saveWorkflows` sends it.
|
|
255
|
+
* Deletions are not part of this — they are issued eagerly at the point of
|
|
256
|
+
* user action. See `./docs/08-api-reference.md` section 3.
|
|
257
|
+
*/
|
|
79
258
|
transformToWorkflowModel(): Workflow;
|
|
80
259
|
getConnectionPointType(pointId: string): 'top' | 'right' | 'bottom' | 'left' | undefined;
|
|
81
260
|
loadedObjectIds: {
|