@uipath/maestro-builder-sdk 6.120.16 → 6.120.18
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/dist/api-index.md +41 -41
- package/dist/api-members.md +183 -181
- package/dist/bpmn/bpmn-sdk.d.ts +45 -25
- package/dist/bpmn/bpmn-sdk.js +69 -34
- package/dist/bpmn/check.js +32 -16
- package/dist/bpmn/registry-types.json +22 -31
- package/dist/bpmn-api.md +6 -4
- package/dist/core/connector-inputs.js +29 -2
- package/dist/core/library.d.ts +35 -0
- package/dist/core/library.js +39 -4
- package/dist/core/refusals.d.ts +3 -0
- package/dist/core/refusals.js +3 -0
- package/package.json +2 -2
package/dist/bpmn/bpmn-sdk.d.ts
CHANGED
|
@@ -1541,34 +1541,51 @@ export interface HumanTaskCommonOpts extends ActivityOpts {
|
|
|
1541
1541
|
/**
|
|
1542
1542
|
* Options for `.humanTask()` backed by an Action App — an `Actions.HITL` action-app task.
|
|
1543
1543
|
*
|
|
1544
|
-
*
|
|
1545
|
-
*
|
|
1546
|
-
*
|
|
1547
|
-
*
|
|
1544
|
+
* The app is addressed by its NAME and FOLDER PATH, the way Studio Web saves the task:
|
|
1545
|
+
* `uipath:type version="v2"`, `name` and `folderPath` context inputs that are
|
|
1546
|
+
* `=bindings.<id>` references, and two `resource="app"` bindings (`propertyAttribute`
|
|
1547
|
+
* `name` and `folderPath`) keyed `<folder>.<app>`. The SDK declares the bindings for you
|
|
1548
|
+
* from the two plain values, so each is overridable per environment at deploy time.
|
|
1549
|
+
*
|
|
1550
|
+
* Both come from the tenant (`RequiresDiscovery: Yes`): the app as Action Center lists
|
|
1551
|
+
* it, and the Orchestrator folder it is deployed to. With no app on the tenant, use
|
|
1552
|
+
* {@link HumanTaskFormOpts} instead.
|
|
1553
|
+
*
|
|
1554
|
+
* @remarks
|
|
1555
|
+
* **Not an app id.** Before UiPath/builder-sdk#2144 `app` was the app's id and the task
|
|
1556
|
+
* was written at `version="v1"` with an `appId` context input. The V2 engine never reads
|
|
1557
|
+
* `appId`: it resolves the app only from `name`/`folderPath` at v2, and fails a v1 task
|
|
1558
|
+
* with 170000. `folder` is required so a program written against the old meaning is
|
|
1559
|
+
* refused (`BPMN_HUMAN_TASK_APP_NO_FOLDER`) rather than compiled into a task that looks
|
|
1560
|
+
* up an app NAMED like the id.
|
|
1548
1561
|
*/
|
|
1549
1562
|
export interface HumanTaskAppOpts extends HumanTaskCommonOpts {
|
|
1550
|
-
/**
|
|
1563
|
+
/**
|
|
1564
|
+
* The Action App's name, e.g. `'InvoiceApproval'` — the context's `name`. Or an
|
|
1565
|
+
* `=bindings.<id>` reference to an `app` / `name` binding you declared.
|
|
1566
|
+
*/
|
|
1551
1567
|
app: string;
|
|
1552
|
-
/** Not on this variant — see {@link HumanTaskFormOpts}. */
|
|
1553
|
-
form?: never;
|
|
1554
|
-
/** The app version (`appVersion`). */
|
|
1555
|
-
appVersion?: number;
|
|
1556
1568
|
/**
|
|
1557
|
-
* The
|
|
1558
|
-
*
|
|
1559
|
-
*
|
|
1560
|
-
* nothing about its encoding, and `uip maestro bpmn validate` accepts a
|
|
1561
|
-
* comma-joined list, a JSON array, a single word and an empty string alike — so
|
|
1562
|
-
* this is the plausible reading, not a verified one. If a LIVE run mis-reads the
|
|
1563
|
-
* outcomes, this is the first thing to compare against a Studio Web export.
|
|
1569
|
+
* The Orchestrator folder path the app is deployed to, e.g. `'Shared'` or
|
|
1570
|
+
* `'Finance/Invoices'` — the context's `folderPath`. Or an `=bindings.<id>` reference
|
|
1571
|
+
* to an `app` / `folderPath` binding you declared.
|
|
1564
1572
|
*/
|
|
1565
|
-
|
|
1566
|
-
/**
|
|
1567
|
-
|
|
1573
|
+
folder: string;
|
|
1574
|
+
/** Not on this variant — see {@link HumanTaskFormOpts}. */
|
|
1575
|
+
form?: never;
|
|
1568
1576
|
/** Data the task shows the human — the node's `HitlTaskArguments`. */
|
|
1569
1577
|
input?: Record<string, unknown>;
|
|
1570
1578
|
/** Variable the whole typed response lands in. Defaults to `<id>_processResponse`. */
|
|
1571
1579
|
outputVar?: string;
|
|
1580
|
+
/**
|
|
1581
|
+
* Removed (#2144): a v1 `appId`-task field the V2 engine never reads. The app defines
|
|
1582
|
+
* its own outcomes; read the one picked with `outputs: { decision: '=Action' }`.
|
|
1583
|
+
*/
|
|
1584
|
+
actions?: never;
|
|
1585
|
+
/** Removed (#2144): a v1 `appId`-task field the V2 engine never reads. */
|
|
1586
|
+
appVersion?: never;
|
|
1587
|
+
/** Removed (#2144): a v1 `appId`-task field the V2 engine never reads. */
|
|
1588
|
+
key?: never;
|
|
1572
1589
|
}
|
|
1573
1590
|
/**
|
|
1574
1591
|
* Options for `.humanTask()` with an INLINE form — the quick-form `Actions.HITL` task,
|
|
@@ -1589,6 +1606,8 @@ export interface HumanTaskFormOpts extends HumanTaskCommonOpts {
|
|
|
1589
1606
|
form: HumanTaskForm;
|
|
1590
1607
|
/** Not on this variant — the form replaces the app. */
|
|
1591
1608
|
app?: never;
|
|
1609
|
+
/** Not on this variant — there is no app to look up in a folder. */
|
|
1610
|
+
folder?: never;
|
|
1592
1611
|
/** Action Center priority, e.g. `'Medium'` (`priority`). */
|
|
1593
1612
|
priority?: string;
|
|
1594
1613
|
/** Action Center labels, comma-separated (`labels`). */
|
|
@@ -2970,9 +2989,10 @@ declare abstract class ScopeBuilder {
|
|
|
2970
2989
|
* @remarks
|
|
2971
2990
|
* **Pick the variant by whether an app is named.** With no deployed Action App named,
|
|
2972
2991
|
* use `form: { fields, outcomes }` ({@link HumanTaskFormOpts}): the form travels in the
|
|
2973
|
-
* `.bpmn` and nothing on the tenant has to exist. Use `app`
|
|
2974
|
-
* only when the request names a deployed app
|
|
2975
|
-
*
|
|
2992
|
+
* `.bpmn` and nothing on the tenant has to exist. Use `app` and `folder`
|
|
2993
|
+
* ({@link HumanTaskAppOpts}) only when the request names a deployed app: the app's name
|
|
2994
|
+
* and the folder path it is deployed to. The SDK writes them as the two `app` bindings
|
|
2995
|
+
* Studio Web saves, so a deploy can point the task at another environment's app.
|
|
2976
2996
|
*
|
|
2977
2997
|
* The offline runtime can stand in for the human — `--hitl-response` injects an
|
|
2978
2998
|
* outcome — so an approval gate's branches are testable with no tenant and no
|
|
@@ -2993,9 +3013,9 @@ declare abstract class ScopeBuilder {
|
|
|
2993
3013
|
* .var('outcome', 'string', { default: 'none' })
|
|
2994
3014
|
* .startEvent('start')
|
|
2995
3015
|
* .humanTask('approve', {
|
|
2996
|
-
* app: '
|
|
3016
|
+
* app: 'InvoiceApproval',
|
|
3017
|
+
* folder: 'Shared',
|
|
2997
3018
|
* title: 'Approve the invoice',
|
|
2998
|
-
* actions: ['approve', 'reject'],
|
|
2999
3019
|
* input: { amount: 100 },
|
|
3000
3020
|
* outputs: { decision: '=Action' },
|
|
3001
3021
|
* })
|
|
@@ -3674,7 +3694,7 @@ export declare class PathBuilder extends ScopeBuilder {
|
|
|
3674
3694
|
* bpmn('approval')
|
|
3675
3695
|
* .var('reminded', 'string')
|
|
3676
3696
|
* .startEvent('start')
|
|
3677
|
-
* .humanTask('approve', { app: 'InvoiceApproval',
|
|
3697
|
+
* .humanTask('approve', { app: 'InvoiceApproval', folder: 'Shared' }, (t) => {
|
|
3678
3698
|
* t.onTimer('PT1H', { interrupting: false }, (b) =>
|
|
3679
3699
|
* b.task('remind', { set: { reminded: 'true' } }).endEvent('reminded'));
|
|
3680
3700
|
* t.onError((b) => b.endEvent('failed', { name: 'Approval failed' }));
|
package/dist/bpmn/bpmn-sdk.js
CHANGED
|
@@ -14,6 +14,19 @@ export { connectorOutputVars, nodeDeclaredVars, typedNodeDeclaredVars } from './
|
|
|
14
14
|
function normTimer(t) {
|
|
15
15
|
return typeof t === 'string' ? { duration: t } : t;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The `uipath:type` version of an app-backed `.humanTask()`. PO.BpmnEngine
|
|
19
|
+
* (`AppTasksCreateArgs`) reads the app from `name`/`folderPath` only on `v2`; on `v1` it
|
|
20
|
+
* reads no app at all and the AppTasks request fails with 170000 (UiPath/cli#5940).
|
|
21
|
+
*/
|
|
22
|
+
const HITL_APP_TYPE_VERSION = 'v2';
|
|
23
|
+
/**
|
|
24
|
+
* How an app-backed `.humanTask()` keys its `app` binding pair: `<folderPath>.<name>`,
|
|
25
|
+
* Studio Web's fallback when the task carries no tenant key (`useAddTaskInfoToBindings`),
|
|
26
|
+
* e.g. `Shared.InvoiceApproval`. The registry's own pattern, `${metadata.key}`, names the
|
|
27
|
+
* app's tenant key, which nothing offline has.
|
|
28
|
+
*/
|
|
29
|
+
const HITL_APP_RESOURCE_KEY_PATTERN = '${metadata.folderPath}.${metadata.name}';
|
|
17
30
|
/** Every {@link PlainTaskElement}, for the run-time check in `.plainTask()`. */
|
|
18
31
|
const PLAIN_TASK_ELEMENTS = new Set([
|
|
19
32
|
'bpmn:callActivity', 'bpmn:task', 'bpmn:userTask', 'bpmn:serviceTask', 'bpmn:sendTask', 'bpmn:manualTask', 'bpmn:businessRuleTask', 'bpmn:receiveTask',
|
|
@@ -1283,7 +1296,9 @@ class ScopeBuilder {
|
|
|
1283
1296
|
* right. An author who passes an `=`-expression already knows what they want and
|
|
1284
1297
|
* is left alone.
|
|
1285
1298
|
*/
|
|
1286
|
-
bindRequiredContext(id, type, context
|
|
1299
|
+
bindRequiredContext(id, type, context,
|
|
1300
|
+
/** A key pattern to use in place of the registry's, for a type whose own one names nothing an author has. */
|
|
1301
|
+
keyPattern) {
|
|
1287
1302
|
const out = { ...context };
|
|
1288
1303
|
for (const field of bindingRequiredFields(type)) {
|
|
1289
1304
|
const value = out[field.name];
|
|
@@ -1297,7 +1312,7 @@ class ScopeBuilder {
|
|
|
1297
1312
|
// (`${metadata.key}`, the live registry's pattern on a job start, whose context
|
|
1298
1313
|
// has no `key`) leaves the key to the value, as before. This snapshot carries no
|
|
1299
1314
|
// pattern for the job starts at all; `resource-key-pattern.ts` is tested on both.
|
|
1300
|
-
const keyed = this.resourceKeyFromPattern(id, type, field, context);
|
|
1315
|
+
const keyed = this.resourceKeyFromPattern(id, type, field, context, keyPattern);
|
|
1301
1316
|
this._bindingRegistry.declare({
|
|
1302
1317
|
id: bindingId,
|
|
1303
1318
|
name: field.displayName ?? field.name,
|
|
@@ -1339,8 +1354,8 @@ class ScopeBuilder {
|
|
|
1339
1354
|
* `.binding()` before this node declares with a value: that key would otherwise be
|
|
1340
1355
|
* built, so the author is told what to declare rather than given a wrong pair.
|
|
1341
1356
|
*/
|
|
1342
|
-
resourceKeyFromPattern(id, type, field, context) {
|
|
1343
|
-
const pattern = field.bindingInfo?.resourceKeyPattern;
|
|
1357
|
+
resourceKeyFromPattern(id, type, field, context, keyPattern) {
|
|
1358
|
+
const pattern = keyPattern ?? field.bindingInfo?.resourceKeyPattern;
|
|
1344
1359
|
const byId = (bindingId) => this._bindingRegistry.bindings.find((b) => b.id === bindingId);
|
|
1345
1360
|
const resolved = resolveResourceKeyPattern(pattern, context, byId);
|
|
1346
1361
|
if (resolved === undefined)
|
|
@@ -1611,9 +1626,10 @@ class ScopeBuilder {
|
|
|
1611
1626
|
* @remarks
|
|
1612
1627
|
* **Pick the variant by whether an app is named.** With no deployed Action App named,
|
|
1613
1628
|
* use `form: { fields, outcomes }` ({@link HumanTaskFormOpts}): the form travels in the
|
|
1614
|
-
* `.bpmn` and nothing on the tenant has to exist. Use `app`
|
|
1615
|
-
* only when the request names a deployed app
|
|
1616
|
-
*
|
|
1629
|
+
* `.bpmn` and nothing on the tenant has to exist. Use `app` and `folder`
|
|
1630
|
+
* ({@link HumanTaskAppOpts}) only when the request names a deployed app: the app's name
|
|
1631
|
+
* and the folder path it is deployed to. The SDK writes them as the two `app` bindings
|
|
1632
|
+
* Studio Web saves, so a deploy can point the task at another environment's app.
|
|
1617
1633
|
*
|
|
1618
1634
|
* The offline runtime can stand in for the human — `--hitl-response` injects an
|
|
1619
1635
|
* outcome — so an approval gate's branches are testable with no tenant and no
|
|
@@ -1634,9 +1650,9 @@ class ScopeBuilder {
|
|
|
1634
1650
|
* .var('outcome', 'string', { default: 'none' })
|
|
1635
1651
|
* .startEvent('start')
|
|
1636
1652
|
* .humanTask('approve', {
|
|
1637
|
-
* app: '
|
|
1653
|
+
* app: 'InvoiceApproval',
|
|
1654
|
+
* folder: 'Shared',
|
|
1638
1655
|
* title: 'Approve the invoice',
|
|
1639
|
-
* actions: ['approve', 'reject'],
|
|
1640
1656
|
* input: { amount: 100 },
|
|
1641
1657
|
* outputs: { decision: '=Action' },
|
|
1642
1658
|
* })
|
|
@@ -1688,20 +1704,30 @@ class ScopeBuilder {
|
|
|
1688
1704
|
* @returns This builder, so calls chain.
|
|
1689
1705
|
*/
|
|
1690
1706
|
humanTask(id, opts, body) {
|
|
1691
|
-
const
|
|
1692
|
-
const
|
|
1707
|
+
const given = opts;
|
|
1708
|
+
const hasApp = given.app !== undefined;
|
|
1709
|
+
const hasForm = given.form !== undefined;
|
|
1693
1710
|
if (hasApp === hasForm) {
|
|
1694
1711
|
throw new CompileRefusal('BPMN_HUMAN_TASK_APP_XOR_FORM', `humanTask "${id}": pass exactly one of app (a deployed Action App) or form ({ fields, outcomes }, an inline form that needs no app).`);
|
|
1695
1712
|
}
|
|
1713
|
+
// The v1 app task's own fields (UiPath/builder-sdk#2144). The V2 engine reads none of
|
|
1714
|
+
// them on either variant: an app's outcomes are the app's, a form's are form.outcomes.
|
|
1715
|
+
const v1Fields = ['appVersion', 'actions', 'key'].filter((k) => given[k] !== undefined);
|
|
1716
|
+
if (v1Fields.length) {
|
|
1717
|
+
throw new CompileRefusal('BPMN_HUMAN_TASK_APP_V1_FIELDS', `humanTask "${id}": ${v1Fields.join(', ')} belong to the retired v1 app task (addressed by appId), which the V2 engine never reads. ` +
|
|
1718
|
+
(hasForm
|
|
1719
|
+
? 'On an inline form, put the outcomes in form.outcomes and what the human sees in form.fields.'
|
|
1720
|
+
: 'Drop them: the app defines its own outcomes, and outputs: { decision: \'=Action\' } reads the one the human picked.'));
|
|
1721
|
+
}
|
|
1696
1722
|
if (hasForm) {
|
|
1697
1723
|
const o = opts;
|
|
1698
|
-
// The app variant's fields have no meaning on an inline form: the form IS the
|
|
1699
|
-
//
|
|
1724
|
+
// The app variant's fields have no meaning on an inline form: the form IS what the
|
|
1725
|
+
// human sees (`input`), and there is no app to look up (`folder`).
|
|
1700
1726
|
// Nor does `outputVar`: the app task's whole-response row has no source, which a
|
|
1701
|
-
// quick form never fills
|
|
1702
|
-
const appOnly = ['
|
|
1727
|
+
// quick form never fills, so there is nothing to name.
|
|
1728
|
+
const appOnly = ['folder', 'input', 'outputVar'].filter((k) => given[k] !== undefined);
|
|
1703
1729
|
if (appOnly.length) {
|
|
1704
|
-
throw new CompileRefusal('BPMN_HUMAN_TASK_APP_FIELDS_ON_FORM', `humanTask "${id}": ${appOnly.join(', ')} belong to an app-backed task. On an inline form, put
|
|
1730
|
+
throw new CompileRefusal('BPMN_HUMAN_TASK_APP_FIELDS_ON_FORM', `humanTask "${id}": ${appOnly.join(', ')} belong to an app-backed task. On an inline form, put what the human sees in form.fields` +
|
|
1705
1731
|
(appOnly.includes('outputVar')
|
|
1706
1732
|
? '; an inline form has no whole-response variable, so each answer lands in its field\'s variable and the outcome in an outputs mapping, e.g. outputs: { decision: \'=Action\' }.'
|
|
1707
1733
|
: '.'));
|
|
@@ -1727,27 +1753,36 @@ class ScopeBuilder {
|
|
|
1727
1753
|
loop: o.loop,
|
|
1728
1754
|
}, body);
|
|
1729
1755
|
}
|
|
1730
|
-
|
|
1756
|
+
const o = opts;
|
|
1757
|
+
if (typeof o.folder !== 'string' || o.folder === '') {
|
|
1758
|
+
throw new CompileRefusal('BPMN_HUMAN_TASK_APP_NO_FOLDER', `humanTask "${id}": an Action App is addressed by its name and the folder it is deployed to — pass both, e.g. ` +
|
|
1759
|
+
`{ app: 'InvoiceApproval', folder: 'Shared' } (or =bindings.<id> references to app bindings). ` +
|
|
1760
|
+
`app is the app's NAME, not its id: the V2 engine never reads an appId and fails such a task with 170000 (UiPath/builder-sdk#2144).`);
|
|
1761
|
+
}
|
|
1762
|
+
// Studio Web's app task (`useActionsProperties` / `useAddTaskInfoToBindings`): v2,
|
|
1763
|
+
// `name` and `folderPath` as `=bindings.<id>` references to a `resource="app"` pair.
|
|
1764
|
+
// The registry keys that pair `${metadata.key}`, the app's tenant key, which an author
|
|
1765
|
+
// offline does not have; Studio Web falls back to `<folderPath>.<name>` when the task
|
|
1766
|
+
// carries no key, and every app binding it saves is keyed that way.
|
|
1731
1767
|
return this.pushActivity({
|
|
1732
1768
|
kind: 'typed',
|
|
1733
1769
|
id,
|
|
1734
|
-
name:
|
|
1770
|
+
name: o.name,
|
|
1735
1771
|
type: 'Actions.HITL',
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
...(
|
|
1741
|
-
|
|
1742
|
-
},
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
loop: opts.loop,
|
|
1772
|
+
typeVersion: HITL_APP_TYPE_VERSION,
|
|
1773
|
+
context: this.bindRequiredContext(id, 'Actions.HITL', {
|
|
1774
|
+
name: o.app,
|
|
1775
|
+
folderPath: o.folder,
|
|
1776
|
+
...(o.title !== undefined ? { taskTitle: o.title } : {}),
|
|
1777
|
+
}, HITL_APP_RESOURCE_KEY_PATTERN),
|
|
1778
|
+
inputs: o.input ?? {},
|
|
1779
|
+
outputVar: o.outputVar,
|
|
1780
|
+
outputs: o.outputs,
|
|
1781
|
+
skipCondition: o.skipCondition,
|
|
1782
|
+
tags: o.tags,
|
|
1783
|
+
retry: o.retry,
|
|
1784
|
+
errorMapping: o.errorMapping,
|
|
1785
|
+
loop: o.loop,
|
|
1751
1786
|
}, body);
|
|
1752
1787
|
}
|
|
1753
1788
|
/**
|
|
@@ -2705,7 +2740,7 @@ export class PathBuilder extends ScopeBuilder {
|
|
|
2705
2740
|
* bpmn('approval')
|
|
2706
2741
|
* .var('reminded', 'string')
|
|
2707
2742
|
* .startEvent('start')
|
|
2708
|
-
* .humanTask('approve', { app: 'InvoiceApproval',
|
|
2743
|
+
* .humanTask('approve', { app: 'InvoiceApproval', folder: 'Shared' }, (t) => {
|
|
2709
2744
|
* t.onTimer('PT1H', { interrupting: false }, (b) =>
|
|
2710
2745
|
* b.task('remind', { set: { reminded: 'true' } }).endEvent('reminded'));
|
|
2711
2746
|
* t.onError((b) => b.endEvent('failed', { name: 'Approval failed' }));
|
package/dist/bpmn/check.js
CHANGED
|
@@ -81,6 +81,17 @@ const SERVICE_TYPES_REQUIRING_RESOURCE = new Set([
|
|
|
81
81
|
* "these types need a resource".
|
|
82
82
|
*/
|
|
83
83
|
const HITL_QUICK_SCHEMA_CONTEXT = new Set(['_schemaFileId', 'hitlSchemaId', '__hitlFormSchema']);
|
|
84
|
+
/**
|
|
85
|
+
* Whether an `Actions.HITL` node's context makes it a quick form: `hitlType` `quick`, or no
|
|
86
|
+
* `hitlType` of `custom` and any quick-form schema row. Studio Web's `isHitlQuickMode`, and
|
|
87
|
+
* the CLI's `isQuickFormHitl`.
|
|
88
|
+
*/
|
|
89
|
+
function isQuickFormHitl(contextView) {
|
|
90
|
+
return (contextView['hitlType'] === 'quick' ||
|
|
91
|
+
(contextView['hitlType'] !== 'custom' && Object.keys(contextView).some((k) => HITL_QUICK_SCHEMA_CONTEXT.has(k))));
|
|
92
|
+
}
|
|
93
|
+
/** The app task's binding-backed context fields, which a quick form and a v1 task do not carry. */
|
|
94
|
+
const HITL_APP_FIELDS = new Set(['name', 'folderPath']);
|
|
84
95
|
/** The bounds the platform puts on a human task's `Timer`, in MINUTES. */
|
|
85
96
|
const MIN_TASK_TIMER_MINUTES = 15;
|
|
86
97
|
const MAX_TASK_TIMER_MINUTES = 90 * 24 * 60;
|
|
@@ -1760,6 +1771,21 @@ inEventSubProcess = false) {
|
|
|
1760
1771
|
const contextView = { ...n.context };
|
|
1761
1772
|
for (const row of n.contextRows ?? [])
|
|
1762
1773
|
contextView[row.name] = row.value ?? row.body ?? '';
|
|
1774
|
+
const quickHitl = n.type === 'Actions.HITL' && isQuickFormHitl(contextView);
|
|
1775
|
+
// The app binding rule holds an `Actions.HITL` node only at `version="v2"` and only
|
|
1776
|
+
// when it is an app task, as the CLI's does (`validateBoundResource`, UiPath/cli#5940):
|
|
1777
|
+
// a quick form binds no app, and a v1 task gets HITL_APP_V1 below instead.
|
|
1778
|
+
const hitlV1App = n.type === 'Actions.HITL' && !quickHitl && (n.typeVersion ?? 'v1') !== 'v2';
|
|
1779
|
+
const hitlAppUnbound = quickHitl || hitlV1App;
|
|
1780
|
+
if (hitlV1App)
|
|
1781
|
+
diags.push({
|
|
1782
|
+
level: 'warning',
|
|
1783
|
+
code: 'HITL_APP_V1',
|
|
1784
|
+
message: `"${n.id}" (Actions.HITL) is uipath:type version "${n.typeVersion ?? 'v1'}". The V2 engine reads an app task's app only ` +
|
|
1785
|
+
`from binding-backed name and folderPath at version "v2"; it reads no appId, and fails this task with 170000. ` +
|
|
1786
|
+
`Author it as .humanTask(id, { app: '<app name>', folder: '<folder path>' }), which writes the v2 task and its app bindings.`,
|
|
1787
|
+
where: n.id,
|
|
1788
|
+
});
|
|
1763
1789
|
// A job start addressed by key (`uipath:type version="v1"`) with no `folderKey`. The
|
|
1764
1790
|
// engine's v1 branch reads `releaseKey` and `folderKey`, not `folderPath`:
|
|
1765
1791
|
// `Orchestrator.ExecuteApiWorkflowAsync` so written faults with `Could not get value
|
|
@@ -1779,7 +1805,7 @@ inEventSubProcess = false) {
|
|
|
1779
1805
|
`process by name, which the SDK emits at version="v2".`,
|
|
1780
1806
|
where: n.id,
|
|
1781
1807
|
});
|
|
1782
|
-
for (const field of bindingRequiredFields(n.type, n.spec)) {
|
|
1808
|
+
for (const field of hitlAppUnbound ? [] : bindingRequiredFields(n.type, n.spec)) {
|
|
1783
1809
|
const value = contextView[field.name];
|
|
1784
1810
|
if (typeof value === 'string' && value.startsWith('=bindings.'))
|
|
1785
1811
|
continue;
|
|
@@ -1818,20 +1844,10 @@ inEventSubProcess = false) {
|
|
|
1818
1844
|
// is a warning here too: the platform accepts the process, so an error would be
|
|
1819
1845
|
// the SDK refusing what deploys.
|
|
1820
1846
|
if (SERVICE_TYPES_REQUIRING_RESOURCE.has(n.type)) {
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
// place this rule does not mirror it. The canvas rule reads only
|
|
1826
|
-
// `releaseKey`/`name`/`queueName`, so every `Actions.HITL` node — including
|
|
1827
|
-
// every one `.humanTask()` itself produces, which writes the app as `appId` —
|
|
1828
|
-
// trips it. Warning on a shape the SDK's own wrapper emits, about a field that
|
|
1829
|
-
// is not how an Action app is addressed, is noise the author cannot act on.
|
|
1830
|
-
// Safe in this direction: the platform reports MISSING_RESOURCE at WARNING, so
|
|
1831
|
-
// staying quiet cannot turn an accepted artifact into a rejected one. The
|
|
1832
|
-
// reverse — reporting more than the platform — is what this file forbids.
|
|
1833
|
-
const resourceFields = n.type === 'Actions.HITL' ? ['releaseKey', 'name', 'queueName', 'appId'] : ['releaseKey', 'name', 'queueName'];
|
|
1834
|
-
const bound = resourceFields.some((f) => {
|
|
1847
|
+
// The canvas rule reads `releaseKey`/`name`/`queueName`. An app task names its app
|
|
1848
|
+
// in `name` since #2144; a v1 `appId` task trips this as it does on the platform,
|
|
1849
|
+
// beside HITL_APP_V1.
|
|
1850
|
+
const bound = ['releaseKey', 'name', 'queueName'].some((f) => {
|
|
1835
1851
|
const v = contextView[f];
|
|
1836
1852
|
return v !== undefined && v !== null && String(v) !== '';
|
|
1837
1853
|
});
|
|
@@ -1864,7 +1880,7 @@ inEventSubProcess = false) {
|
|
|
1864
1880
|
? managedHttpMissing(contextNames, httpRequest)
|
|
1865
1881
|
: connectorV2
|
|
1866
1882
|
? connectorV2Missing(n.type, contextNames)
|
|
1867
|
-
: missingRequiredContext(n.type, contextNames, n.spec);
|
|
1883
|
+
: missingRequiredContext(n.type, contextNames, n.spec).filter((f) => !(hitlAppUnbound && HITL_APP_FIELDS.has(f)));
|
|
1868
1884
|
// ERROR only where `uip maestro bpmn validate` holds the node to the field; a WARNING
|
|
1869
1885
|
// where only the registry calls it required. For a type whose payload the canvas
|
|
1870
1886
|
// owns (dynamic, or a discovered `Intsvc.*` type) the CLI skips the required check,
|
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
],
|
|
8
8
|
"provenance": {
|
|
9
9
|
"typeCount": 51,
|
|
10
|
-
"uipVersion": "1.205.0-preview.256"
|
|
10
|
+
"uipVersion": "1.205.0-preview.256",
|
|
11
|
+
"refreshed": {
|
|
12
|
+
"Actions.HITL": "uipath-cli@12ed25c97 bpmn-spec.json 1.1.0"
|
|
13
|
+
}
|
|
11
14
|
},
|
|
12
15
|
"types": {
|
|
13
16
|
"A2A.AgentExecution": {
|
|
@@ -89,44 +92,32 @@
|
|
|
89
92
|
"inputTarget": "bodyField",
|
|
90
93
|
"context": [
|
|
91
94
|
{
|
|
92
|
-
"name": "
|
|
93
|
-
"displayName":
|
|
94
|
-
"type": "string",
|
|
95
|
-
"required": false,
|
|
96
|
-
"hidden": true,
|
|
97
|
-
"binding": false,
|
|
98
|
-
"default": null,
|
|
99
|
-
"bindingInfo": null
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"name": "appVersion",
|
|
103
|
-
"displayName": null,
|
|
104
|
-
"type": "number",
|
|
105
|
-
"required": false,
|
|
106
|
-
"hidden": true,
|
|
107
|
-
"binding": false,
|
|
108
|
-
"default": null,
|
|
109
|
-
"bindingInfo": null
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"name": "actions",
|
|
113
|
-
"displayName": null,
|
|
95
|
+
"name": "name",
|
|
96
|
+
"displayName": "App",
|
|
114
97
|
"type": "string",
|
|
115
|
-
"required":
|
|
98
|
+
"required": true,
|
|
116
99
|
"hidden": true,
|
|
117
|
-
"binding":
|
|
100
|
+
"binding": true,
|
|
118
101
|
"default": null,
|
|
119
|
-
"bindingInfo":
|
|
102
|
+
"bindingInfo": {
|
|
103
|
+
"resource": "app",
|
|
104
|
+
"propertyAttribute": "name",
|
|
105
|
+
"resourceKeyPattern": "${metadata.key}"
|
|
106
|
+
}
|
|
120
107
|
},
|
|
121
108
|
{
|
|
122
|
-
"name": "
|
|
109
|
+
"name": "folderPath",
|
|
123
110
|
"displayName": null,
|
|
124
111
|
"type": "string",
|
|
125
|
-
"required":
|
|
112
|
+
"required": true,
|
|
126
113
|
"hidden": true,
|
|
127
|
-
"binding":
|
|
114
|
+
"binding": true,
|
|
128
115
|
"default": null,
|
|
129
|
-
"bindingInfo":
|
|
116
|
+
"bindingInfo": {
|
|
117
|
+
"resource": "app",
|
|
118
|
+
"propertyAttribute": "folderPath",
|
|
119
|
+
"resourceKeyPattern": "${metadata.key}"
|
|
120
|
+
}
|
|
130
121
|
},
|
|
131
122
|
{
|
|
132
123
|
"name": "taskTitle",
|
|
@@ -149,7 +140,7 @@
|
|
|
149
140
|
"eventDefinition": null,
|
|
150
141
|
"requiresDiscovery": true,
|
|
151
142
|
"isDynamic": true,
|
|
152
|
-
"bindingPattern": "
|
|
143
|
+
"bindingPattern": "app",
|
|
153
144
|
"placements": {
|
|
154
145
|
"Activity": {
|
|
155
146
|
"element": "bpmn:UserTask",
|
package/dist/bpmn-api.md
CHANGED
|
@@ -488,13 +488,14 @@ Options for `.humanTask()` backed by an Action App — an `Actions.HITL` action-
|
|
|
488
488
|
|
|
489
489
|
Extends `HumanTaskCommonOpts` — its fields and methods apply here too.
|
|
490
490
|
|
|
491
|
-
- `HumanTaskAppOpts.app: string` — The Action App's
|
|
491
|
+
- `HumanTaskAppOpts.app: string` — The Action App's name, e.g. `'InvoiceApproval'` — the context's `name`.
|
|
492
|
+
- `HumanTaskAppOpts.folder: string` — The Orchestrator folder path the app is deployed to, e.g. `'Shared'` or `'Finance/Invoices'` — the context's…
|
|
492
493
|
- `HumanTaskAppOpts.form?: never` — Not on this variant — see HumanTaskFormOpts.
|
|
493
|
-
- `HumanTaskAppOpts.appVersion?: number` — The app version (`appVersion`).
|
|
494
|
-
- `HumanTaskAppOpts.actions?: string[]` — The outcomes a human can pick, e.g. `['approve', 'reject']`.
|
|
495
|
-
- `HumanTaskAppOpts.key?: string` — An existing task key, when resuming rather than creating (`key`).
|
|
496
494
|
- `HumanTaskAppOpts.input?: Record<string, unknown>` — Data the task shows the human — the node's `HitlTaskArguments`.
|
|
497
495
|
- `HumanTaskAppOpts.outputVar?: string` — Variable the whole typed response lands in.
|
|
496
|
+
- `HumanTaskAppOpts.actions?: never` — Removed (#2144): a v1 `appId`-task field the V2 engine never reads.
|
|
497
|
+
- `HumanTaskAppOpts.appVersion?: never` — Removed (#2144): a v1 `appId`-task field the V2 engine never reads.
|
|
498
|
+
- `HumanTaskAppOpts.key?: never` — Removed (#2144): a v1 `appId`-task field the V2 engine never reads.
|
|
498
499
|
|
|
499
500
|
### `HumanTaskFormOpts`
|
|
500
501
|
|
|
@@ -504,6 +505,7 @@ Extends `HumanTaskCommonOpts` — its fields and methods apply here too.
|
|
|
504
505
|
|
|
505
506
|
- `HumanTaskFormOpts.form: HumanTaskForm` — The inline form: its fields and its outcomes.
|
|
506
507
|
- `HumanTaskFormOpts.app?: never` — Not on this variant — the form replaces the app.
|
|
508
|
+
- `HumanTaskFormOpts.folder?: never` — Not on this variant — there is no app to look up in a folder.
|
|
507
509
|
- `HumanTaskFormOpts.priority?: string` — Action Center priority, e.g. `'Medium'` (`priority`).
|
|
508
510
|
- `HumanTaskFormOpts.labels?: string` — Action Center labels, comma-separated (`labels`).
|
|
509
511
|
- `HumanTaskFormOpts.outputVar?: never` — Not on this variant.
|
|
@@ -101,7 +101,26 @@ export function buildConnectorInputs(rc, inputs, opts) {
|
|
|
101
101
|
const policy = { unresolvedLookups };
|
|
102
102
|
const fields = (rc.fields ?? []);
|
|
103
103
|
const byName = new Map(fields.map((f) => [f.name, f]));
|
|
104
|
-
|
|
104
|
+
// An operation whose input schema the connection resolves, with no `prepare`
|
|
105
|
+
// recorded (`inputFieldsOpen`): the field list is the tenant-agnostic subset,
|
|
106
|
+
// so an input outside it is not a mistake this side can see. It is passed
|
|
107
|
+
// through to the body, the slot an undeclared input has always meant, and
|
|
108
|
+
// `check` warns about it as CUSTOM_FIELDS_UNPREPARED with the `prepare` that
|
|
109
|
+
// records the real schema. A Data Fabric `create-entity-record` step saved by
|
|
110
|
+
// Studio Web carries the entity's columns (`Name: "Ada"`) this way.
|
|
111
|
+
//
|
|
112
|
+
// Not passed through: an input inside an array element (no flat wire name
|
|
113
|
+
// to give it), and a `lookup()` / `resource()` token (nothing records its id).
|
|
114
|
+
const passThrough = [];
|
|
115
|
+
const onUnknown = rc.inputFieldsOpen === true
|
|
116
|
+
? (path, value) => {
|
|
117
|
+
if (path.includes('[*]') || isLookupToken(value) || isResourceToken(value))
|
|
118
|
+
return false;
|
|
119
|
+
passThrough.push({ path, value });
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
: undefined;
|
|
123
|
+
const errs = validateNestedConnectorKeys(fields, inputs, byName, dialect, onUnknown);
|
|
105
124
|
/** The unresolved lookups among `errs`: when they are all of them, the refusal is LOOKUP_UNRESOLVED. */
|
|
106
125
|
const owed = [];
|
|
107
126
|
/** The unresolved resources among `errs`, each with the refusal `resolveRecordedResource` raised. */
|
|
@@ -185,6 +204,8 @@ export function buildConnectorInputs(rc, inputs, opts) {
|
|
|
185
204
|
const slot = ownEntry(SLOT_FOR_LOCATION, location) ?? 'bodyParameters';
|
|
186
205
|
routed[slot][f.name] = render(nested.value);
|
|
187
206
|
}
|
|
207
|
+
for (const { path, value } of passThrough)
|
|
208
|
+
routed.bodyParameters[path] = render(value);
|
|
188
209
|
// Inputs that are fine but for lookups `prepare` has not recorded are that one
|
|
189
210
|
// condition, LOOKUP_UNRESOLVED, with the one command that records them all.
|
|
190
211
|
if (errs.length && owed.length === errs.length) {
|
|
@@ -618,7 +639,9 @@ function buildConnectorInputTrie(fields) {
|
|
|
618
639
|
return root;
|
|
619
640
|
}
|
|
620
641
|
/** Reject nested typos with the same unknown-key message as flat keys. */
|
|
621
|
-
function validateNestedConnectorKeys(fields, inputs, exact, dialect
|
|
642
|
+
function validateNestedConnectorKeys(fields, inputs, exact, dialect,
|
|
643
|
+
/** Takes an unknown input instead of reporting it, when it returns true. */
|
|
644
|
+
onUnknown) {
|
|
622
645
|
const root = buildConnectorInputTrie(fields);
|
|
623
646
|
const errs = [];
|
|
624
647
|
const bare = new Set(bareArraySpellings(fields, exact).values());
|
|
@@ -647,6 +670,8 @@ function validateNestedConnectorKeys(fields, inputs, exact, dialect) {
|
|
|
647
670
|
const child = node.children.get(key);
|
|
648
671
|
const childPath = path ? `${path}.${key}` : key;
|
|
649
672
|
if (!child) {
|
|
673
|
+
if (onUnknown?.(childPath, childValue))
|
|
674
|
+
continue;
|
|
650
675
|
const near = nearestField(childPath, fields.map((f) => f.name));
|
|
651
676
|
errs.push(`unknown input "${childPath}"${near ? ` — did you mean "${near}"?` : ''}`);
|
|
652
677
|
}
|
|
@@ -667,6 +692,8 @@ function validateNestedConnectorKeys(fields, inputs, exact, dialect) {
|
|
|
667
692
|
continue;
|
|
668
693
|
}
|
|
669
694
|
if (!node) {
|
|
695
|
+
if (onUnknown?.(key, value))
|
|
696
|
+
continue;
|
|
670
697
|
const near = nearestField(key, [...exact.keys()]);
|
|
671
698
|
errs.push(`unknown input "${key}"${near ? ` — did you mean "${near}"?` : ''}`);
|
|
672
699
|
}
|
package/dist/core/library.d.ts
CHANGED
|
@@ -74,7 +74,36 @@ export interface ResolvedConnector {
|
|
|
74
74
|
source: string;
|
|
75
75
|
tier: string;
|
|
76
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* True when `fields` is not the operation's whole input set: the operation
|
|
79
|
+
* resolves its real input schema from the connection, and no `registry
|
|
80
|
+
* prepare` has recorded it here. See {@link inputSchemaFromConnection}.
|
|
81
|
+
*
|
|
82
|
+
* Data Fabric `create-entity-record` is the case: the library lists
|
|
83
|
+
* `entityName` and `expansionLevel`, and the entity's own columns (`Name`,
|
|
84
|
+
* `Email`, …) exist only on the tenant. Studio Web saves those columns as body
|
|
85
|
+
* parameters, so a saved step carries inputs the library has never heard of.
|
|
86
|
+
* `buildConnectorInputs` passes such an input through to the body instead of
|
|
87
|
+
* refusing it as `unknown input`; `check` warns about it as
|
|
88
|
+
* CUSTOM_FIELDS_UNPREPARED, with the `prepare` that records the real schema.
|
|
89
|
+
* A prepared operation leaves this unset, so its inputs are checked strictly.
|
|
90
|
+
*/
|
|
91
|
+
inputFieldsOpen?: true;
|
|
77
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether a library entry's INPUT field list is resolved from the connection at
|
|
95
|
+
* design time: the operation needs a connection for its schema
|
|
96
|
+
* (`runtime.requiresConnectionForSchema`) and its schema action replaces the
|
|
97
|
+
* input half (`operation.schemaAction.replaces` is `input` or `both`).
|
|
98
|
+
*
|
|
99
|
+
* Both halves matter. `requiresConnectionForSchema` alone is set on every
|
|
100
|
+
* operation of a connector with field discovery (Slack's `send-message`
|
|
101
|
+
* included), whose static field list is complete; and an action that replaces
|
|
102
|
+
* only the `output` leaves the input list authoritative. In the library of
|
|
103
|
+
* #2053, 41 of 1,739 operations pass this test, all of them `Curated`
|
|
104
|
+
* (Data Fabric's record operations, Jira `create-issue`, Smartsheet `add-row`, …).
|
|
105
|
+
*/
|
|
106
|
+
export declare function inputSchemaFromConnection(entry: unknown): boolean;
|
|
78
107
|
/**
|
|
79
108
|
* Where a connector input rides on the wire.
|
|
80
109
|
*
|
|
@@ -552,6 +581,12 @@ export declare class Library {
|
|
|
552
581
|
* of the entries each layer resolves are UNIONED: the overlay can ADD fields
|
|
553
582
|
* but never drop ones the baked library already exposed (C4).
|
|
554
583
|
*/
|
|
584
|
+
/**
|
|
585
|
+
* Whether the connection-scoped overlay carries a `prepare` row for this
|
|
586
|
+
* operation. A row fetched through `uip` has no connection behind it, so it
|
|
587
|
+
* does not count (the same rule as {@link schemaReadiness}).
|
|
588
|
+
*/
|
|
589
|
+
private preparedInOverlay;
|
|
555
590
|
private resolveType;
|
|
556
591
|
/**
|
|
557
592
|
* Turn a lookup miss into something actionable: which operations this connector
|