@rytass/bpm-core-nestjs-module 0.13.5 → 0.15.0
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/CHANGELOG.md +118 -0
- package/README.md +10 -0
- package/package.json +2 -2
- package/src/lib/attachment/attachment.service.js +6 -1
- package/src/lib/attachment/attachment.service.js.map +1 -1
- package/src/lib/bpm/bpm-root-options.d.ts +2 -1
- package/src/lib/bpm/bpm-root-options.js +7 -1
- package/src/lib/bpm/bpm-root-options.js.map +1 -1
- package/src/lib/form/form-member-value.validator.d.ts +16 -0
- package/src/lib/form/form-member-value.validator.js +37 -0
- package/src/lib/form/form-member-value.validator.js.map +1 -0
- package/src/lib/form/form-schema.validator.js +90 -1
- package/src/lib/form/form-schema.validator.js.map +1 -1
- package/src/lib/migrations/0000000025000-task-candidate-sequence.d.ts +21 -0
- package/src/lib/migrations/0000000025000-task-candidate-sequence.js +50 -0
- package/src/lib/migrations/0000000025000-task-candidate-sequence.js.map +1 -0
- package/src/lib/migrations/0000000026000-approval-instance-business-key.d.ts +20 -0
- package/src/lib/migrations/0000000026000-approval-instance-business-key.js +44 -0
- package/src/lib/migrations/0000000026000-approval-instance-business-key.js.map +1 -0
- package/src/lib/migrations/0000000027000-approval-instance-submitted-by.d.ts +19 -0
- package/src/lib/migrations/0000000027000-approval-instance-submitted-by.js +42 -0
- package/src/lib/migrations/0000000027000-approval-instance-submitted-by.js.map +1 -0
- package/src/lib/migrations/index.d.ts +3 -0
- package/src/lib/migrations/index.js +9 -0
- package/src/lib/migrations/index.js.map +1 -1
- package/src/lib/notification/notification-template.js +1 -1
- package/src/lib/notification/notification-template.js.map +1 -1
- package/src/lib/notification/notification.service.d.ts +16 -0
- package/src/lib/notification/notification.service.js +56 -2
- package/src/lib/notification/notification.service.js.map +1 -1
- package/src/lib/organization/index.d.ts +1 -0
- package/src/lib/organization/index.js +1 -0
- package/src/lib/organization/index.js.map +1 -1
- package/src/lib/organization/organization-time-zone.d.ts +46 -0
- package/src/lib/organization/organization-time-zone.js +47 -0
- package/src/lib/organization/organization-time-zone.js.map +1 -0
- package/src/lib/organization/organization.service.d.ts +3 -1
- package/src/lib/organization/organization.service.js +8 -11
- package/src/lib/organization/organization.service.js.map +1 -1
- package/src/lib/template/template.service.js +64 -0
- package/src/lib/template/template.service.js.map +1 -1
- package/src/lib/template/workflow-definition.validator.js +26 -1
- package/src/lib/template/workflow-definition.validator.js.map +1 -1
- package/src/lib/workflow-engine/approval-instance.entity.d.ts +13 -0
- package/src/lib/workflow-engine/approval-instance.entity.js +20 -0
- package/src/lib/workflow-engine/approval-instance.entity.js.map +1 -1
- package/src/lib/workflow-engine/instance-submitter.d.ts +2 -0
- package/src/lib/workflow-engine/instance-submitter.js +14 -0
- package/src/lib/workflow-engine/instance-submitter.js.map +1 -0
- package/src/lib/workflow-engine/task-candidate.entity.d.ts +2 -0
- package/src/lib/workflow-engine/task-candidate.entity.js +5 -0
- package/src/lib/workflow-engine/task-candidate.entity.js.map +1 -1
- package/src/lib/workflow-engine/task.entity.d.ts +20 -0
- package/src/lib/workflow-engine/task.entity.js +28 -0
- package/src/lib/workflow-engine/task.entity.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.enums.d.ts +5 -1
- package/src/lib/workflow-engine/workflow-engine.enums.js +4 -0
- package/src/lib/workflow-engine/workflow-engine.enums.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.mutations.js +5 -0
- package/src/lib/workflow-engine/workflow-engine.mutations.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.service.d.ts +130 -4
- package/src/lib/workflow-engine/workflow-engine.service.js +1284 -179
- package/src/lib/workflow-engine/workflow-engine.service.js.map +1 -1
|
@@ -25,8 +25,13 @@ let WorkflowEngineMutations = class WorkflowEngineMutations {
|
|
|
25
25
|
async submitApprovalInstance(input, currentMemberId, authContext) {
|
|
26
26
|
return this.workflowEngineService.submitApprovalInstance({
|
|
27
27
|
...input,
|
|
28
|
+
// A business key is the host's to set; an end user never claims one.
|
|
29
|
+
businessKey: null,
|
|
28
30
|
initiatorMemberId: currentMemberId,
|
|
29
31
|
initiatorMetadataSnapshotJson: null,
|
|
32
|
+
// Never read from the input: the person pressing submit is whoever is
|
|
33
|
+
// signed in, so a client cannot claim someone else filed the document.
|
|
34
|
+
submittedByMemberId: currentMemberId,
|
|
30
35
|
}, authContext);
|
|
31
36
|
}
|
|
32
37
|
async processApprovalInstance(instanceId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-engine.mutations.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/workflow-engine/workflow-engine.mutations.ts"],"names":[],"mappings":";;;;AAAA,6CAA+D;AAC/D,0CAMqB;AACrB,qEAAgE;AAChE,+CAGuB;AACvB,yEAAoE;AACpE,6EAAwE;AACxE,iEAA4D;AAC5D,yFAAmF;AACnF,+DAA0D;AAC1D,2FAAoF;AACpF,6FAAuF;AACvF,yFAAmF;AACnF,iEAA4D;AAC5D,+CAA2C;AAC3C,uEAAuE;AACvE,uEAAkE;AAI3D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IAGvE,AAAN,KAAK,CAAC,sBAAsB,CACX,KAAkC,EAC3B,eAAuB,EACpB,WAA2B;QAEpD,OAAO,IAAI,CAAC,qBAAqB,CAAC,sBAAsB,CACtD;YACE,GAAG,KAAK;YACR,iBAAiB,EAAE,eAAe;YAClC,6BAA6B,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"workflow-engine.mutations.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/workflow-engine/workflow-engine.mutations.ts"],"names":[],"mappings":";;;;AAAA,6CAA+D;AAC/D,0CAMqB;AACrB,qEAAgE;AAChE,+CAGuB;AACvB,yEAAoE;AACpE,6EAAwE;AACxE,iEAA4D;AAC5D,yFAAmF;AACnF,+DAA0D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readonly initiatorMemberId: string;
|
|
41
|
+
/**
|
|
42
|
+
* The host document this instance stands for, unique within the template.
|
|
43
|
+
* Service-level only: it is not on the GraphQL input, and the mutation
|
|
44
|
+
* always passes `null`, so an end user can never claim a key.
|
|
45
|
+
*/
|
|
46
|
+
readonly businessKey?: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Service layer only: the GraphQL mutation always fills it with the
|
|
49
|
+
* authenticated member and the input type does not expose it. Absent means
|
|
50
|
+
* the initiator submitted the document themselves.
|
|
51
|
+
*/
|
|
52
|
+
readonly submittedByMemberId?: string | null;
|
|
41
53
|
};
|
|
42
54
|
type ResubmitApprovalInstanceCommand = ResubmitApprovalInstanceInput & {
|
|
43
55
|
readonly initiatorMemberId: string;
|
|
44
56
|
};
|
|
57
|
+
export declare const MAX_APPROVAL_INSTANCE_BUSINESS_KEY_LENGTH = 200;
|
|
45
58
|
/**
|
|
46
59
|
* Delegation-chain reason recorded for an approver-initiated transfer, as
|
|
47
60
|
* opposed to {@link SLA_ESCALATION_DELEGATION_REASON}.
|
|
@@ -93,7 +106,22 @@ export declare class WorkflowEngineService {
|
|
|
93
106
|
private readonly webhookDeliveryService?;
|
|
94
107
|
constructor(approvalInstanceRepository: Repository<ApprovalInstanceEntity>, workflowTokenRepository: Repository<WorkflowTokenEntity>, taskRepository: Repository<TaskEntity>, taskCandidateRepository: Repository<TaskCandidateEntity>, taskDecisionRepository: Repository<TaskDecisionEntity>, notificationRepository: Repository<NotificationEntity>, activityLogRepository: Repository<ActivityLogEntity>, adhocDirectiveRepository: Repository<AdhocDirectiveEntity>, approvalTemplateRepository: Repository<ApprovalTemplateEntity>, approvalTemplateVersionRepository: Repository<ApprovalTemplateVersionEntity>, formDefinitionVersionRepository: Repository<FormDefinitionVersionEntity>, attachmentService: AttachmentService, conditionService: ConditionService, delegationService: DelegationService, notificationService: NotificationService, signatureService: SignatureService, slaScheduleService: BPMSlaScheduleService, injectedServiceTaskDispatcher?: BPMWorkflowServiceTaskDispatcher, formDataSourceValueResolver?: BPMFormDataSourceValueResolver | undefined, rootOptions?: BPMRootRuntimeOptions, webhookDeliveryService?: WorkflowWebhookDeliveryService | undefined);
|
|
95
108
|
private readonly serviceTaskDispatcher;
|
|
109
|
+
private readonly organizationTimeZone;
|
|
110
|
+
/**
|
|
111
|
+
* Today's date as the organization sees it (`organizationTimeZone`), for
|
|
112
|
+
* comparing against the date-only `effectiveFrom` / `effectiveTo` of
|
|
113
|
+
* memberships and manager resolutions. Not for timestamp columns, which are
|
|
114
|
+
* compared as instants.
|
|
115
|
+
*/
|
|
116
|
+
private readOrganizationToday;
|
|
96
117
|
submitApprovalInstance(input: SubmitApprovalInstanceCommand, authContext?: BPMAuthContext): Promise<ApprovalInstanceEntity>;
|
|
118
|
+
/**
|
|
119
|
+
* The instance a host submitted for `businessKey` on `templateId`, whatever
|
|
120
|
+
* its state (a cancelled or rejected instance still holds its key), or
|
|
121
|
+
* `null`. The key is trimmed the way submit trims it, so a lookup finds what
|
|
122
|
+
* a submit stored.
|
|
123
|
+
*/
|
|
124
|
+
findApprovalInstanceByBusinessKey(templateId: string, businessKey: string): Promise<ApprovalInstanceEntity | null>;
|
|
97
125
|
private resolveFormDataOptionSnapshots;
|
|
98
126
|
private prepareResubmitFormDataOptions;
|
|
99
127
|
processInstance(instanceId: string): Promise<void>;
|
|
@@ -129,9 +157,26 @@ export declare class WorkflowEngineService {
|
|
|
129
157
|
private loadAdhocOperationContext;
|
|
130
158
|
private recordAdhocDirectiveActivity;
|
|
131
159
|
private createAdhocTaskForDirective;
|
|
160
|
+
private resolveAdhocTaskCandidates;
|
|
132
161
|
private spawnCountersignTasksForNode;
|
|
133
162
|
private hasOpenTasksForTokenNode;
|
|
134
163
|
private handleAdhocPreApprovalRejection;
|
|
164
|
+
/**
|
|
165
|
+
* Follows a TRANSFERRED task to the task that replaced it, repeatedly, and
|
|
166
|
+
* returns the last one reached. A transfer leaves no pointer on either task
|
|
167
|
+
* row; the link is the `transferredFromTaskId` in the payload of the
|
|
168
|
+
* TASK_CREATED activity written for the replacement. When the trail stops
|
|
169
|
+
* (no such activity, or its task is gone) the last task reached is returned,
|
|
170
|
+
* so a caller sees the transferred row exactly as it did before.
|
|
171
|
+
*/
|
|
172
|
+
private readTransferSuccessorTask;
|
|
173
|
+
/**
|
|
174
|
+
* The requester's candidate row on a SEQUENTIAL origin task. A task that was
|
|
175
|
+
* transferred mid-order continues as a replacement that carries only the
|
|
176
|
+
* candidates still to sign, so a requester who already signed is found on an
|
|
177
|
+
* earlier task of the transfer chain instead.
|
|
178
|
+
*/
|
|
179
|
+
private readSequentialRequesterCandidate;
|
|
135
180
|
private readOpenTaskRecipientMemberIds;
|
|
136
181
|
private dispatchAdhocStageNotifications;
|
|
137
182
|
private dispatchAdhocCompletionNotifications;
|
|
@@ -140,9 +185,26 @@ export declare class WorkflowEngineService {
|
|
|
140
185
|
dryRunApprovalWorkflow(input: DryRunApprovalWorkflowInput): WorkflowDryRunResultObject;
|
|
141
186
|
private simulateWorkflow;
|
|
142
187
|
private simulateWorkflowPath;
|
|
143
|
-
|
|
188
|
+
/**
|
|
189
|
+
* The edges a dry-run step continues along. A node a designer has left
|
|
190
|
+
* unfinished (nothing drawn out of it, or no branch of a gateway taken) ends
|
|
191
|
+
* its branch with a readable message instead of failing the whole dry run.
|
|
192
|
+
*/
|
|
193
|
+
private readDryRunOutgoing;
|
|
144
194
|
private evaluateDryRunEdge;
|
|
145
|
-
|
|
195
|
+
/**
|
|
196
|
+
* The dry-run assignee of a user task. Only resolvers whose dry run yields
|
|
197
|
+
* real member ids (DIRECT, DYNAMIC_FORM, EXPRESSION and ORG_MANAGER, which
|
|
198
|
+
* reads the initiator snapshot) can be checked against the initiator; the
|
|
199
|
+
* others resolve to placeholders and are left as they are.
|
|
200
|
+
*/
|
|
201
|
+
private resolveDryRunAssignment;
|
|
202
|
+
/**
|
|
203
|
+
* The member ids a dry run resolves for a user task: an empty list when the
|
|
204
|
+
* resolver names nobody, `null` for resolvers that only resolve to a
|
|
205
|
+
* placeholder in a dry run.
|
|
206
|
+
*/
|
|
207
|
+
private readDryRunMemberIds;
|
|
146
208
|
getApprovalInstance(id: string, scope?: WorkflowReadScope): Promise<ApprovalInstanceEntity>;
|
|
147
209
|
listApprovalInstances(scope?: WorkflowReadScope, options?: ListApprovalInstancesOptions): Promise<readonly ApprovalInstanceEntity[]>;
|
|
148
210
|
countApprovalInstances(scope?: WorkflowReadScope, options?: Omit<ListApprovalInstancesOptions, 'page' | 'pageSize'>): Promise<number>;
|
|
@@ -172,6 +234,17 @@ export declare class WorkflowEngineService {
|
|
|
172
234
|
listTaskDecisions(taskId: string, scope?: WorkflowReadScope): Promise<readonly TaskDecisionEntity[]>;
|
|
173
235
|
listTaskCandidates(taskId: string, scope?: WorkflowReadScope): Promise<readonly TaskCandidateEntity[]>;
|
|
174
236
|
private attachTaskCandidateSummaries;
|
|
237
|
+
/**
|
|
238
|
+
* The display names of the nodes a page of tasks sits on, keyed by
|
|
239
|
+
* {@link readNodeLabelKey}. One query for the whole page, and Postgres picks
|
|
240
|
+
* the labels out of the snapshots: a workflow snapshot is a whole workflow
|
|
241
|
+
* definition, and every inbox, history and instance task list runs this, so
|
|
242
|
+
* shipping the snapshots to the app just to read one string each would cost
|
|
243
|
+
* page size × snapshot size on every refresh. A missing instance or node, a
|
|
244
|
+
* snapshot without a `nodes` array, and a blank or non-string label all
|
|
245
|
+
* leave the task without a label, as `readWorkflowNodeLabel` does.
|
|
246
|
+
*/
|
|
247
|
+
private readTaskNodeLabels;
|
|
175
248
|
private readDefaultInitiatorMetadataSnapshot;
|
|
176
249
|
listActivityLogs(instanceId: string, scope?: WorkflowReadScope): Promise<readonly ActivityLogEntity[]>;
|
|
177
250
|
private assertTaskReadable;
|
|
@@ -183,6 +256,9 @@ export declare class WorkflowEngineService {
|
|
|
183
256
|
private advanceTokenToOutgoingNodes;
|
|
184
257
|
private isNodeEntryConditionMet;
|
|
185
258
|
private skipNodeByEntryCondition;
|
|
259
|
+
private skipNodeByInitiatorExclusion;
|
|
260
|
+
private skipNode;
|
|
261
|
+
private consumeToken;
|
|
186
262
|
private readAvailableOutgoingEdges;
|
|
187
263
|
private evaluateWorkflowEdge;
|
|
188
264
|
private readLastDecisionContext;
|
|
@@ -190,13 +266,61 @@ export declare class WorkflowEngineService {
|
|
|
190
266
|
private forkTokenAlongEdges;
|
|
191
267
|
private completeTokenAtEndNode;
|
|
192
268
|
private createUserTaskForToken;
|
|
269
|
+
/**
|
|
270
|
+
* Hands a SEQUENTIAL task to the lowest-`sequence` candidate still WAITING.
|
|
271
|
+
* A task without a WAITING candidate (every other policy, and SEQUENTIAL
|
|
272
|
+
* tasks created before candidates were ordered) is left alone.
|
|
273
|
+
*/
|
|
274
|
+
private activateNextSequentialCandidate;
|
|
275
|
+
/**
|
|
276
|
+
* Re-resolves the delegation of a candidate whose turn has come. When the
|
|
277
|
+
* delegate already holds another candidate row on the task, the stored values
|
|
278
|
+
* are kept: (task_id, member_id) is unique, and that member signs from the
|
|
279
|
+
* row they already have. On a node that excludes the initiator the stored
|
|
280
|
+
* values are kept as well when the new delegation path would run through the
|
|
281
|
+
* initiator or the submitter: creation already filtered such paths out, and a
|
|
282
|
+
* delegation added while the candidate waited must not bring them back.
|
|
283
|
+
*/
|
|
284
|
+
private resolveActivationDelegation;
|
|
193
285
|
private markTaskCandidateDecision;
|
|
194
286
|
private transferTask;
|
|
287
|
+
/**
|
|
288
|
+
* Resolves who gets the node's task. `null` means the node asked to be
|
|
289
|
+
* skipped (`excludeInitiator.whenEmpty = SKIP_NODE`) because the initiator
|
|
290
|
+
* was the only approver — the sole caller creates no task and advances the
|
|
291
|
+
* token instead.
|
|
292
|
+
*/
|
|
195
293
|
private resolveRuntimeTaskCandidates;
|
|
196
|
-
private
|
|
294
|
+
private resolveInitiatorManagerReplacements;
|
|
295
|
+
private buildDelegationContext;
|
|
296
|
+
private delegateResolvedCandidates;
|
|
297
|
+
/** One member's delegation, grade-gated as {@link applyGradeGate} says. */
|
|
298
|
+
private resolveDelegation;
|
|
299
|
+
/**
|
|
300
|
+
* Manual transfer on a manager-chain node: the target must hold at least the
|
|
301
|
+
* grade of the member being replaced, i.e. the original principal of the
|
|
302
|
+
* deciding candidate (the first hop of its delegation chain when it was
|
|
303
|
+
* delegated, otherwise the actor). No grade on the principal means no
|
|
304
|
+
* constraint.
|
|
305
|
+
*/
|
|
306
|
+
private assertTransferTargetGrade;
|
|
197
307
|
private resolveApproverResolver;
|
|
198
308
|
private resolvePositionCandidates;
|
|
199
309
|
private resolveInitiatorManagerCandidates;
|
|
310
|
+
/**
|
|
311
|
+
* Walks up the initiator's manager chain, nearest manager first, until a
|
|
312
|
+
* manager whose position level reaches `minPositionLevel` is added. The
|
|
313
|
+
* list is returned nearest manager first. Members in `skippedMemberIds` are
|
|
314
|
+
* walked past without joining the chain or counting as the stopping point.
|
|
315
|
+
*/
|
|
316
|
+
private resolveOrgManagerChainCandidates;
|
|
317
|
+
/** Highest position level over the member's active memberships, or `null`. */
|
|
318
|
+
private readMemberPositionLevel;
|
|
319
|
+
/**
|
|
320
|
+
* {@link readMemberPositionLevel} for several members in two queries: every
|
|
321
|
+
* requested member is in the map, `null` when they hold no graded position.
|
|
322
|
+
*/
|
|
323
|
+
private readMemberPositionLevels;
|
|
200
324
|
private resolveFallbackAssignee;
|
|
201
325
|
private resolveManagerMemberIdsFromOrganization;
|
|
202
326
|
private resolveManagerMemberIdsAtLevel;
|
|
@@ -206,7 +330,9 @@ export declare class WorkflowEngineService {
|
|
|
206
330
|
private resolveManagerResolutionCandidates;
|
|
207
331
|
private resolveOrgUnitMemberCandidates;
|
|
208
332
|
private resolveOrgUnitPositionCandidates;
|
|
209
|
-
private
|
|
333
|
+
private readPositionName;
|
|
334
|
+
/** The org unit's name and the ids it covers, or `null` once it is gone. */
|
|
335
|
+
private readOrgUnitScope;
|
|
210
336
|
private processExclusiveGateway;
|
|
211
337
|
private executeServiceTask;
|
|
212
338
|
private rejectInstance;
|