@rytass/bpm-core-nestjs-module 0.22.0 → 0.23.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 +64 -0
- package/package.json +2 -2
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/bpm/bpm-root-options.d.ts +57 -0
- package/src/lib/bpm/bpm-root-options.js.map +1 -1
- package/src/lib/bpm/bpm-root.module.d.ts +21 -0
- package/src/lib/bpm/bpm-root.module.js +6 -0
- package/src/lib/bpm/bpm-root.module.js.map +1 -1
- package/src/lib/form/dto/form-definition.input.d.ts +5 -0
- package/src/lib/form/dto/form-definition.input.js.map +1 -1
- package/src/lib/form/form-definition.entity.d.ts +5 -0
- package/src/lib/form/form-definition.entity.js +7 -0
- package/src/lib/form/form-definition.entity.js.map +1 -1
- package/src/lib/form/form-schema.validator.js +17 -5
- package/src/lib/form/form-schema.validator.js.map +1 -1
- package/src/lib/form/form.queries.d.ts +2 -2
- package/src/lib/form/form.queries.js +17 -5
- package/src/lib/form/form.queries.js.map +1 -1
- package/src/lib/form/form.service.d.ts +2 -1
- package/src/lib/form/form.service.js +10 -5
- package/src/lib/form/form.service.js.map +1 -1
- package/src/lib/form-data-source/form-data-source-value-resolver.service.js +22 -2
- package/src/lib/form-data-source/form-data-source-value-resolver.service.js.map +1 -1
- package/src/lib/form-data-source/form-data-source.errors.d.ts +11 -0
- package/src/lib/form-data-source/form-data-source.errors.js +14 -1
- package/src/lib/form-data-source/form-data-source.errors.js.map +1 -1
- package/src/lib/form-data-source/form-data-source.service.d.ts +6 -0
- package/src/lib/form-data-source/form-data-source.service.js +37 -3
- package/src/lib/form-data-source/form-data-source.service.js.map +1 -1
- package/src/lib/instance-event/approval-instance-event.entity.d.ts +27 -0
- package/src/lib/instance-event/approval-instance-event.entity.js +93 -0
- package/src/lib/instance-event/approval-instance-event.entity.js.map +1 -0
- package/src/lib/instance-event/index.d.ts +13 -0
- package/src/lib/instance-event/index.js +17 -0
- package/src/lib/instance-event/index.js.map +1 -0
- package/src/lib/instance-event/instance-event.delivery-scheduler.service.d.ts +21 -0
- package/src/lib/instance-event/instance-event.delivery-scheduler.service.js +81 -0
- package/src/lib/instance-event/instance-event.delivery-scheduler.service.js.map +1 -0
- package/src/lib/instance-event/instance-event.delivery.service.d.ts +69 -0
- package/src/lib/instance-event/instance-event.delivery.service.js +259 -0
- package/src/lib/instance-event/instance-event.delivery.service.js.map +1 -0
- package/src/lib/instance-event/instance-event.delivery.subscriber.d.ts +24 -0
- package/src/lib/instance-event/instance-event.delivery.subscriber.js +85 -0
- package/src/lib/instance-event/instance-event.delivery.subscriber.js.map +1 -0
- package/src/lib/instance-event/instance-event.enums.d.ts +12 -0
- package/src/lib/instance-event/instance-event.enums.js +28 -0
- package/src/lib/instance-event/instance-event.enums.js.map +1 -0
- package/src/lib/instance-event/instance-event.module.d.ts +13 -0
- package/src/lib/instance-event/instance-event.module.js +52 -0
- package/src/lib/instance-event/instance-event.module.js.map +1 -0
- package/src/lib/instance-event/instance-event.object.d.ts +24 -0
- package/src/lib/instance-event/instance-event.object.js +73 -0
- package/src/lib/instance-event/instance-event.object.js.map +1 -0
- package/src/lib/instance-event/instance-event.options.d.ts +26 -0
- package/src/lib/instance-event/instance-event.options.js +35 -0
- package/src/lib/instance-event/instance-event.options.js.map +1 -0
- package/src/lib/instance-event/instance-event.resolver.d.ts +10 -0
- package/src/lib/instance-event/instance-event.resolver.js +75 -0
- package/src/lib/instance-event/instance-event.resolver.js.map +1 -0
- package/src/lib/instance-event/instance-event.service.d.ts +18 -0
- package/src/lib/instance-event/instance-event.service.js +37 -0
- package/src/lib/instance-event/instance-event.service.js.map +1 -0
- package/src/lib/instance-event/instance-event.token.d.ts +19 -0
- package/src/lib/instance-event/instance-event.token.js +9 -0
- package/src/lib/instance-event/instance-event.token.js.map +1 -0
- package/src/lib/instance-event/instance-event.types.d.ts +67 -0
- package/src/lib/instance-event/instance-event.types.js +9 -0
- package/src/lib/instance-event/instance-event.types.js.map +1 -0
- package/src/lib/instance-event/instance-event.writer.d.ts +21 -0
- package/src/lib/instance-event/instance-event.writer.js +45 -0
- package/src/lib/instance-event/instance-event.writer.js.map +1 -0
- package/src/lib/migrations/0000000032000-host-integration-round.d.ts +25 -0
- package/src/lib/migrations/0000000032000-host-integration-round.js +104 -0
- package/src/lib/migrations/0000000032000-host-integration-round.js.map +1 -0
- package/src/lib/migrations/index.d.ts +1 -0
- package/src/lib/migrations/index.js +3 -0
- package/src/lib/migrations/index.js.map +1 -1
- package/src/lib/notification/notification.service.js +50 -9
- package/src/lib/notification/notification.service.js.map +1 -1
- package/src/lib/template/approval-template-version.entity.d.ts +9 -1
- package/src/lib/template/approval-template-version.entity.js +11 -1
- package/src/lib/template/approval-template-version.entity.js.map +1 -1
- package/src/lib/template/approval-template.entity.d.ts +18 -0
- package/src/lib/template/approval-template.entity.js +23 -0
- package/src/lib/template/approval-template.entity.js.map +1 -1
- package/src/lib/template/dto/approval-template.input.d.ts +21 -0
- package/src/lib/template/dto/approval-template.input.js +38 -0
- package/src/lib/template/dto/approval-template.input.js.map +1 -1
- package/src/lib/template/dto/compose-approval-template.input.d.ts +23 -0
- package/src/lib/template/dto/compose-approval-template.input.js +37 -0
- package/src/lib/template/dto/compose-approval-template.input.js.map +1 -1
- package/src/lib/template/template-key.d.ts +26 -0
- package/src/lib/template/template-key.js +67 -0
- package/src/lib/template/template-key.js.map +1 -0
- package/src/lib/template/template.enums.d.ts +11 -0
- package/src/lib/template/template.enums.js +17 -1
- package/src/lib/template/template.enums.js.map +1 -1
- package/src/lib/template/template.queries.d.ts +3 -2
- package/src/lib/template/template.queries.js +29 -4
- package/src/lib/template/template.queries.js.map +1 -1
- package/src/lib/template/template.service.d.ts +8 -1
- package/src/lib/template/template.service.js +94 -17
- package/src/lib/template/template.service.js.map +1 -1
- package/src/lib/workflow-engine/approver-filled-table-columns.d.ts +91 -0
- package/src/lib/workflow-engine/approver-filled-table-columns.js +301 -0
- package/src/lib/workflow-engine/approver-filled-table-columns.js.map +1 -0
- package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.d.ts +7 -0
- package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.js +9 -0
- package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.js.map +1 -1
- package/src/lib/workflow-engine/index.d.ts +1 -0
- package/src/lib/workflow-engine/index.js +1 -0
- package/src/lib/workflow-engine/index.js.map +1 -1
- package/src/lib/workflow-engine/instance-guard.runner.d.ts +19 -0
- package/src/lib/workflow-engine/instance-guard.runner.js +102 -0
- package/src/lib/workflow-engine/instance-guard.runner.js.map +1 -0
- package/src/lib/workflow-engine/instance-guard.token.d.ts +101 -0
- package/src/lib/workflow-engine/instance-guard.token.js +9 -0
- package/src/lib/workflow-engine/instance-guard.token.js.map +1 -0
- package/src/lib/workflow-engine/missing-form-fields.d.ts +12 -0
- package/src/lib/workflow-engine/missing-form-fields.js +27 -0
- package/src/lib/workflow-engine/missing-form-fields.js.map +1 -0
- package/src/lib/workflow-engine/workflow-engine.module.d.ts +2 -0
- package/src/lib/workflow-engine/workflow-engine.module.js +3 -0
- package/src/lib/workflow-engine/workflow-engine.module.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.mutations.d.ts +1 -1
- package/src/lib/workflow-engine/workflow-engine.mutations.js +8 -3
- package/src/lib/workflow-engine/workflow-engine.mutations.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.queries.d.ts +7 -7
- package/src/lib/workflow-engine/workflow-engine.queries.js +97 -28
- package/src/lib/workflow-engine/workflow-engine.queries.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.service.d.ts +141 -7
- package/src/lib/workflow-engine/workflow-engine.service.js +653 -75
- package/src/lib/workflow-engine/workflow-engine.service.js.map +1 -1
- package/src/lib/workflow-engine/workflow-engine.tokens.d.ts +5 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MemberMetadata, type ApprovalInstanceFieldFilter, type ApprovalInstanceSort } from '@rytass/bpm-core-shared';
|
|
1
|
+
import { MemberMetadata, type FieldAccessFillUnit, type ApprovalInstanceFieldFilter, type ApprovalInstanceSort } from '@rytass/bpm-core-shared';
|
|
2
2
|
import { WorkflowWebhookDeliveryService } from '../workflow-webhook/workflow-webhook-delivery.service';
|
|
3
3
|
import { Repository } from 'typeorm';
|
|
4
4
|
import { AttachmentService } from '../attachment/attachment.service';
|
|
@@ -30,6 +30,8 @@ import { TaskEntity } from './task.entity';
|
|
|
30
30
|
import { ApprovalInstanceListViewEnum, ApprovalInstanceStateEnum, MemberTaskRoleEnum, TaskCandidateStatusEnum, TaskReassignmentErrorCodeEnum, TaskReassignmentOutcomeEnum } from './workflow-engine.enums';
|
|
31
31
|
import { WorkflowDryRunResultObject } from './workflow-dry-run.object';
|
|
32
32
|
import { BPMInitiatorCustomFieldsResolver } from './initiator-custom-fields-resolver.token';
|
|
33
|
+
import { InstanceEventWriter } from '../instance-event/instance-event.writer';
|
|
34
|
+
import { BPMInstanceGuard } from './instance-guard.token';
|
|
33
35
|
import { BPMWorkflowServiceTaskDispatcher } from './workflow-service-task-dispatcher.token';
|
|
34
36
|
import { WorkflowTokenEntity } from './workflow-token.entity';
|
|
35
37
|
import { BPMRootRuntimeOptions } from '../bpm/bpm-root-options';
|
|
@@ -59,6 +61,15 @@ type SubmitApprovalInstanceCommand = SubmitApprovalInstanceInput & {
|
|
|
59
61
|
* unset and may prefill them.
|
|
60
62
|
*/
|
|
61
63
|
readonly endUserSubmission?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Service layer only (ADR 27 §5): fields a host adds to the initiator's
|
|
66
|
+
* `customFields`. The engine still builds the default snapshot and calls the
|
|
67
|
+
* `customFields` resolver; these values are merged over what it returned, so
|
|
68
|
+
* a key given here wins. Cannot be combined with
|
|
69
|
+
* `initiatorMetadataSnapshotJson` (400). The GraphQL mutation always passes
|
|
70
|
+
* `null`.
|
|
71
|
+
*/
|
|
72
|
+
readonly initiatorCustomFields?: Readonly<Record<string, unknown>> | null;
|
|
62
73
|
};
|
|
63
74
|
type ResubmitApprovalInstanceCommand = ResubmitApprovalInstanceInput & {
|
|
64
75
|
readonly initiatorMemberId: string;
|
|
@@ -114,8 +125,22 @@ export interface TaskListPageOptions {
|
|
|
114
125
|
/** Defaults to 20, at most 100, once paging is asked for. */
|
|
115
126
|
readonly pageSize?: number;
|
|
116
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Narrows a member's task list to the tasks of some templates. Absent fields
|
|
130
|
+
* do not filter. An empty `templateIds` matches nothing, as `IN ()` would.
|
|
131
|
+
* When both fields are given a task must satisfy both.
|
|
132
|
+
*/
|
|
133
|
+
export interface TaskTemplateFilter {
|
|
134
|
+
/** Only tasks whose instance was started from one of these templates. */
|
|
135
|
+
readonly templateIds?: readonly string[];
|
|
136
|
+
/** Only tasks whose instance's template carries this key (ADR 27 §6). */
|
|
137
|
+
readonly templateKey?: string;
|
|
138
|
+
}
|
|
139
|
+
/** Options of {@link WorkflowEngineService.listInboxTasks}. */
|
|
140
|
+
export interface InboxTaskListOptions extends TaskListPageOptions, TaskTemplateFilter {
|
|
141
|
+
}
|
|
117
142
|
/** Options of {@link WorkflowEngineService.listApprovalHistoryTasks}. */
|
|
118
|
-
export interface ApprovalHistoryTaskListOptions extends TaskListPageOptions {
|
|
143
|
+
export interface ApprovalHistoryTaskListOptions extends TaskListPageOptions, TaskTemplateFilter {
|
|
119
144
|
/** Only tasks of instances in this state. */
|
|
120
145
|
readonly instanceState?: ApprovalInstanceStateEnum;
|
|
121
146
|
}
|
|
@@ -152,6 +177,13 @@ export interface DecideTaskOptions {
|
|
|
152
177
|
* transfer. Defaults to {@link MANUAL_TRANSFER_DELEGATION_REASON}.
|
|
153
178
|
*/
|
|
154
179
|
readonly transferReason?: string;
|
|
180
|
+
/**
|
|
181
|
+
* The approver's own auth context, passed by the GraphQL mutation. Data
|
|
182
|
+
* source providers receive it when an approver-filled dynamic field is
|
|
183
|
+
* resolved. Absent for engine-made decisions (SLA auto-approve), which then
|
|
184
|
+
* act as the decider's member id only.
|
|
185
|
+
*/
|
|
186
|
+
readonly approverAuthContext?: BPMAuthContext;
|
|
155
187
|
}
|
|
156
188
|
export interface ListApprovalInstancesOptions {
|
|
157
189
|
/** ADR 25 §7: conditions on form fields. Needs `templateId` when not empty. */
|
|
@@ -163,6 +195,11 @@ export interface ListApprovalInstancesOptions {
|
|
|
163
195
|
readonly sort?: readonly ApprovalInstanceSort[];
|
|
164
196
|
readonly state?: readonly ApprovalInstanceStateEnum[];
|
|
165
197
|
readonly templateId?: string;
|
|
198
|
+
/**
|
|
199
|
+
* ADR 27 §6: the template's `key`. Resolved to its id; with `templateId`
|
|
200
|
+
* as well, both must name the same template. An unknown key matches nothing.
|
|
201
|
+
*/
|
|
202
|
+
readonly templateKey?: string;
|
|
166
203
|
readonly view?: ApprovalInstanceListViewEnum;
|
|
167
204
|
}
|
|
168
205
|
interface WorkflowDashboardSummaryOptions {
|
|
@@ -190,14 +227,38 @@ export declare class WorkflowEngineService {
|
|
|
190
227
|
private readonly slaScheduleService;
|
|
191
228
|
private readonly formDataSourceValueResolver?;
|
|
192
229
|
private readonly webhookDeliveryService?;
|
|
230
|
+
private readonly instanceEventWriter?;
|
|
193
231
|
private readonly logger;
|
|
194
232
|
/** In-flight inbox reads by member; see `readSharedOpenInboxTasks`. */
|
|
195
233
|
private readonly openInboxReadsInFlight;
|
|
196
234
|
private readonly approvalInstanceFieldFilterCompiler;
|
|
197
235
|
private readonly approvalInstanceFilterableFieldPolicy;
|
|
198
|
-
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, injectedInitiatorCustomFieldsResolver?: BPMInitiatorCustomFieldsResolver);
|
|
236
|
+
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, injectedInitiatorCustomFieldsResolver?: BPMInitiatorCustomFieldsResolver, injectedInstanceGuard?: BPMInstanceGuard, instanceEventWriter?: InstanceEventWriter | undefined);
|
|
237
|
+
/** ADR 27 §3; see `BPMRootRuntimeOptions.expressionMissingFormFieldsAsNull`. */
|
|
238
|
+
private readonly expressionMissingFormFieldsAsNull;
|
|
199
239
|
private readonly serviceTaskDispatcher;
|
|
200
240
|
private readonly initiatorCustomFieldsResolver;
|
|
241
|
+
/** ADR 27 §2; `null` means no guard is bound and no guard code runs. */
|
|
242
|
+
private readonly instanceGuard;
|
|
243
|
+
private readonly instanceGuardTimeoutMs;
|
|
244
|
+
/**
|
|
245
|
+
* Runs the bound guard for one engine path inside its transaction. A no-op
|
|
246
|
+
* when no guard is bound, so a host without one sees no behavior change.
|
|
247
|
+
*/
|
|
248
|
+
private guardInstanceChange;
|
|
249
|
+
/**
|
|
250
|
+
* Writes one case-lifecycle event (ADR 27 §1) in the caller's transaction.
|
|
251
|
+
* Returns before any lookup when no observer is bound, so a host without
|
|
252
|
+
* one pays nothing. `instanceState` is the state the change commits, not the
|
|
253
|
+
* state the instance held before it.
|
|
254
|
+
*/
|
|
255
|
+
private recordInstanceEvent;
|
|
256
|
+
/**
|
|
257
|
+
* Reads the template version a case runs on, inside the engine transaction,
|
|
258
|
+
* so the guard sees the same snapshot as the decision. A missing row fails
|
|
259
|
+
* the change rather than handing the guard a partial input.
|
|
260
|
+
*/
|
|
261
|
+
private readBoundTemplateVersionOrThrow;
|
|
201
262
|
/** Webhooks each open engine transaction will send once it has committed. */
|
|
202
263
|
private readonly deferredWebhookDispatches;
|
|
203
264
|
private readonly organizationTimeZone;
|
|
@@ -239,8 +300,42 @@ export declare class WorkflowEngineService {
|
|
|
239
300
|
*/
|
|
240
301
|
findApprovalInstanceByBusinessKey(templateId: string, businessKey: string): Promise<ApprovalInstanceEntity | null>;
|
|
241
302
|
private resolveFormDataOptionSnapshots;
|
|
303
|
+
/**
|
|
304
|
+
* ADR 27 §4(b): asks the data-source providers again, under the decision
|
|
305
|
+
* lock and as the approver, for the options of the approver-fillable fields.
|
|
306
|
+
* A value that is no longer among the options is refused by the resolver
|
|
307
|
+
* (`VALUE_NOT_RESOLVED`). Returns snapshots for the scoped fields only; the
|
|
308
|
+
* caller swaps them in for the stored ones.
|
|
309
|
+
*/
|
|
310
|
+
private refreshApproverFilledOptionSnapshots;
|
|
311
|
+
/**
|
|
312
|
+
* ADR 27 §4(b): asks the data-source providers again, as the approver, for
|
|
313
|
+
* the open data-source cells of column-mode tables. `revalidateAll` false lets
|
|
314
|
+
* the resolver reuse the stored options of cells whose value and bindings did
|
|
315
|
+
* not move. Returns snapshots for the cells of `cellSchema` only.
|
|
316
|
+
*/
|
|
317
|
+
private refreshApproverFilledOpenCellSnapshots;
|
|
318
|
+
/**
|
|
319
|
+
* Refuses an end user's resubmission of an instance bound to a `HOST_ONLY`
|
|
320
|
+
* version (ADR 27 §5). Checked before any data source is called and outside
|
|
321
|
+
* the lock: an instance never changes version and a published version never
|
|
322
|
+
* changes `launchMode`, so the answer cannot go stale. An instance that does
|
|
323
|
+
* not exist is left to the locked read, which reports it.
|
|
324
|
+
*/
|
|
325
|
+
private assertEndUserMayResubmit;
|
|
242
326
|
private prepareResubmitFormDataOptions;
|
|
243
327
|
processInstance(instanceId: string): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Records `TASK_AUTO_DECISION_FAILED` (ADR 27 §3) in its own transaction.
|
|
330
|
+
* Used after an automatic decision was refused by the instance guard: the
|
|
331
|
+
* decision's transaction has already rolled back, so the event cannot ride
|
|
332
|
+
* on it. Returns before any query when no observer is bound.
|
|
333
|
+
*/
|
|
334
|
+
recordTaskAutoDecisionFailed(input: {
|
|
335
|
+
readonly instanceId: string;
|
|
336
|
+
readonly taskId: string;
|
|
337
|
+
readonly reason: string;
|
|
338
|
+
}): Promise<void>;
|
|
244
339
|
decideTask(input: DecideTaskInput, options?: DecideTaskOptions): Promise<TaskDecisionEntity>;
|
|
245
340
|
cancelApprovalInstance(input: CancelApprovalInstanceInput): Promise<ApprovalInstanceEntity>;
|
|
246
341
|
/**
|
|
@@ -332,6 +427,16 @@ export declare class WorkflowEngineService {
|
|
|
332
427
|
*/
|
|
333
428
|
private readDryRunMemberIds;
|
|
334
429
|
getApprovalInstance(id: string, scope?: WorkflowReadScope): Promise<ApprovalInstanceEntity>;
|
|
430
|
+
/**
|
|
431
|
+
* ADR 27 §4.2 (gap 1): the fill units an approver may use to resolve runtime
|
|
432
|
+
* data-source options on a RUNNING instance. Only tasks the member can act on
|
|
433
|
+
* count: the member is the assignee or a PENDING/CLAIMED candidate of a
|
|
434
|
+
* PENDING or IN_PROGRESS, non-ad-hoc task. A task whose candidate row is
|
|
435
|
+
* WAITING or already decided grants nothing, even though its status is open.
|
|
436
|
+
* A field counts only when its node lists it as SHOW; a HIDE entry never
|
|
437
|
+
* grants, whatever its fill is. Returns `[]` when the instance is not RUNNING.
|
|
438
|
+
*/
|
|
439
|
+
listApproverFillUnits(instanceId: string, memberId: string): Promise<readonly FieldAccessFillUnit[]>;
|
|
335
440
|
/**
|
|
336
441
|
* ADR 25 §6: a value written to a filterable field must fit its type, on
|
|
337
442
|
* every path that writes form data. The fields checked are the ones the
|
|
@@ -415,9 +520,31 @@ export declare class WorkflowEngineService {
|
|
|
415
520
|
* {@link countInboxTasks} and the counters cannot disagree; only the page is
|
|
416
521
|
* given its candidate summaries.
|
|
417
522
|
*/
|
|
418
|
-
listInboxTasks(assigneeMemberId: string, options?:
|
|
523
|
+
listInboxTasks(assigneeMemberId: string, options?: InboxTaskListOptions): Promise<readonly TaskEntity[]>;
|
|
419
524
|
/** How many tasks {@link listInboxTasks} pages through. */
|
|
420
|
-
countInboxTasks(assigneeMemberId: string): Promise<number>;
|
|
525
|
+
countInboxTasks(assigneeMemberId: string, filter?: TaskTemplateFilter): Promise<number>;
|
|
526
|
+
/**
|
|
527
|
+
* The template ids a {@link TaskTemplateFilter} allows, or `null` when it
|
|
528
|
+
* does not filter. A `templateKey` that names no template allows nothing.
|
|
529
|
+
*/
|
|
530
|
+
private readTaskTemplateFilterIds;
|
|
531
|
+
/**
|
|
532
|
+
* Turns `templateKey` into `templateId` (ADR 27 §6), or `null` when the
|
|
533
|
+
* options can match nothing: an unknown key, or a key naming another
|
|
534
|
+
* template than `templateId` does.
|
|
535
|
+
*/
|
|
536
|
+
private resolveApprovalInstanceTemplateKey;
|
|
537
|
+
/**
|
|
538
|
+
* The id of the live template carrying `key`, as a list so a key that names
|
|
539
|
+
* nothing filters everything out. At most one live template holds a key.
|
|
540
|
+
*/
|
|
541
|
+
private readTemplateIdsByKey;
|
|
542
|
+
/**
|
|
543
|
+
* Keeps the tasks whose instance belongs to the filter's templates. The open
|
|
544
|
+
* task read is shared with the dashboard counters, so the filter is applied
|
|
545
|
+
* to its result rather than pushed into it.
|
|
546
|
+
*/
|
|
547
|
+
private filterTasksByTemplate;
|
|
421
548
|
/**
|
|
422
549
|
* {@link readOpenInboxTasks} for the inbox list and its count, joining a
|
|
423
550
|
* read for the same member that is still in flight. The client asks for
|
|
@@ -452,7 +579,7 @@ export declare class WorkflowEngineService {
|
|
|
452
579
|
*/
|
|
453
580
|
listApprovalHistoryTasks(assigneeMemberId: string, options?: ApprovalHistoryTaskListOptions): Promise<readonly TaskEntity[]>;
|
|
454
581
|
/** How many tasks {@link listApprovalHistoryTasks} pages through. */
|
|
455
|
-
countApprovalHistoryTasks(assigneeMemberId: string, options?:
|
|
582
|
+
countApprovalHistoryTasks(assigneeMemberId: string, options?: Omit<ApprovalHistoryTaskListOptions, 'page' | 'pageSize'>): Promise<number>;
|
|
456
583
|
/** The rows of {@link listApprovalHistoryTasks}, unordered and unpaged. */
|
|
457
584
|
private createApprovalHistoryTaskQuery;
|
|
458
585
|
/** When the member acted on a history task; see {@link listApprovalHistoryTasks}. */
|
|
@@ -471,7 +598,7 @@ export declare class WorkflowEngineService {
|
|
|
471
598
|
* snapshot without a `nodes` array, and a blank or non-string label all
|
|
472
599
|
* leave the task without a label, as `readWorkflowNodeLabel` does. Only the
|
|
473
600
|
* node's `fieldAccess` leaves the database for the fill flag, which
|
|
474
|
-
* `
|
|
601
|
+
* `readNodeFillGrantFieldKeys` then reads as tolerantly as the engine does.
|
|
475
602
|
*/
|
|
476
603
|
private readTaskNodeSummaries;
|
|
477
604
|
private readDefaultInitiatorMetadataSnapshot;
|
|
@@ -708,6 +835,13 @@ export declare class WorkflowEngineService {
|
|
|
708
835
|
*/
|
|
709
836
|
private readApprovalPrincipalMemberIds;
|
|
710
837
|
private resolveInitiatorManagerReplacements;
|
|
838
|
+
/**
|
|
839
|
+
* The context workflow expressions on `instance` read. Its `form` is the
|
|
840
|
+
* stored data, or with `expressionMissingFormFieldsAsNull` on, a copy with
|
|
841
|
+
* every unfilled top-level field present (ADR 27 §3).
|
|
842
|
+
*/
|
|
843
|
+
private buildExpressionContext;
|
|
844
|
+
private readExpressionFormData;
|
|
711
845
|
private buildDelegationContext;
|
|
712
846
|
private delegateResolvedCandidates;
|
|
713
847
|
/** One member's delegation, grade-gated as {@link applyGradeGate} says. */
|