@acorex-platform/module-workflow-management-client 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-B_Sl7G2v.mjs +4990 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-B_Sl7G2v.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-BPa0Sh6Z.mjs +57 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-BPa0Sh6Z.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-DuYGXzAL.mjs +482 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-DuYGXzAL.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-contracts.mjs +163 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-BFdyJ4rC.mjs +127 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-BFdyJ4rC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow.command-Cfdm1QAy.mjs +142 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow.command-Cfdm1QAy.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-C8nsbDAw.mjs +142 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-C8nsbDAw.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-CttfExOC.mjs +417 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-CttfExOC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-DKZTLui4.mjs +1329 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-DKZTLui4.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs +60 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs +172 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs +81 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-CVTeOv-q.mjs +538 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-CVTeOv-q.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries--9NtYkau.mjs +218 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries--9NtYkau.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-BWOyivC5.mjs +588 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-BWOyivC5.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-AnJ-Pywf.mjs +33 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-AnJ-Pywf.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-Bw68Jwcb.mjs +227 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-Bw68Jwcb.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-task-popover.component-Cg4gODGo.mjs +300 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-task-popover.component-Cg4gODGo.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client.mjs +2 -0
- package/fesm2022/acorex-platform-module-workflow-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-workflow-management-client-contracts.d.ts +341 -0
- package/types/acorex-platform-module-workflow-management-client.d.ts +1026 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
|
2
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
3
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, Injectable } from '@angular/core';
|
|
6
|
+
import { getRecordWorkflowInstanceId } from '@acorex-platform/framework-shared/entity';
|
|
7
|
+
import { AXPSessionService } from '@acorex-platform/framework-client/auth';
|
|
8
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
9
|
+
import { AXPWorkflowManager, AXP_WORKFLOW_ENGINE } from '@acorex-platform/framework-client/workflow';
|
|
10
|
+
import { get, isString } from 'lodash';
|
|
11
|
+
import { A as AXPWorkflowInstanceHumanTaskService, c as createWorkflowInstanceBookmarkAccess, i as isWorkflowPooledClaimablePayload, n as normalizeWorkflowTaskUserIds } from './acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-B_Sl7G2v.mjs';
|
|
12
|
+
import { AXPopupService } from '@acorex/components/popup';
|
|
13
|
+
|
|
14
|
+
//#region ---- Imports ----
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ---- Service ----
|
|
17
|
+
/**
|
|
18
|
+
* Resolves workflow run operations for workflow-run plugin list rows.
|
|
19
|
+
* Delegates resume/take-over to {@link AXPWorkflowInstanceHumanTaskService} (same as task board).
|
|
20
|
+
*/
|
|
21
|
+
class AXPWorkflowRunActionService {
|
|
22
|
+
constructor() {
|
|
23
|
+
//#region ---- Services & Dependencies ----
|
|
24
|
+
this.entityService = inject(AXPEntityService);
|
|
25
|
+
this.humanTaskService = inject(AXPWorkflowInstanceHumanTaskService);
|
|
26
|
+
this.workflowManager = inject(AXPWorkflowManager);
|
|
27
|
+
this.sessionService = inject(AXPSessionService);
|
|
28
|
+
this.translationService = inject(AXTranslationService);
|
|
29
|
+
this.toastService = inject(AXToastService);
|
|
30
|
+
this.workflowEngine = inject(AXP_WORKFLOW_ENGINE, { optional: true });
|
|
31
|
+
this.bookmarkAccess = createWorkflowInstanceBookmarkAccess();
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ---- Instance resolution ----
|
|
35
|
+
/** Reads workflow instance id from a domain list row or command payload. */
|
|
36
|
+
resolveInstanceId(record) {
|
|
37
|
+
if (!record || typeof record !== 'object') {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const fromWorkflowInfo = getRecordWorkflowInstanceId(record);
|
|
41
|
+
if (fromWorkflowInfo) {
|
|
42
|
+
return fromWorkflowInfo;
|
|
43
|
+
}
|
|
44
|
+
const direct = get(record, 'instanceId');
|
|
45
|
+
if (typeof direct === 'string' && direct.trim().length > 0) {
|
|
46
|
+
return direct.trim();
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Finds the primary suspended human-task bookmark for continue / take-over.
|
|
52
|
+
* Prefers task-board human-task and cartable bookmarks.
|
|
53
|
+
*/
|
|
54
|
+
async findPrimarySuspendedHumanTask(instanceId) {
|
|
55
|
+
const trimmed = instanceId?.trim();
|
|
56
|
+
if (!trimmed) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const instance = await this.bookmarkAccess.loadInstanceForContinuation(trimmed);
|
|
60
|
+
if (!instance || instance.subStatus !== 'Suspended') {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const active = this.bookmarkAccess.getActiveBookmarks(instance);
|
|
64
|
+
for (const bookmark of active) {
|
|
65
|
+
const payload = this.bookmarkAccess.parseHumanTaskPayload(bookmark);
|
|
66
|
+
if (!payload?.taskToken || !this.isTaskBoardHumanPayload(payload)) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
return { instance, bookmark, payload };
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region ---- Run operations ----
|
|
75
|
+
/** Runs the primary human-task action on the current suspended step (e.g. open questionnaire). */
|
|
76
|
+
async continueRun(instanceId) {
|
|
77
|
+
const task = await this.findPrimarySuspendedHumanTask(instanceId);
|
|
78
|
+
if (!task) {
|
|
79
|
+
return { success: false, error: 'NO_SUSPENDED_TASK' };
|
|
80
|
+
}
|
|
81
|
+
const payload = task.payload;
|
|
82
|
+
if (isWorkflowPooledClaimablePayload(payload)) {
|
|
83
|
+
return this.continuePooledHumanTask(instanceId, task);
|
|
84
|
+
}
|
|
85
|
+
const outcome = this.humanTaskService.resolvePrimaryTaskOutcome(payload);
|
|
86
|
+
const assigned = normalizeWorkflowTaskUserIds(payload.assignedUserIds);
|
|
87
|
+
const currentUserId = this.sessionService.user?.id;
|
|
88
|
+
if (currentUserId &&
|
|
89
|
+
assigned.length > 0 &&
|
|
90
|
+
!assigned.includes(String(currentUserId)) &&
|
|
91
|
+
(outcome === 'approve' || outcome === 'reject')) {
|
|
92
|
+
const content = await this.translationService.translateAsync('@workflow-management:workflow-run.messages.awaiting-approver');
|
|
93
|
+
this.toastService.show({
|
|
94
|
+
color: 'warning',
|
|
95
|
+
title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),
|
|
96
|
+
content,
|
|
97
|
+
closeButton: true,
|
|
98
|
+
});
|
|
99
|
+
return { success: false, error: 'NOT_ASSIGNEE', message: content };
|
|
100
|
+
}
|
|
101
|
+
const result = await this.humanTaskService.executePrimaryHumanTaskAction(instanceId, task.bookmark.activityId, {
|
|
102
|
+
suppressContinuation: true,
|
|
103
|
+
notifyViews: true,
|
|
104
|
+
});
|
|
105
|
+
if (!result?.success) {
|
|
106
|
+
return {
|
|
107
|
+
success: false,
|
|
108
|
+
error: 'RESUME_FAILED',
|
|
109
|
+
message: result?.error,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return { success: true };
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Pooled cartable / human-task steps must be claimed before approve/reject.
|
|
116
|
+
* Claims for the current user when they are a candidate, then directs them to the task board.
|
|
117
|
+
*/
|
|
118
|
+
async continuePooledHumanTask(instanceId, task) {
|
|
119
|
+
const currentUserId = this.sessionService.user?.id;
|
|
120
|
+
const candidates = normalizeWorkflowTaskUserIds(task.payload.candidateUserIds);
|
|
121
|
+
if (!currentUserId || !candidates.includes(String(currentUserId))) {
|
|
122
|
+
const content = await this.translationService.translateAsync('@workflow-management:tasks.errors.not-assignee');
|
|
123
|
+
this.toastService.show({
|
|
124
|
+
color: 'warning',
|
|
125
|
+
title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),
|
|
126
|
+
content,
|
|
127
|
+
closeButton: true,
|
|
128
|
+
});
|
|
129
|
+
return { success: false, error: 'NOT_CANDIDATE', message: content };
|
|
130
|
+
}
|
|
131
|
+
const claimResult = await this.workflowManager.claimTask(instanceId, task.bookmark.id, task.bookmark.activityId);
|
|
132
|
+
if (!claimResult.success) {
|
|
133
|
+
return {
|
|
134
|
+
success: false,
|
|
135
|
+
error: 'CLAIM_FAILED',
|
|
136
|
+
message: claimResult.error,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
this.humanTaskService.notifyWorkflowTaskViewsChanged();
|
|
140
|
+
const content = await this.translationService.translateAsync('@workflow-management:workflow-run.messages.use-task-board');
|
|
141
|
+
this.toastService.show({
|
|
142
|
+
color: 'success',
|
|
143
|
+
title: await this.translationService.translateAsync('@general:messages.generic.success.title'),
|
|
144
|
+
content,
|
|
145
|
+
closeButton: true,
|
|
146
|
+
});
|
|
147
|
+
return { success: true };
|
|
148
|
+
}
|
|
149
|
+
/** Take over the current suspended human-task bookmark without advancing the workflow. */
|
|
150
|
+
async takeOverRun(instanceId) {
|
|
151
|
+
const task = await this.findPrimarySuspendedHumanTask(instanceId);
|
|
152
|
+
if (!task) {
|
|
153
|
+
return { success: false, error: 'NO_SUSPENDED_TASK' };
|
|
154
|
+
}
|
|
155
|
+
const reassigned = await this.humanTaskService.reassignBookmarkToCurrentUserWithConfirm(instanceId, task.bookmark.id, task.bookmark.activityId);
|
|
156
|
+
if (!reassigned) {
|
|
157
|
+
return { success: false, error: 'REASSIGN_FAILED' };
|
|
158
|
+
}
|
|
159
|
+
this.humanTaskService.notifyWorkflowTaskViewsChanged();
|
|
160
|
+
return { success: true };
|
|
161
|
+
}
|
|
162
|
+
/** Cancels a workflow instance and optionally marks the linked domain row as cancelled. */
|
|
163
|
+
async cancelRun(params) {
|
|
164
|
+
const instanceId = params.instanceId?.trim();
|
|
165
|
+
if (!instanceId) {
|
|
166
|
+
return { success: false };
|
|
167
|
+
}
|
|
168
|
+
const engine = this.workflowEngine;
|
|
169
|
+
if (engine?.cancelInstance) {
|
|
170
|
+
await engine.cancelInstance(instanceId, params.reason?.trim() || 'cancelled-by-user');
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const now = new Date().toISOString();
|
|
174
|
+
await this.entityService.withEntity('WorkflowManagement', 'WorkflowInstance').data().update(instanceId, {
|
|
175
|
+
status: 'Finished',
|
|
176
|
+
subStatus: 'Cancelled',
|
|
177
|
+
finishedAt: now,
|
|
178
|
+
updatedAt: now,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
const recordId = params.recordId?.trim();
|
|
182
|
+
const entitySource = params.entitySource?.trim();
|
|
183
|
+
if (recordId && entitySource) {
|
|
184
|
+
const [moduleName, entityName] = entitySource.split('.');
|
|
185
|
+
if (moduleName && entityName) {
|
|
186
|
+
const statusField = params.statusField?.trim() || 'statusId';
|
|
187
|
+
const cancelledStatus = params.cancelledStatusId?.trim() || 'cancelled';
|
|
188
|
+
await this.entityService.withEntity(moduleName, entityName).data().update(recordId, {
|
|
189
|
+
[statusField]: cancelledStatus,
|
|
190
|
+
...(params.reason ? { notes: params.reason } : {}),
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
this.humanTaskService.notifyWorkflowTaskViewsChanged();
|
|
195
|
+
return { success: true };
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region ---- Helpers ----
|
|
199
|
+
isTaskBoardHumanPayload(payload) {
|
|
200
|
+
const activityType = payload.activityType;
|
|
201
|
+
return activityType === 'workflow-activity:human-task' || activityType === 'workflow-activity:cartable';
|
|
202
|
+
}
|
|
203
|
+
/** Parses `Module.Entity` and record id from flat command input. */
|
|
204
|
+
parseCommandRecordContext(input) {
|
|
205
|
+
const ctx = input;
|
|
206
|
+
const data = ctx?.data;
|
|
207
|
+
const entitySource = ctx?.entityInfo?.source?.trim() ||
|
|
208
|
+
ctx?.entity?.trim() ||
|
|
209
|
+
(ctx?.entityInfo?.module && ctx?.entityInfo?.name
|
|
210
|
+
? `${ctx.entityInfo.module}.${ctx.entityInfo.name}`
|
|
211
|
+
: null);
|
|
212
|
+
const recordId = data && typeof data === 'object' && isString(get(data, 'id'))
|
|
213
|
+
? String(get(data, 'id')).trim()
|
|
214
|
+
: null;
|
|
215
|
+
return {
|
|
216
|
+
entitySource,
|
|
217
|
+
recordId,
|
|
218
|
+
instanceId: this.resolveInstanceId(data),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPWorkflowRunActionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
222
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPWorkflowRunActionService, providedIn: 'root' }); }
|
|
223
|
+
}
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPWorkflowRunActionService, decorators: [{
|
|
225
|
+
type: Injectable,
|
|
226
|
+
args: [{ providedIn: 'root' }]
|
|
227
|
+
}] });
|
|
228
|
+
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region ---- Command ----
|
|
231
|
+
/** Cancels a workflow run and marks the linked domain row as cancelled when applicable. */
|
|
232
|
+
class CancelWorkflowRunCommand {
|
|
233
|
+
constructor() {
|
|
234
|
+
//#region ---- Services & Dependencies ----
|
|
235
|
+
this.runActionService = inject(AXPWorkflowRunActionService);
|
|
236
|
+
this.dialogService = inject(AXDialogService);
|
|
237
|
+
this.toastService = inject(AXToastService);
|
|
238
|
+
this.translationService = inject(AXTranslationService);
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region ---- Command Implementation ----
|
|
242
|
+
async execute(input) {
|
|
243
|
+
const { instanceId, entitySource, recordId } = this.runActionService.parseCommandRecordContext(input);
|
|
244
|
+
if (!instanceId) {
|
|
245
|
+
return { success: false, message: { text: 'No workflow instance is linked to this record.' } };
|
|
246
|
+
}
|
|
247
|
+
const title = await this.translationService.translateAsync('@workflow-management:workflow-run.dialogs.cancel-run.title');
|
|
248
|
+
const message = await this.translationService.translateAsync('@workflow-management:workflow-run.dialogs.cancel-run.message');
|
|
249
|
+
const confirmed = await this.dialogService.confirm(title, message, 'warning', 'horizontal', false, 'cancel');
|
|
250
|
+
if (!confirmed.result) {
|
|
251
|
+
return { success: false };
|
|
252
|
+
}
|
|
253
|
+
const reason = await this.translationService.translateAsync('@workflow-management:workflow-run.messages.cancel-run-note');
|
|
254
|
+
const result = await this.runActionService.cancelRun({
|
|
255
|
+
instanceId,
|
|
256
|
+
entitySource: entitySource ?? undefined,
|
|
257
|
+
recordId: recordId ?? undefined,
|
|
258
|
+
reason,
|
|
259
|
+
});
|
|
260
|
+
if (!result.success) {
|
|
261
|
+
return { success: false, message: { text: 'Could not cancel the workflow run.' } };
|
|
262
|
+
}
|
|
263
|
+
this.toastService.show({
|
|
264
|
+
color: 'success',
|
|
265
|
+
title: await this.translationService.translateAsync('@general:messages.generic.success.title'),
|
|
266
|
+
content: await this.translationService.translateAsync('@workflow-management:workflow-run.messages.cancel-run-success'),
|
|
267
|
+
closeButton: true,
|
|
268
|
+
timeOut: 3000,
|
|
269
|
+
});
|
|
270
|
+
return { success: true, kind: 'object', data: undefined };
|
|
271
|
+
}
|
|
272
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CancelWorkflowRunCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
273
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CancelWorkflowRunCommand, providedIn: 'root' }); }
|
|
274
|
+
}
|
|
275
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CancelWorkflowRunCommand, decorators: [{
|
|
276
|
+
type: Injectable,
|
|
277
|
+
args: [{ providedIn: 'root' }]
|
|
278
|
+
}] });
|
|
279
|
+
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region ---- Command ----
|
|
282
|
+
/** Continues the current suspended human-task step for a workflow-backed domain row. */
|
|
283
|
+
class ContinueWorkflowRunCommand {
|
|
284
|
+
constructor() {
|
|
285
|
+
//#region ---- Services & Dependencies ----
|
|
286
|
+
this.runActionService = inject(AXPWorkflowRunActionService);
|
|
287
|
+
this.toastService = inject(AXToastService);
|
|
288
|
+
this.translationService = inject(AXTranslationService);
|
|
289
|
+
}
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region ---- Command Implementation ----
|
|
292
|
+
async execute(input) {
|
|
293
|
+
const { instanceId } = this.runActionService.parseCommandRecordContext(input);
|
|
294
|
+
if (!instanceId) {
|
|
295
|
+
return { success: false, message: { text: 'No workflow instance is linked to this record.' } };
|
|
296
|
+
}
|
|
297
|
+
const result = await this.runActionService.continueRun(instanceId);
|
|
298
|
+
if (result.success) {
|
|
299
|
+
return { success: true, kind: 'object', data: undefined };
|
|
300
|
+
}
|
|
301
|
+
if (result.error === 'NO_SUSPENDED_TASK') {
|
|
302
|
+
const content = await this.translationService.translateAsync('@workflow-management:workflow-run.messages.no-pending-step');
|
|
303
|
+
this.toastService.show({
|
|
304
|
+
color: 'warning',
|
|
305
|
+
title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),
|
|
306
|
+
content,
|
|
307
|
+
closeButton: true,
|
|
308
|
+
});
|
|
309
|
+
return { success: false };
|
|
310
|
+
}
|
|
311
|
+
if (result.message) {
|
|
312
|
+
this.toastService.show({
|
|
313
|
+
color: 'danger',
|
|
314
|
+
title: await this.translationService.translateAsync('@general:messages.generic.error.title'),
|
|
315
|
+
content: result.message,
|
|
316
|
+
closeButton: true,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
return { success: false };
|
|
320
|
+
}
|
|
321
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ContinueWorkflowRunCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
322
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ContinueWorkflowRunCommand, providedIn: 'root' }); }
|
|
323
|
+
}
|
|
324
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ContinueWorkflowRunCommand, decorators: [{
|
|
325
|
+
type: Injectable,
|
|
326
|
+
args: [{ providedIn: 'root' }]
|
|
327
|
+
}] });
|
|
328
|
+
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region ---- Command ----
|
|
331
|
+
/** Opens the workflow run history popup (timeline + disabled visual tab) for a domain list row. */
|
|
332
|
+
class ShowWorkflowRunHistoryCommand {
|
|
333
|
+
constructor() {
|
|
334
|
+
//#region ---- Services & Dependencies ----
|
|
335
|
+
this.popupService = inject(AXPopupService);
|
|
336
|
+
this.runActionService = inject(AXPWorkflowRunActionService);
|
|
337
|
+
this.translationService = inject(AXTranslationService);
|
|
338
|
+
}
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region ---- Command Implementation ----
|
|
341
|
+
async execute(input) {
|
|
342
|
+
const { instanceId } = this.runActionService.parseCommandRecordContext(input);
|
|
343
|
+
if (!instanceId) {
|
|
344
|
+
return {
|
|
345
|
+
success: false,
|
|
346
|
+
message: {
|
|
347
|
+
text: await this.translationService.translateAsync('@workflow-management:workflow-run.history.messages.no-instance'),
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
const comp = (await import('./acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-BWOyivC5.mjs')).AXMWorkflowRunHistoryPopupComponent;
|
|
352
|
+
this.popupService.open(comp, {
|
|
353
|
+
title: '',
|
|
354
|
+
size: 'lg',
|
|
355
|
+
data: { instanceId },
|
|
356
|
+
});
|
|
357
|
+
return {
|
|
358
|
+
success: true,
|
|
359
|
+
kind: 'object',
|
|
360
|
+
data: undefined,
|
|
361
|
+
metadata: { refresh: false },
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ShowWorkflowRunHistoryCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
365
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ShowWorkflowRunHistoryCommand, providedIn: 'root' }); }
|
|
366
|
+
}
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ShowWorkflowRunHistoryCommand, decorators: [{
|
|
368
|
+
type: Injectable,
|
|
369
|
+
args: [{ providedIn: 'root' }]
|
|
370
|
+
}] });
|
|
371
|
+
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region ---- Command ----
|
|
374
|
+
/** Reassigns the current suspended human-task to the current user (take over). */
|
|
375
|
+
class TakeOverWorkflowRunCommand {
|
|
376
|
+
constructor() {
|
|
377
|
+
//#region ---- Services & Dependencies ----
|
|
378
|
+
this.runActionService = inject(AXPWorkflowRunActionService);
|
|
379
|
+
this.toastService = inject(AXToastService);
|
|
380
|
+
this.translationService = inject(AXTranslationService);
|
|
381
|
+
}
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region ---- Command Implementation ----
|
|
384
|
+
async execute(input) {
|
|
385
|
+
const { instanceId } = this.runActionService.parseCommandRecordContext(input);
|
|
386
|
+
if (!instanceId) {
|
|
387
|
+
return { success: false, message: { text: 'No workflow instance is linked to this record.' } };
|
|
388
|
+
}
|
|
389
|
+
const result = await this.runActionService.takeOverRun(instanceId);
|
|
390
|
+
if (result.success) {
|
|
391
|
+
return { success: true, kind: 'object', data: undefined };
|
|
392
|
+
}
|
|
393
|
+
if (result.error === 'NO_SUSPENDED_TASK') {
|
|
394
|
+
const content = await this.translationService.translateAsync('@workflow-management:workflow-run.messages.no-pending-step');
|
|
395
|
+
this.toastService.show({
|
|
396
|
+
color: 'warning',
|
|
397
|
+
title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),
|
|
398
|
+
content,
|
|
399
|
+
closeButton: true,
|
|
400
|
+
});
|
|
401
|
+
return { success: false };
|
|
402
|
+
}
|
|
403
|
+
return { success: false };
|
|
404
|
+
}
|
|
405
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TakeOverWorkflowRunCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
406
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TakeOverWorkflowRunCommand, providedIn: 'root' }); }
|
|
407
|
+
}
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TakeOverWorkflowRunCommand, decorators: [{
|
|
409
|
+
type: Injectable,
|
|
410
|
+
args: [{ providedIn: 'root' }]
|
|
411
|
+
}] });
|
|
412
|
+
|
|
413
|
+
//#region ---- Exports ----
|
|
414
|
+
//#endregion
|
|
415
|
+
|
|
416
|
+
export { CancelWorkflowRunCommand, ContinueWorkflowRunCommand, ShowWorkflowRunHistoryCommand, TakeOverWorkflowRunCommand };
|
|
417
|
+
//# sourceMappingURL=acorex-platform-module-workflow-management-client-index-CttfExOC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workflow-management-client-index-CttfExOC.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-run-plugin/workflow-run-action.service.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-run-plugin/commands/cancel-workflow-run.command.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-run-plugin/commands/continue-workflow-run.command.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-run-plugin/commands/show-workflow-run-history.command.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-run-plugin/commands/take-over-workflow-run.command.ts","../../../../libs/modules/workflow-management/client/src/lib/features/workflow-run-plugin/commands/index.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { getRecordWorkflowInstanceId } from '@acorex-platform/framework-shared/entity';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXP_WORKFLOW_ENGINE,\n AXPWorkflowEngine,\n AXPWorkflowManager,\n} from '@acorex-platform/framework-client/workflow';\nimport { inject, Injectable } from '@angular/core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXToastService } from '@acorex/components/toast';\nimport { get, isString } from 'lodash';\nimport { AXMWorkflowManagementWorkflowInstanceEntityModel } from '@acorex-platform/module-workflow-management-client/contracts';\nimport {\n createWorkflowInstanceBookmarkAccess,\n HumanTaskBookmarkPayload,\n WorkflowInstanceBookmarkRow,\n} from '../task-provider/workflow-instance-bookmark.access';\nimport { AXPWorkflowInstanceHumanTaskService } from '../task-provider/workflow-instance-human-task.service';\nimport {\n isWorkflowPooledClaimablePayload,\n normalizeWorkflowTaskUserIds,\n} from '../task-provider/workflow-task-continuation';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXPWorkflowRunSuspendedHumanTask {\n instance: AXMWorkflowManagementWorkflowInstanceEntityModel;\n bookmark: WorkflowInstanceBookmarkRow;\n payload: HumanTaskBookmarkPayload;\n}\n\nexport interface AXPWorkflowRunCancelParams {\n instanceId: string;\n entitySource?: string;\n recordId?: string;\n reason?: string;\n statusField?: string;\n cancelledStatusId?: string;\n}\n\n//#endregion\n\n//#region ---- Service ----\n\n/**\n * Resolves workflow run operations for workflow-run plugin list rows.\n * Delegates resume/take-over to {@link AXPWorkflowInstanceHumanTaskService} (same as task board).\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPWorkflowRunActionService {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly humanTaskService = inject(AXPWorkflowInstanceHumanTaskService);\n private readonly workflowManager = inject(AXPWorkflowManager);\n private readonly sessionService = inject(AXPSessionService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly workflowEngine = inject(AXP_WORKFLOW_ENGINE, { optional: true }) as AXPWorkflowEngine | null;\n private readonly bookmarkAccess = createWorkflowInstanceBookmarkAccess();\n\n //#endregion\n\n //#region ---- Instance resolution ----\n\n /** Reads workflow instance id from a domain list row or command payload. */\n resolveInstanceId(record: unknown): string | null {\n if (!record || typeof record !== 'object') {\n return null;\n }\n const fromWorkflowInfo = getRecordWorkflowInstanceId(\n record as { workflowInfo?: { instanceId?: string | null } },\n );\n if (fromWorkflowInfo) {\n return fromWorkflowInfo;\n }\n const direct = get(record as Record<string, unknown>, 'instanceId');\n if (typeof direct === 'string' && direct.trim().length > 0) {\n return direct.trim();\n }\n return null;\n }\n\n /**\n * Finds the primary suspended human-task bookmark for continue / take-over.\n * Prefers task-board human-task and cartable bookmarks.\n */\n async findPrimarySuspendedHumanTask(instanceId: string): Promise<AXPWorkflowRunSuspendedHumanTask | null> {\n const trimmed = instanceId?.trim();\n if (!trimmed) {\n return null;\n }\n\n const instance = await this.bookmarkAccess.loadInstanceForContinuation(trimmed);\n if (!instance || instance.subStatus !== 'Suspended') {\n return null;\n }\n\n const active = this.bookmarkAccess.getActiveBookmarks(instance);\n for (const bookmark of active) {\n const payload = this.bookmarkAccess.parseHumanTaskPayload(bookmark);\n if (!payload?.taskToken || !this.isTaskBoardHumanPayload(payload)) {\n continue;\n }\n return { instance, bookmark, payload };\n }\n\n return null;\n }\n\n //#endregion\n\n //#region ---- Run operations ----\n\n /** Runs the primary human-task action on the current suspended step (e.g. open questionnaire). */\n async continueRun(instanceId: string) {\n const task = await this.findPrimarySuspendedHumanTask(instanceId);\n if (!task) {\n return { success: false as const, error: 'NO_SUSPENDED_TASK' as const };\n }\n\n const payload = task.payload;\n if (isWorkflowPooledClaimablePayload(payload)) {\n return this.continuePooledHumanTask(instanceId, task);\n }\n\n const outcome = this.humanTaskService.resolvePrimaryTaskOutcome(payload);\n const assigned = normalizeWorkflowTaskUserIds(payload.assignedUserIds);\n const currentUserId = this.sessionService.user?.id;\n if (\n currentUserId &&\n assigned.length > 0 &&\n !assigned.includes(String(currentUserId)) &&\n (outcome === 'approve' || outcome === 'reject')\n ) {\n const content = await this.translationService.translateAsync(\n '@workflow-management:workflow-run.messages.awaiting-approver',\n );\n this.toastService.show({\n color: 'warning',\n title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),\n content,\n closeButton: true,\n });\n return { success: false as const, error: 'NOT_ASSIGNEE' as const, message: content };\n }\n\n const result = await this.humanTaskService.executePrimaryHumanTaskAction(instanceId, task.bookmark.activityId, {\n suppressContinuation: true,\n notifyViews: true,\n });\n\n if (!result?.success) {\n return {\n success: false as const,\n error: 'RESUME_FAILED' as const,\n message: result?.error,\n };\n }\n\n return { success: true as const };\n }\n\n /**\n * Pooled cartable / human-task steps must be claimed before approve/reject.\n * Claims for the current user when they are a candidate, then directs them to the task board.\n */\n private async continuePooledHumanTask(\n instanceId: string,\n task: AXPWorkflowRunSuspendedHumanTask,\n ): Promise<\n | { success: true }\n | { success: false; error: 'NOT_CANDIDATE' | 'CLAIM_FAILED' | 'RESUME_FAILED'; message?: string }\n > {\n const currentUserId = this.sessionService.user?.id;\n const candidates = normalizeWorkflowTaskUserIds(task.payload.candidateUserIds);\n if (!currentUserId || !candidates.includes(String(currentUserId))) {\n const content = await this.translationService.translateAsync(\n '@workflow-management:tasks.errors.not-assignee',\n );\n this.toastService.show({\n color: 'warning',\n title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),\n content,\n closeButton: true,\n });\n return { success: false as const, error: 'NOT_CANDIDATE' as const, message: content };\n }\n\n const claimResult = await this.workflowManager.claimTask(\n instanceId,\n task.bookmark.id,\n task.bookmark.activityId,\n );\n if (!claimResult.success) {\n return {\n success: false as const,\n error: 'CLAIM_FAILED' as const,\n message: claimResult.error,\n };\n }\n\n this.humanTaskService.notifyWorkflowTaskViewsChanged();\n const content = await this.translationService.translateAsync(\n '@workflow-management:workflow-run.messages.use-task-board',\n );\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync('@general:messages.generic.success.title'),\n content,\n closeButton: true,\n });\n return { success: true as const };\n }\n\n /** Take over the current suspended human-task bookmark without advancing the workflow. */\n async takeOverRun(instanceId: string) {\n const task = await this.findPrimarySuspendedHumanTask(instanceId);\n if (!task) {\n return { success: false as const, error: 'NO_SUSPENDED_TASK' as const };\n }\n\n const reassigned = await this.humanTaskService.reassignBookmarkToCurrentUserWithConfirm(\n instanceId,\n task.bookmark.id,\n task.bookmark.activityId,\n );\n\n if (!reassigned) {\n return { success: false as const, error: 'REASSIGN_FAILED' as const };\n }\n\n this.humanTaskService.notifyWorkflowTaskViewsChanged();\n return { success: true as const };\n }\n\n /** Cancels a workflow instance and optionally marks the linked domain row as cancelled. */\n async cancelRun(params: AXPWorkflowRunCancelParams): Promise<{ success: boolean }> {\n const instanceId = params.instanceId?.trim();\n if (!instanceId) {\n return { success: false };\n }\n\n const engine = this.workflowEngine;\n if (engine?.cancelInstance) {\n await engine.cancelInstance(instanceId, params.reason?.trim() || 'cancelled-by-user');\n } else {\n const now = new Date().toISOString();\n await this.entityService.withEntity('WorkflowManagement', 'WorkflowInstance').data().update(instanceId, {\n status: 'Finished',\n subStatus: 'Cancelled',\n finishedAt: now,\n updatedAt: now,\n } as never);\n }\n\n const recordId = params.recordId?.trim();\n const entitySource = params.entitySource?.trim();\n if (recordId && entitySource) {\n const [moduleName, entityName] = entitySource.split('.');\n if (moduleName && entityName) {\n const statusField = params.statusField?.trim() || 'statusId';\n const cancelledStatus = params.cancelledStatusId?.trim() || 'cancelled';\n await this.entityService.withEntity(moduleName, entityName).data().update(recordId, {\n [statusField]: cancelledStatus,\n ...(params.reason ? { notes: params.reason } : {}),\n } as never);\n }\n }\n\n this.humanTaskService.notifyWorkflowTaskViewsChanged();\n return { success: true };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private isTaskBoardHumanPayload(payload: HumanTaskBookmarkPayload): boolean {\n const activityType = payload.activityType;\n return activityType === 'workflow-activity:human-task' || activityType === 'workflow-activity:cartable';\n }\n\n /** Parses `Module.Entity` and record id from flat command input. */\n parseCommandRecordContext(input: {\n entity?: string;\n entityInfo?: { source?: string; module?: string; name?: string };\n data?: unknown;\n }): { entitySource: string | null; recordId: string | null; instanceId: string | null } {\n const ctx = input;\n const data = ctx?.data;\n const entitySource =\n ctx?.entityInfo?.source?.trim() ||\n ctx?.entity?.trim() ||\n (ctx?.entityInfo?.module && ctx?.entityInfo?.name\n ? `${ctx.entityInfo.module}.${ctx.entityInfo.name}`\n : null);\n\n const recordId =\n data && typeof data === 'object' && isString(get(data, 'id'))\n ? String(get(data, 'id')).trim()\n : null;\n\n return {\n entitySource,\n recordId,\n instanceId: this.resolveInstanceId(data),\n };\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { inject, Injectable } from '@angular/core';\nimport { AXPWorkflowRunActionService } from '../workflow-run-action.service';\n\n//#endregion\n\n//#region ---- Command ----\n\n/** Cancels a workflow run and marks the linked domain row as cancelled when applicable. */\n@Injectable({ providedIn: 'root' })\nexport class CancelWorkflowRunCommand implements AXPCommand<Record<string, unknown>, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly runActionService = inject(AXPWorkflowRunActionService);\n private readonly dialogService = inject(AXDialogService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: Record<string, unknown>): AXPCommandExecuteResultPromise<void> {\n const { instanceId, entitySource, recordId } = this.runActionService.parseCommandRecordContext(input);\n if (!instanceId) {\n return { success: false, message: { text: 'No workflow instance is linked to this record.' } };\n }\n\n const title = await this.translationService.translateAsync(\n '@workflow-management:workflow-run.dialogs.cancel-run.title',\n );\n const message = await this.translationService.translateAsync(\n '@workflow-management:workflow-run.dialogs.cancel-run.message',\n );\n const confirmed = await this.dialogService.confirm(title, message, 'warning', 'horizontal', false, 'cancel');\n if (!confirmed.result) {\n return { success: false };\n }\n\n const reason = await this.translationService.translateAsync(\n '@workflow-management:workflow-run.messages.cancel-run-note',\n );\n\n const result = await this.runActionService.cancelRun({\n instanceId,\n entitySource: entitySource ?? undefined,\n recordId: recordId ?? undefined,\n reason,\n });\n\n if (!result.success) {\n return { success: false, message: { text: 'Could not cancel the workflow run.' } };\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translationService.translateAsync(\n '@workflow-management:workflow-run.messages.cancel-run-success',\n ),\n closeButton: true,\n timeOut: 3000,\n });\n\n return { success: true, kind: 'object', data: undefined };\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { inject, Injectable } from '@angular/core';\nimport { AXPWorkflowRunActionService } from '../workflow-run-action.service';\n\n//#endregion\n\n//#region ---- Command ----\n\n/** Continues the current suspended human-task step for a workflow-backed domain row. */\n@Injectable({ providedIn: 'root' })\nexport class ContinueWorkflowRunCommand implements AXPCommand<Record<string, unknown>, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly runActionService = inject(AXPWorkflowRunActionService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: Record<string, unknown>): AXPCommandExecuteResultPromise<void> {\n const { instanceId } = this.runActionService.parseCommandRecordContext(input);\n if (!instanceId) {\n return { success: false, message: { text: 'No workflow instance is linked to this record.' } };\n }\n\n const result = await this.runActionService.continueRun(instanceId);\n if (result.success) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n if (result.error === 'NO_SUSPENDED_TASK') {\n const content = await this.translationService.translateAsync(\n '@workflow-management:workflow-run.messages.no-pending-step',\n );\n this.toastService.show({\n color: 'warning',\n title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),\n content,\n closeButton: true,\n });\n return { success: false };\n }\n\n if (result.message) {\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: result.message,\n closeButton: true,\n });\n }\n\n return { success: false };\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nimport { inject, Injectable } from '@angular/core';\nimport { AXPWorkflowRunActionService } from '../workflow-run-action.service';\n\n//#endregion\n\n//#region ---- Command ----\n\n/** Opens the workflow run history popup (timeline + disabled visual tab) for a domain list row. */\n@Injectable({ providedIn: 'root' })\nexport class ShowWorkflowRunHistoryCommand implements AXPCommand<Record<string, unknown>, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly popupService = inject(AXPopupService);\n private readonly runActionService = inject(AXPWorkflowRunActionService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: Record<string, unknown>): AXPCommandExecuteResultPromise<void> {\n const { instanceId } = this.runActionService.parseCommandRecordContext(input);\n if (!instanceId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@workflow-management:workflow-run.history.messages.no-instance',\n ),\n },\n };\n }\n\n const comp = (\n await import('../components/workflow-run-history-popup/workflow-run-history-popup.component')\n ).AXMWorkflowRunHistoryPopupComponent;\n\n this.popupService.open(comp, {\n title: '',\n size: 'lg',\n data: { instanceId },\n });\n\n return {\n success: true,\n kind: 'object',\n data: undefined,\n metadata: { refresh: false },\n };\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { inject, Injectable } from '@angular/core';\nimport { AXPWorkflowRunActionService } from '../workflow-run-action.service';\n\n//#endregion\n\n//#region ---- Command ----\n\n/** Reassigns the current suspended human-task to the current user (take over). */\n@Injectable({ providedIn: 'root' })\nexport class TakeOverWorkflowRunCommand implements AXPCommand<Record<string, unknown>, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly runActionService = inject(AXPWorkflowRunActionService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command Implementation ----\n\n async execute(input: Record<string, unknown>): AXPCommandExecuteResultPromise<void> {\n const { instanceId } = this.runActionService.parseCommandRecordContext(input);\n if (!instanceId) {\n return { success: false, message: { text: 'No workflow instance is linked to this record.' } };\n }\n\n const result = await this.runActionService.takeOverRun(instanceId);\n if (result.success) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n if (result.error === 'NO_SUSPENDED_TASK') {\n const content = await this.translationService.translateAsync(\n '@workflow-management:workflow-run.messages.no-pending-step',\n );\n this.toastService.show({\n color: 'warning',\n title: await this.translationService.translateAsync('@general:messages.generic.warning.title'),\n content,\n closeButton: true,\n });\n return { success: false };\n }\n\n return { success: false };\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Exports ----\n\nexport { CancelWorkflowRunCommand } from './cancel-workflow-run.command';\nexport { ContinueWorkflowRunCommand } from './continue-workflow-run.command';\nexport { ShowWorkflowRunHistoryCommand } from './show-workflow-run-history.command';\nexport { TakeOverWorkflowRunCommand } from './take-over-workflow-run.command';\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AA6CA;AAEA;AAEA;;;AAGG;MAEU,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,mCAAmC,CAAC;AAC9D,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC5C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,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