@camunda/task-testing 2.2.0 → 3.0.0-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.
@@ -10,23 +10,26 @@ export class ElementConfig extends EventEmitter<[never]> {
10
10
  _injector: any;
11
11
  _elementVariables: any;
12
12
  /**
13
- * @type {import('./types').Config}
13
+ * @type {Config}
14
14
  */
15
- _config: import("./types").Config;
15
+ _config: Config;
16
16
  _selectedElement: any;
17
17
  _variablesForElements: Map<any, any>;
18
18
  setConfig(newConfig: any): void;
19
- getConfig(): import("./types").Config;
19
+ getConfig(): Config;
20
20
  setInputConfigForElement(element: any, newConfig: any): void;
21
21
  resetInputConfigForElement(element: any): void;
22
22
  setOutputConfigForElement(element: any, newConfig: any): void;
23
23
  resetOutputConfigForElement(element: any): void;
24
24
  getInputConfigForElement(element: any): string;
25
25
  /**
26
- * @param {import('./types').Element} element
27
- * @returns {import('./types').ElementOutput}
26
+ * @param {Element} element
27
+ * @returns {ElementOutput}
28
28
  */
29
- getOutputConfigForElement(element: import("./types").Element): import("./types").ElementOutput;
29
+ getOutputConfigForElement(element: Element): ElementOutput;
30
30
  _getDefaultInputConfig(): string;
31
31
  }
32
32
  import EventEmitter from 'events';
33
+ import type { Config } from './types';
34
+ import type { Element } from './types';
35
+ import type { ElementOutput } from './types';
@@ -0,0 +1,196 @@
1
+ export function createJobEntry(item: any, timestamp: any, overrides: any): {
2
+ type: "job";
3
+ data: ExecutionLogJobData;
4
+ timestamp: any;
5
+ };
6
+ /**
7
+ * Create log entries from job items. When a job has both a creation time
8
+ * (present for jobs created after 8.9) and an end time, two entries are
9
+ * produced - one for when the job was created and one for when it reached its
10
+ * final state (completed, failed, etc.). When a job has no creation time, the
11
+ * matching element instance's startDate is used as a best approximation.
12
+ *
13
+ * @param {JobSearchResult[]} jobs
14
+ * @param {ElementInstanceResult[]} elementInstances
15
+ * @param {number} fallbackTimestamp
16
+ *
17
+ * @returns {ExecutionLogJobEntry[]}
18
+ */
19
+ export function createJobEntries(jobs: JobSearchResult[], elementInstances: ElementInstanceResult[], fallbackTimestamp: number): ExecutionLogJobEntry[];
20
+ /**
21
+ * Create log entries from user task items. When a task has both a creation date
22
+ * and a completion date, two entries are produced — one for when the task was
23
+ * created and one for when it was completed.
24
+ *
25
+ * @param {UserTaskResult[]} userTasks
26
+ * @param {number} fallbackTimestamp
27
+ *
28
+ * @returns {ExecutionLogUserTaskEntry[]}
29
+ */
30
+ export function createUserTaskEntries(userTasks: UserTaskResult[], fallbackTimestamp: number): ExecutionLogUserTaskEntry[];
31
+ /**
32
+ * Create log entries from element instance items. When an instance has both a
33
+ * start date and an end date, two entries are produced — one for when the
34
+ * instance became active and one for when it completed.
35
+ *
36
+ * @param {ElementInstanceResult[]} instances
37
+ * @param {number} fallbackTimestamp
38
+ *
39
+ * @returns {ExecutionLogElementInstanceEntry[]}
40
+ */
41
+ export function createElementInstanceEntries(instances: ElementInstanceResult[], fallbackTimestamp: number): ExecutionLogElementInstanceEntry[];
42
+ /**
43
+ * Create log entries for message subscriptions. Timestamps are resolved from
44
+ * the matching element instance's startDate, since message subscriptions are
45
+ * created when their element is entered. Falls back to the poll timestamp
46
+ * when no matching element instance is found.
47
+ *
48
+ * @param {any[]} subscriptions
49
+ * @param {any[]} elementInstances
50
+ * @param {number} fallbackTimestamp
51
+ *
52
+ * @returns {ExecutionLogMessageSubscriptionEntry[]}
53
+ */
54
+ export function createMessageSubscriptionEntries(subscriptions: any[], elementInstances: any[], fallbackTimestamp: number): ExecutionLogMessageSubscriptionEntry[];
55
+ /**
56
+ * Create a status entry from a finished execution result.
57
+ *
58
+ * @param {TaskExecutionFinishedResult} result
59
+ * @param {number} timestamp
60
+ *
61
+ * @returns {ExecutionLogStatusEntry}
62
+ */
63
+ export function createFinishedStatusEntry(result: TaskExecutionFinishedResult, timestamp: number): ExecutionLogStatusEntry;
64
+ /**
65
+ * Format an element type for display (e.g. SERVICE_TASK → "Service Task").
66
+ *
67
+ * @param {string} type
68
+ *
69
+ * @returns {string}
70
+ */
71
+ export function formatElementType(type: string): string;
72
+ export namespace EXECUTION_LOG_ENTRY_TYPE {
73
+ let STATUS: "status";
74
+ let JOB: "job";
75
+ let USER_TASK: "user-task";
76
+ let MESSAGE_SUBSCRIPTION: "message-subscription";
77
+ let ELEMENT_INSTANCE: "element-instance";
78
+ }
79
+ export namespace EXECUTION_LOG_ENTRY_STATUS {
80
+ let DEPLOYING: "deploying";
81
+ let DEPLOYED: "deployed";
82
+ let STARTING_INSTANCE: "starting-instance";
83
+ let INSTANCE_STARTED: "instance-started";
84
+ let EXECUTING: "executing";
85
+ let COMPLETED: "completed";
86
+ let INCIDENT: "incident";
87
+ let TERMINATED: "terminated";
88
+ let CANCELED: "canceled";
89
+ }
90
+ export default class ExecutionLog {
91
+ /**
92
+ * @param {Injector} [injector]
93
+ */
94
+ constructor(injector?: Injector);
95
+ /** @type {{ type: TaskExecutionState, timestamp: number }|null} */
96
+ _state: {
97
+ type: TaskExecutionState;
98
+ timestamp: number;
99
+ } | null;
100
+ /** @type {{ response: DeployResponse, timestamp: number }|null} */
101
+ _deployResponse: {
102
+ response: DeployResponse;
103
+ timestamp: number;
104
+ } | null;
105
+ /** @type {{ response: StartInstanceResponse, timestamp: number }|null} */
106
+ _startInstanceResponse: {
107
+ response: StartInstanceResponse;
108
+ timestamp: number;
109
+ } | null;
110
+ /** @type {{
111
+ * result: TaskExecutionPolledResult;
112
+ * timestamp: number;
113
+ * }|null} */
114
+ _polledResult: {
115
+ result: TaskExecutionPolledResult;
116
+ timestamp: number;
117
+ } | null;
118
+ /** @type {{
119
+ * result: TaskExecutionFinishedResult;
120
+ * timestamp: number;
121
+ * }|null} */
122
+ _finishedResult: {
123
+ result: TaskExecutionFinishedResult;
124
+ timestamp: number;
125
+ } | null;
126
+ /** @type {ExecutionLogEntry[]} */
127
+ _entries: ExecutionLogEntry[];
128
+ /** @type {Object|null} */
129
+ _elementRegistry: any | null;
130
+ /**
131
+ * Set state.
132
+ *
133
+ * @param {TaskExecutionState} state
134
+ * @param {number} [timestamp]
135
+ */
136
+ setState(state: TaskExecutionState, timestamp?: number): void;
137
+ /**
138
+ * Set deploy response.
139
+ *
140
+ * @param {DeployResponse} deployResponse
141
+ * @param {number} [timestamp]
142
+ */
143
+ setDeployResponse(deployResponse: DeployResponse, timestamp?: number): void;
144
+ /**
145
+ * Set start instance response.
146
+ *
147
+ * @param {StartInstanceResponse} startInstanceResponse
148
+ * @param {number} [timestamp]
149
+ */
150
+ setStartInstanceResponse(startInstanceResponse: StartInstanceResponse, timestamp?: number): void;
151
+ /**
152
+ * Set poll result.
153
+ *
154
+ * @param {TaskExecutionPolledResult} result
155
+ * @param {number} [timestamp]
156
+ */
157
+ setPolledResult(result: TaskExecutionPolledResult, timestamp?: number): void;
158
+ /**
159
+ * Set finished result.
160
+ *
161
+ * @param {TaskExecutionFinishedResult} result
162
+ * @param {number} [timestamp]
163
+ */
164
+ setFinishedResult(result: TaskExecutionFinishedResult, timestamp?: number): void;
165
+ /**
166
+ * @returns {ExecutionLogEntry[]}
167
+ */
168
+ getEntries(): ExecutionLogEntry[];
169
+ /**
170
+ * Clear all data and entries.
171
+ */
172
+ reset(): void;
173
+ /**
174
+ * Build the full list of log entries from all available data. Entries are
175
+ * compiled from deploy/start-instance responses, polled result items (jobs,
176
+ * user tasks, element instances, message subscriptions), the finished result,
177
+ * and the ephemeral execution state. All entries are sorted chronologically.
178
+ */
179
+ _updateEntries(): void;
180
+ }
181
+ import type { ExecutionLogJobData } from './types';
182
+ import type { JobSearchResult } from './types';
183
+ import type { ElementInstanceResult } from './types';
184
+ import type { ExecutionLogJobEntry } from './types';
185
+ import type { UserTaskResult } from './types';
186
+ import type { ExecutionLogUserTaskEntry } from './types';
187
+ import type { ExecutionLogElementInstanceEntry } from './types';
188
+ import type { ExecutionLogMessageSubscriptionEntry } from './types';
189
+ import type { TaskExecutionFinishedResult } from './types';
190
+ import type { ExecutionLogStatusEntry } from './types';
191
+ import type { TaskExecutionState } from './types';
192
+ import type { DeployResponse } from './types';
193
+ import type { StartInstanceResponse } from './types';
194
+ import type { TaskExecutionPolledResult } from './types';
195
+ import type { ExecutionLogEntry } from './types';
196
+ import type { Injector } from 'didi';
@@ -1,67 +1,133 @@
1
1
  /**
2
+ * Get the incident details from the response.
2
3
  *
3
- * @param {import('./types').VariableSearchResult[]} getVariablesResponseItems
4
- * @param {import('./types').ElementInstanceResult[]} getElementInstancesResponseItems
5
- * @param {import('./types').ProcessInstanceResult} processInstance
6
- * @param elementId
7
- * @returns {object}
4
+ * @param {IncidentSearchQueryResult} response
5
+ *
6
+ * @returns {IncidentResult|null}
8
7
  */
9
- export function getVariables(getVariablesResponseItems: import("./types").VariableSearchResult[], getElementInstancesResponseItems: import("./types").ElementInstanceResult[], processInstance: import("./types").ProcessInstanceResult, elementId: any): object;
8
+ export function getIncident(response: IncidentSearchQueryResult): IncidentResult | null;
10
9
  /**
11
10
  * Get the process definition key from the deployment response.
12
11
  *
13
- * @param {import('./types').ExtendedDeploymentResult} deployResponse
12
+ * @param {DeploymentResult} deployResponse
14
13
  * @param {string} processId
15
14
  *
16
- * @returns {string | null}
15
+ * @returns {string|null} The process definition key or null if not found.
17
16
  */
18
- export function getProcessDefinitionKey(deployResponse: import("./types").ExtendedDeploymentResult, processId: string): string | null;
19
- export const INTERVAL_MS: 1000;
20
- export namespace SCOPES {
21
- let LOCAL: string;
22
- let PROCESS: string;
17
+ export function getProcessDefinitionKey(deployResponse: DeploymentResult, processId: string): string | null;
18
+ /**
19
+ * Get the element instance of the given element from the response.
20
+ *
21
+ * @param {ElementInstanceSearchQueryResult} response
22
+ * @param {Element} element
23
+ *
24
+ * @returns {ElementInstanceResult|null} The element instance or null if not found.
25
+ */
26
+ export function getElementInstance(response: ElementInstanceSearchQueryResult, element: Element): ElementInstanceResult | null;
27
+ export const POLL_INTERVAL_MS: 1000;
28
+ export namespace TASK_EXECUTION_STATE {
29
+ let IDLE: "idle";
30
+ let DEPLOYING: "deploying";
31
+ let STARTING_INSTANCE: "starting-instance";
32
+ let EXECUTING: "executing";
33
+ }
34
+ export namespace TASK_EXECUTION_FINISHED_REASON {
35
+ let ERROR: "error";
36
+ let INCIDENT: "incident";
37
+ let TERMINATED: "terminated";
38
+ let USER_CANCEL: "user.cancel";
39
+ let USER_SELECTION_CHANGED: "user.selectionChanged";
40
+ }
41
+ export namespace PROCESS_INSTANCE_STATE {
42
+ export let ACTIVE: "ACTIVE";
43
+ export let COMPLETED: "COMPLETED";
44
+ let TERMINATED_1: "TERMINATED";
45
+ export { TERMINATED_1 as TERMINATED };
46
+ }
47
+ export namespace ELEMENT_INSTANCE_STATE {
48
+ let ACTIVE_1: "ACTIVE";
49
+ export { ACTIVE_1 as ACTIVE };
50
+ let COMPLETED_1: "COMPLETED";
51
+ export { COMPLETED_1 as COMPLETED };
52
+ let TERMINATED_2: "TERMINATED";
53
+ export { TERMINATED_2 as TERMINATED };
54
+ }
55
+ export namespace TASK_EXECUTION_EVENT {
56
+ let STATE_CHANGED: "taskExecution.state.changed";
57
+ let DEPLOYED: "taskExecution.deployed";
58
+ let INSTANCE_STARTED: "taskExecution.instanceStarted";
59
+ let POLLED: "taskExecution.polled";
60
+ let FINISHED: "taskExecution.finished";
23
61
  }
24
62
  /**
25
- * Emits:
26
- * - `taskExecution.status.changed` with one of {@link TaskExecutionStatus}
27
- * - `taskExecution.finished` with {@link TaskExecutionResult}
28
- * - `taskExecution.error` with {@link TaskExecutionError}
29
- * - `taskExecution.interrupted` when execution is interrupted by switching focus
63
+ * Deploys a process, starts an instance, and polls for completion every second.
64
+ * Each call to {@link executeTask} assigns a unique execution ID; in-flight
65
+ * responses from a superseded or canceled execution are silently discarded.
66
+ *
67
+ * Cancellation {@link cancelTaskExecution} (user-initiated, selection change, or error) clears the interval,
68
+ * invalidates the execution ID, and emits a finished event. Process instances
69
+ * are not automatically terminated on cancellation.
70
+ *
71
+ * @emits `taskExecution.state.changed` with payload of type {@link TaskExecutionState}
72
+ * @emits `taskExecution.deployed` with payload of type {@link DeploymentResult}
73
+ * @emits `taskExecution.instanceStarted` with payload of type {@link CreateProcessInstanceResult}
74
+ * @emits `taskExecution.polled` with payload of type {@link TaskExecutionPolledResult}
75
+ * @emits `taskExecution.finished` with payload of type {@link TaskExecutionFinishedResult}
30
76
  */
31
77
  export default class TaskExecution extends EventEmitter<[never]> {
32
78
  /**
33
- * @param {import('didi').Injector} injector
79
+ * @param {Injector} injector
34
80
  * @param {TaskExecutionApi} api
35
81
  */
36
- constructor(injector: import("didi").Injector, api: TaskExecutionApi);
82
+ constructor(injector: Injector, api: TaskExecutionApi);
37
83
  /** @type {TaskExecutionApi} */
38
84
  _api: TaskExecutionApi;
39
85
  _interval: NodeJS.Timeout | null;
40
- /** @type {TaskExecutionStatus} */
41
- _status: TaskExecutionStatus;
86
+ /** @type {Symbol|null} */
87
+ _executionId: Symbol | null;
88
+ /** @type {typeof TASK_EXECUTION_STATE[keyof typeof TASK_EXECUTION_STATE]} */
89
+ _state: (typeof TASK_EXECUTION_STATE)[keyof typeof TASK_EXECUTION_STATE];
90
+ /** @type {TaskExecutionPolledResult|null} */
91
+ _lastPolledResult: TaskExecutionPolledResult | null;
42
92
  /**
43
- * Start task execution.
93
+ * Start task execution. If an execution is already in progress, its
94
+ * in-flight responses will be silently discarded.
44
95
  *
45
- * @param {import('./types').Element} element
96
+ * @param {Element} element
46
97
  * @param {Object} variables
47
98
  *
48
99
  * @returns {Promise<void>}
49
100
  */
50
- executeTask(element: import("./types").Element, variables: any): Promise<void>;
101
+ executeTask(element: Element, variables: any): Promise<void>;
51
102
  /**
52
- * Cancel current task execution, clean up and change status to `idle`.
103
+ * Cancel current task execution with user cancellation reason.
53
104
  */
54
105
  cancelTaskExecution(): Promise<void>;
55
106
  /**
56
- * Emit `taskExecution.error` event.
107
+ * Cancel current task execution, invalidate the execution ID, and
108
+ * transition to idle. No-op when already idle. If a reason is provided,
109
+ * emits a `taskExecution.finished` event with the corresponding result.
110
+ *
111
+ * @param {typeof TASK_EXECUTION_FINISHED_REASON[keyof typeof TASK_EXECUTION_FINISHED_REASON]} [reason]
112
+ * @param {TaskExecutionError} [error]
113
+ */
114
+ _cancelTaskExecution(reason?: (typeof TASK_EXECUTION_FINISHED_REASON)[keyof typeof TASK_EXECUTION_FINISHED_REASON], error?: TaskExecutionError): void;
115
+ /**
116
+ * Change execution state and emit event.
57
117
  *
58
- * @param {string} message
59
- * @param {any} [response]
118
+ * @param {typeof TASK_EXECUTION_STATE[keyof typeof TASK_EXECUTION_STATE]} state - New state
60
119
  */
61
- _emitError(message: string, response?: any): void;
62
- /** @param {TaskExecutionStatus} status */
63
- _changeStatus(status: TaskExecutionStatus, ...args: any[]): void;
120
+ _changeState(state: (typeof TASK_EXECUTION_STATE)[keyof typeof TASK_EXECUTION_STATE]): void;
121
+ _isIdle(): boolean;
64
122
  }
123
+ import type { IncidentSearchQueryResult } from './types';
124
+ import type { IncidentResult } from './types';
125
+ import type { DeploymentResult } from './types';
126
+ import type { ElementInstanceSearchQueryResult } from './types';
127
+ import type { Element } from './types';
128
+ import type { ElementInstanceResult } from './types';
65
129
  import EventEmitter from 'events';
66
130
  import type { TaskExecutionApi } from './types';
67
- import type { TaskExecutionStatus } from './types';
131
+ import type { TaskExecutionPolledResult } from './types';
132
+ import type { TaskExecutionError } from './types';
133
+ import type { Injector } from 'didi';
@@ -1,7 +1,8 @@
1
- export default function InputEditor({ allOutputs, value, onChange, onErrorChange, variablesForElement }: {
1
+ export default function InputEditor({ allOutputs, value, onChange, onClear, onErrorChange, variablesForElement }: {
2
2
  allOutputs?: {} | undefined;
3
3
  value: any;
4
4
  onChange: any;
5
+ onClear: any;
5
6
  onErrorChange: any;
6
7
  variablesForElement?: any[] | undefined;
7
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @param {Object} props
3
+ * @param {ExecutionLogEntry[]} props.entries
4
+ * @param {string} [props.tasklistBaseUrl]
5
+ * @param {string|null} [props.currentOperateUrl]
6
+ * @param {boolean} [props.isTaskExecuting]
7
+ */
8
+ export function ExecutionLog({ entries, tasklistBaseUrl, currentOperateUrl, isTaskExecuting }: {
9
+ entries: ExecutionLogEntry[];
10
+ tasklistBaseUrl?: string | undefined;
11
+ currentOperateUrl?: string | null | undefined;
12
+ isTaskExecuting?: boolean | undefined;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ export namespace JOB_STATES {
15
+ let CANCELED: "CANCELED";
16
+ let COMPLETED: "COMPLETED";
17
+ let CREATED: "CREATED";
18
+ let ERROR_THROWN: "ERROR_THROWN";
19
+ let FAILED: "FAILED";
20
+ let MIGRATED: "MIGRATED";
21
+ let RETRIES_UPDATED: "RETRIES_UPDATED";
22
+ let TIMED_OUT: "TIMED_OUT";
23
+ }
24
+ import type { ExecutionLogEntry } from '../../types';
@@ -1,46 +1,43 @@
1
1
  /**
2
2
  * @param {Object} props
3
- * @param {import('bpmn-js/lib/model/Types').Element} props.element
3
+ * @param {Element} props.element
4
4
  * @param {boolean} props.isConnectionConfigured
5
- * @param {string} props.configureConnectionBannerTitle
6
- * @param {string} props.configureConnectionBannerDescription
7
- * @param {string} props.configureConnectionLabel
8
- * @param {string|undefined} props.currentOperateUrl
9
- * @param {Function} [props.onConfigureConnection]
5
+ * @param {string|null} props.currentOperateUrl
10
6
  * @param {boolean} props.isTaskExecuting
11
- * @param {import('../../types').ElementOutput} props.output
7
+ * @param {ElementOutput} props.output
12
8
  * @param {Function} props.onResetOutput
13
- * @param {import('../../types').TaskExecutionStatus} props.taskExecutionStatus
9
+ * @param {TaskExecutionState} props.taskExecutionState
10
+ * @param {ExecutionLogEntry[]} props.executionLog
11
+ * @param {string} [props.tasklistBaseUrl]
12
+ * @param {Object} [props.currentVariables]
14
13
  */
15
- export default function Output({ element, isConnectionConfigured, configureConnectionBannerTitle, configureConnectionBannerDescription, configureConnectionLabel, onConfigureConnection, isTaskExecuting, output, currentOperateUrl, onResetOutput, taskExecutionStatus }: {
16
- element: import("bpmn-js/lib/model/Types").Element;
14
+ export default function Output({ element, isConnectionConfigured, isTaskExecuting, output, currentOperateUrl, onResetOutput, taskExecutionState, executionLog, tasklistBaseUrl, currentVariables }: {
15
+ element: Element;
17
16
  isConnectionConfigured: boolean;
18
- configureConnectionBannerTitle: string;
19
- configureConnectionBannerDescription: string;
20
- configureConnectionLabel: string;
21
- currentOperateUrl: string | undefined;
22
- onConfigureConnection?: Function | undefined;
17
+ currentOperateUrl: string | null;
23
18
  isTaskExecuting: boolean;
24
- output: import("../../types").ElementOutput;
19
+ output: ElementOutput;
25
20
  onResetOutput: Function;
26
- taskExecutionStatus: import("../../types").TaskExecutionStatus;
21
+ taskExecutionState: TaskExecutionState;
22
+ executionLog: ExecutionLogEntry[];
23
+ tasklistBaseUrl?: string | undefined;
24
+ currentVariables?: any;
27
25
  }): import("react/jsx-runtime").JSX.Element;
28
- export const TASK_EXECUTION_STATUS_LABEL: {
29
- deploying: string;
30
- 'starting-instance': string;
31
- executing: string;
32
- };
33
- export const NO_OPERATE_URL_TOOLTIP: "No Operate URL set for this connection";
34
- export function HeaderLink({ children, render, visible, href, target, className, onClick, role, tooltip, priority }: {
35
- render?: ((props: any) => React.ReactNode) | undefined;
36
- children?: React.ReactNode;
37
- visible?: boolean | ((props: any) => boolean) | undefined;
38
- href?: string | ((props: any) => string) | undefined;
39
- target?: string | ((props: any) => string) | undefined;
40
- className?: string | ((props: any) => string | undefined) | undefined;
41
- onClick?: Function | ((props: any) => Function) | undefined;
42
- role?: string | ((props: any) => string) | undefined;
43
- tooltip?: string | ((props: any) => string | undefined) | undefined;
26
+ export function HeaderLink({ children, render, visible, href, target, className, onClick, renderIcon, role, tooltip, priority }: {
27
+ children?: null | undefined;
28
+ render?: ((props?: any) => React.ReactNode) | undefined;
29
+ visible: any;
30
+ href: any;
31
+ target: any;
32
+ className: any;
33
+ onClick?: undefined;
34
+ renderIcon: any;
35
+ role?: undefined;
36
+ tooltip: any;
44
37
  priority?: number | undefined;
45
38
  }): null;
39
+ import type { Element } from 'bpmn-js/lib/model/Types';
40
+ import type { ElementOutput } from '../../types';
41
+ import type { TaskExecutionState } from '../../types';
42
+ import type { ExecutionLogEntry } from '../../types';
46
43
  import React from 'react';
@@ -1,49 +1,58 @@
1
1
  /**
2
2
  * @param {Object} props
3
3
  * @param {Object} props.injector
4
- * @param {import('../../types').TaskExecutionApi} props.api
4
+ * @param {TaskExecutionApi} props.api
5
5
  * @param {boolean} props.isConnectionConfigured
6
6
  * @param {string} [props.configureConnectionBannerTitle]
7
7
  * @param {string} [props.configureConnectionBannerDescription]
8
8
  * @param {string} [props.configureConnectionLabel]
9
9
  * @param {Function} [props.onConfigureConnection] - Callback invoked when
10
10
  * the user clicks on the _Configure connection_ button.
11
- * @param {(() => boolean | Promise<boolean>)} [props.onTestTask] - Callback invoked when the user clicks
12
- * on the _Test task_ button. Should return `true` to proceed with task
13
- * execution or `false` to abort it. Can return a promise resolving to a
14
- * boolean.
15
- * @param {import('../../types').Config|undefined} [props.config]
16
- * @param {Function} [props.onConfigChanged=() => {}]
11
+ * @param {(() => boolean | Promise<boolean>)} [props.onTestTask] - Callback
12
+ * invoked when the user clicks on the _Test task_ button. Should return `true`
13
+ * to proceed with task execution or `false` to abort it. Can return a promise
14
+ * resolving to a boolean.
15
+ * @param {Config|undefined} [props.config]
16
+ * @param {(config: Config) => void} [props.onConfigChanged] - Called when the configuration changes
17
17
  * @param {string} [props.operateBaseUrl]
18
+ * @param {string} [props.tasklistBaseUrl]
18
19
  * @param {string} [props.documentationUrl]
19
- * @param {Function} [props.onTaskExecutionStarted=() => {}]
20
- * @param {Function} [props.onTaskExecutionFinished=() => {}]
21
- * @param {Function} [props.onTaskExecutionInterrupted=() => {}]
20
+ * @param {(element: Element) => void} [props.onTaskExecutionStarted] - Called with (element) when task execution starts
21
+ * @param {(element: Element, result: TaskExecutionFinishedResult) => void} [props.onTaskExecutionFinished] - Called with (element, result) where result contains success and optional reason for failures
22
22
  * @param {React.ReactNode[]} [props.children=[]]
23
23
  */
24
- declare function TaskTesting({ injector, api, isConnectionConfigured, configureConnectionBannerTitle, configureConnectionBannerDescription, configureConnectionLabel, onConfigureConnection, onTestTask, config, onConfigChanged, operateBaseUrl, documentationUrl, onTaskExecutionStarted, onTaskExecutionFinished, onTaskExecutionInterrupted, children }: {
24
+ declare function TaskTesting({ injector, api, isConnectionConfigured, configureConnectionBannerTitle, configureConnectionBannerDescription, configureConnectionLabel, onConfigureConnection, onTestTask, config, onConfigChanged, operateBaseUrl, tasklistBaseUrl, documentationUrl, onTaskExecutionStarted, onTaskExecutionFinished, children }: {
25
25
  injector: any;
26
- api: import("../../types").TaskExecutionApi;
26
+ api: TaskExecutionApi;
27
27
  isConnectionConfigured: boolean;
28
28
  configureConnectionBannerTitle?: string | undefined;
29
29
  configureConnectionBannerDescription?: string | undefined;
30
30
  configureConnectionLabel?: string | undefined;
31
31
  onConfigureConnection?: Function | undefined;
32
32
  onTestTask?: (() => boolean | Promise<boolean>) | undefined;
33
- config?: import("../../types").Config | undefined;
34
- onConfigChanged?: Function | undefined;
33
+ config?: Config | undefined;
34
+ onConfigChanged?: ((config: Config) => void) | undefined;
35
35
  operateBaseUrl?: string | undefined;
36
+ tasklistBaseUrl?: string | undefined;
36
37
  documentationUrl?: string | undefined;
37
- onTaskExecutionStarted?: Function | undefined;
38
- onTaskExecutionFinished?: Function | undefined;
39
- onTaskExecutionInterrupted?: Function | undefined;
38
+ onTaskExecutionStarted?: ((element: Element) => void) | undefined;
39
+ onTaskExecutionFinished?: ((element: Element, result: TaskExecutionFinishedResult) => void) | undefined;
40
40
  children?: React.ReactNode[] | undefined;
41
41
  }): import("react/jsx-runtime").JSX.Element;
42
42
  declare namespace TaskTesting {
43
- export { OutputTab as Tab };
43
+ export { PluginTab as Tab };
44
44
  export { HeaderLink as Link };
45
45
  }
46
46
  export default TaskTesting;
47
+ import type { TaskExecutionApi } from '../../types';
48
+ import type { Config } from '../../types';
49
+ import type { Element } from 'bpmn-js/lib/model/Types';
50
+ import type { TaskExecutionFinishedResult } from '../../types';
47
51
  import React from 'react';
48
- import { OutputTab } from '../Output/OutputVariables';
52
+ declare function PluginTab({ children, render, label, priority }: {
53
+ children?: null | undefined;
54
+ render?: (() => null) | undefined;
55
+ label: any;
56
+ priority?: number | undefined;
57
+ }): null;
49
58
  import { HeaderLink } from '../Output/Output';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @typedef {'bottom-start' | 'bottom-end' | 'top-start' | 'top-end'} TooltipAlign
3
+ */
4
+ /**
5
+ * Lightweight tooltip component.
6
+ *
7
+ * @param {Object} props
8
+ * @param {React.ReactNode} props.label - Tooltip content
9
+ * @param {React.ReactNode} props.children - Trigger element(s)
10
+ * @param {TooltipAlign} [props.align='bottom-start'] - Tooltip alignment
11
+ * @param {string} [props.className] - Additional CSS class for the wrapper
12
+ * @param {number} [props.showDelay=250] - Delay in ms before showing
13
+ * @param {number} [props.hideDelay=250] - Delay in ms before hiding
14
+ */
15
+ export default function Tooltip({ label, children, align, className, showDelay, hideDelay }: {
16
+ label: React.ReactNode;
17
+ children: React.ReactNode;
18
+ align?: TooltipAlign | undefined;
19
+ className?: string | undefined;
20
+ showDelay?: number | undefined;
21
+ hideDelay?: number | undefined;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ export type TooltipAlign = "bottom-start" | "bottom-end" | "top-start" | "top-end";
24
+ import React from 'react';
@@ -1,4 +1,4 @@
1
- export const PluginContext: import("react").Context<import("../../types").PluginContextValue>;
1
+ export const PluginContext: import("react").Context<PluginContextValue>;
2
2
  export function usePluginsProviderValue(defaultValue?: Plugin[]): PluginContextValue;
3
- export type Plugin = import("../../types").Plugin;
4
- export type PluginContextValue = import("../../types").PluginContextValue;
3
+ import type { PluginContextValue } from '../../types';
4
+ import type { Plugin } from '../../types';
@@ -1,11 +1,13 @@
1
1
  /**
2
- * Get currently selected BPMN element, if it is a single `bpmn:Task`. If not,
3
- * return null and a message indicating what to do.
2
+ * Get currently selected BPMN element, if it is a single supported element
3
+ * (`bpmn:Task` or `bpmn:SubProcess`). If not, return null and a message
4
+ * indicating what to do.
4
5
  *
5
6
  * @param {Object} injector
6
- * @return {[ Object|null, string|null ]}
7
+ *
8
+ * @returns {[ Object|null, string|null ]}
7
9
  */
8
10
  export function useSelectedElement(injector: any): [any | null, string | null];
9
- export const SINGLE_TASK_SELECTION_REQUIRED_MESSAGE: "Select a task to start testing.";
10
- export const TASK_SELECTION_REQUIRED_MESSAGE: "Task testing is only supported for tasks. Select a task to start testing.";
11
- export const AD_HOC_SUBPROCESS_TASK_UNSUPPORTED_MESSAGE: "Task testing is not supported for tasks inside an ad-hoc subprocess. Select a different task to start testing.";
11
+ export const SINGLE_TASK_SELECTION_REQUIRED_MESSAGE: "Select a task or subprocess to start testing.";
12
+ export const TASK_SELECTION_REQUIRED_MESSAGE: "Task testing is only supported for tasks and subprocesses. Select one to start testing.";
13
+ export const AD_HOC_SUBPROCESS_MESSAGE: "Task testing is not supported for tasks inside ad-hoc subprocesses.";