@uipath/packager-tool-bpmn 1.200.0-preview.109 → 1.201.0-preview.115

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.
Files changed (2) hide show
  1. package/dist/index.js +208 -36
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -406,20 +406,24 @@ var bpmn_spec_default = {
406
406
  extensionTag: "uipath:activity",
407
407
  contextFields: [
408
408
  {
409
- name: "activity",
410
- displayName: "Activity",
409
+ name: "activityConfigurationVersion",
410
+ displayName: "Activity configuration version",
411
411
  type: "string",
412
- required: true,
413
- hidden: false,
414
- isPrimaryKey: true,
412
+ required: false,
413
+ hidden: true,
414
+ isPrimaryKey: false,
415
415
  binding: false,
416
- defaultValue: null
416
+ defaultValue: "v1",
417
+ enum: [
418
+ "v1"
419
+ ],
420
+ description: "Marks the Integration Service activity format used by this template"
417
421
  },
418
422
  {
419
423
  name: "connectorKey",
420
424
  displayName: "Connector key",
421
425
  type: "string",
422
- required: false,
426
+ required: true,
423
427
  hidden: true,
424
428
  isPrimaryKey: false,
425
429
  binding: false,
@@ -433,7 +437,12 @@ var bpmn_spec_default = {
433
437
  hidden: true,
434
438
  isPrimaryKey: false,
435
439
  binding: true,
436
- defaultValue: null
440
+ defaultValue: null,
441
+ bindingInfo: {
442
+ resource: "Connection",
443
+ resourceKeyPattern: "${resourceKey}",
444
+ propertyAttribute: "ConnectionId"
445
+ }
437
446
  },
438
447
  {
439
448
  name: "folderKey",
@@ -442,61 +451,105 @@ var bpmn_spec_default = {
442
451
  required: false,
443
452
  hidden: true,
444
453
  isPrimaryKey: false,
454
+ binding: true,
455
+ defaultValue: null,
456
+ bindingInfo: {
457
+ resource: "Connection",
458
+ resourceKeyPattern: "${resourceKey}",
459
+ propertyAttribute: "folderKey"
460
+ }
461
+ },
462
+ {
463
+ name: "operation",
464
+ displayName: "Operation",
465
+ type: "string",
466
+ required: true,
467
+ hidden: true,
468
+ isPrimaryKey: true,
445
469
  binding: false,
446
- defaultValue: null
470
+ defaultValue: null,
471
+ description: "Activity catalog Name used as the runtime operation"
472
+ },
473
+ {
474
+ name: "objectName",
475
+ displayName: "Object name",
476
+ type: "string",
477
+ required: true,
478
+ hidden: true,
479
+ isPrimaryKey: false,
480
+ binding: false,
481
+ defaultValue: null,
482
+ description: "Activity catalog ObjectName"
447
483
  },
448
484
  {
449
485
  name: "method",
450
486
  displayName: "Method",
451
487
  type: "string",
452
- required: false,
488
+ required: true,
453
489
  hidden: true,
454
490
  isPrimaryKey: false,
455
491
  binding: false,
456
- defaultValue: null
492
+ defaultValue: null,
493
+ description: "Activity catalog MethodName"
457
494
  },
458
495
  {
459
496
  name: "path",
460
497
  displayName: "Path",
461
498
  type: "string",
499
+ required: true,
500
+ hidden: true,
501
+ isPrimaryKey: false,
502
+ binding: false,
503
+ defaultValue: null,
504
+ description: "Request path returned by resource metadata"
505
+ },
506
+ {
507
+ name: "metadata",
508
+ displayName: "Metadata",
509
+ type: "json",
462
510
  required: false,
463
511
  hidden: true,
464
512
  isPrimaryKey: false,
465
513
  binding: false,
466
- defaultValue: null
514
+ defaultValue: {},
515
+ description: "Optional activity metadata"
467
516
  }
468
517
  ],
518
+ inputFields: [],
469
519
  inputPattern: "separateInputs",
470
520
  inputName: "body",
471
521
  inputTarget: "body",
472
- outputSource: ".",
473
- outputType: "custom",
474
- outputName: "result",
522
+ outputSource: "=response",
523
+ outputType: "jsonSchema",
524
+ outputName: "response",
475
525
  useRelativeSource: false,
476
526
  bindingPattern: "connection",
477
527
  requiresDiscovery: true,
478
528
  isDynamic: true,
479
- xmlTemplate: `<bpmn:SendTask id="{id}" name="{name}">
529
+ xmlTemplate: `<bpmn:sendTask id="{id}" name="{name}">
480
530
  <bpmn:extensionElements>
481
531
  <uipath:activity version="v1">
482
532
  <uipath:type value="Intsvc.ActivityExecution" version="v1" />
483
533
  <uipath:context>
484
- <uipath:input name="activity" value="{activity}" />
485
- <uipath:input name="connectorKey" value="{connectorKey}" />
486
- <uipath:input name="connection" value="=bindings.{bindingId}" />
487
- <uipath:input name="folderKey" value="{folderKey}" />
488
- <uipath:input name="method" value="{method}" />
489
- <uipath:input name="path" value="{path}" />
534
+ <uipath:input name="connectorKey" type="string" value="{connectorKey}" />
535
+ <uipath:input name="connection" type="string" value="=bindings.{connectionBindingId}" />
536
+ <uipath:input name="folderKey" type="string" value="=bindings.{folderBindingId}" />
537
+ <uipath:input name="operation" type="string" value="{operation}" />
538
+ <uipath:input name="objectName" type="string" value="{objectName}" />
539
+ <uipath:input name="method" type="string" value="{method}" />
540
+ <uipath:input name="path" type="string" value="{path}" />
541
+ <uipath:input name="activityConfigurationVersion" type="string" value="v1" />
542
+ <uipath:input name="metadata" type="json"><![CDATA[{}]]></uipath:input>
490
543
  </uipath:context>
491
- <uipath:input name="body" type="json" target="body"><![CDATA[{}]]></uipath:input>
492
- <uipath:output name="result" type="custom" source="." var="{varId}" />
544
+ <uipath:output name="response" type="jsonSchema" source="=response" var="{varId}" />
493
545
  </uipath:activity>
494
546
  </bpmn:extensionElements>
495
547
  <bpmn:incoming>{incomingEdge}</bpmn:incoming>
496
548
  <bpmn:outgoing>{outgoingEdge}</bpmn:outgoing>
497
- </bpmn:SendTask>`,
498
- discoveryNotes: "Uses getConnectorConnections(connectorKey) to list available connections. Activity/connector metadata comes from Integration Service catalog.",
499
- inputNotes: "isSplitInputs=false in design schema; inputs are sent as separate <uipath:input> elements, not merged into a single JSON body",
549
+ </bpmn:sendTask>`,
550
+ discoveryNotes: "Use `uip is activities list <connector-key> --output json` to select an activity. Set operation from Name, then describe ObjectName to get its current path, parameters, and fields.",
551
+ inputNotes: "Add each request field from the selected operation as its own uipath:input. Keep the field's type and target: path, query, body, or file.",
552
+ contextFieldNotes: "connection points to a root binding for a Connection resource. When folder scoping is required, folderKey points to a second binding for the same resourceKey. Use propertyAttribute ConnectionId for connection and folderKey for folderKey. Omit folderKey when the selected activity has no folder scoping, and omit both fields only when it does not use a connection.",
500
553
  extensionTagNotes: "In isExecution array, NOT in isEvents array, so uses uipath:activity"
501
554
  },
502
555
  "Intsvc.HttpExecution": {
@@ -2961,6 +3014,8 @@ function isGuid(value) {
2961
3014
  var KNOWN_UIPATH_TAGS = new Set(SUPPORTED_UIPATH_EXTENSION_TAGS);
2962
3015
  var SEMANTIC_VALIDATION_ERROR = "BPMN_VALIDATION_ERROR";
2963
3016
  var BPMN_MODEL_NAMESPACE = "http://www.omg.org/spec/BPMN/20100524/MODEL";
3017
+ var ACTIVITY_CONFIGURATION_VERSION = "activityConfigurationVersion";
3018
+ var ACTIVITY_CONFIGURATION_V1 = "v1";
2964
3019
 
2965
3020
  class BpmnValidateService {
2966
3021
  fileSystem;
@@ -3101,12 +3156,25 @@ class BpmnValidateService {
3101
3156
  });
3102
3157
  }
3103
3158
  }
3159
+ for (const loopCharacteristics of uipathNodes.filter((node) => node.name === "uipath:loopCharacteristics")) {
3160
+ const extensionElements = loopCharacteristics.parent;
3161
+ const owner = extensionElements && hasLocalName(extensionElements, "extensionElements") ? extensionElements.parent : undefined;
3162
+ if (owner && hasLocalName(owner, "multiInstanceLoopCharacteristics")) {
3163
+ continue;
3164
+ }
3165
+ diagnostics.push({
3166
+ file,
3167
+ element: describeElement(loopCharacteristics),
3168
+ message: "uipath:loopCharacteristics must be nested under bpmn:multiInstanceLoopCharacteristics.",
3169
+ instruction: "Move it into bpmn:multiInstanceLoopCharacteristics/bpmn:extensionElements and remove any copy from the activity's extensionElements."
3170
+ });
3171
+ }
3104
3172
  const payloads = uipathNodes.filter((node) => ["uipath:activity", "uipath:event", "uipath:mapping"].includes(node.name));
3105
3173
  for (const payload of payloads) {
3106
- this.validatePayload(file, payload, bindings, diagnostics);
3174
+ this.validatePayload(file, payload, bindings, getOwningProcessActivityConfigurationVersion(payload), diagnostics);
3107
3175
  }
3108
3176
  }
3109
- validatePayload(file, payload, bindings, diagnostics) {
3177
+ validatePayload(file, payload, bindings, workflowActivityConfigurationVersion, diagnostics) {
3110
3178
  const owner = findBpmnOwner(payload);
3111
3179
  if (!owner) {
3112
3180
  diagnostics.push({
@@ -3168,7 +3236,11 @@ class BpmnValidateService {
3168
3236
  return;
3169
3237
  }
3170
3238
  this.validateContractPlacement(file, payload, owner, contract, diagnostics);
3171
- this.validateContext(file, payload, owner, contract, diagnostics);
3239
+ const isActivityExecutionV1 = extensionType === "Intsvc.ActivityExecution" && isIntsvcActivityExecutionV1(getContextInputs(payload).find((input) => input.attributes.name === ACTIVITY_CONFIGURATION_VERSION)?.attributes.value, workflowActivityConfigurationVersion);
3240
+ this.validateContext(file, payload, owner, contract, isActivityExecutionV1, diagnostics);
3241
+ if (isActivityExecutionV1) {
3242
+ this.validateActivityExecutionV1Bindings(file, payload, owner, bindings, diagnostics);
3243
+ }
3172
3244
  if (contract.extensionType === "Orchestrator.StartAgentJob") {
3173
3245
  this.validateStartAgentJobBindings(file, payload, owner, bindings, diagnostics);
3174
3246
  }
@@ -3195,24 +3267,33 @@ class BpmnValidateService {
3195
3267
  });
3196
3268
  }
3197
3269
  }
3198
- validateContext(file, payload, owner, contract, diagnostics) {
3199
- const contexts = childElements(payload, "uipath:context");
3200
- const contextInputs = contexts.flatMap((context) => childElements(context, "uipath:input"));
3270
+ validateContext(file, payload, owner, contract, isActivityExecutionV1, diagnostics) {
3271
+ const contextInputs = getContextInputs(payload);
3201
3272
  const actual = new Map(contextInputs.map((input) => [input.attributes.name, input]));
3202
3273
  const fields = contract.contextFields ?? [];
3203
3274
  const allowDynamicPayloadShape = usesCanvasOwnedDynamicPayload(contract);
3204
3275
  const allowed = new Set(fields.map((field) => field.name));
3276
+ const requireDeclaredFields = !allowDynamicPayloadShape || isActivityExecutionV1;
3277
+ const contractLabel = isActivityExecutionV1 ? "Integration Service activity" : contract.extensionType;
3205
3278
  for (const field of fields) {
3206
3279
  const input = actual.get(field.name);
3207
- if (!allowDynamicPayloadShape && field.required && !hasAttributeValue(input, "value")) {
3280
+ if (requireDeclaredFields && field.required && !hasAttributeValue(input, "value")) {
3208
3281
  diagnostics.push({
3209
3282
  file,
3210
3283
  element: describeElement(owner),
3211
- message: `${contract.extensionType} is missing required context input "${field.name}".`,
3284
+ message: `${contractLabel} is missing required context input "${field.name}".`,
3212
3285
  instruction: `Add <uipath:input name="${field.name}" value="..." /> inside uipath:context.`
3213
3286
  });
3214
3287
  }
3215
3288
  if (input) {
3289
+ if (isActivityExecutionV1 && field.type === "string" && input.attributes.type !== "string") {
3290
+ diagnostics.push({
3291
+ file,
3292
+ element: describeElement(input),
3293
+ message: `${contractLabel} context input "${field.name}" must use type="string".`,
3294
+ instruction: 'Add type="string" to this context input.'
3295
+ });
3296
+ }
3216
3297
  validateTypedValue(file, input, field.type, input.attributes.value, `context input "${field.name}"`, diagnostics);
3217
3298
  }
3218
3299
  }
@@ -3235,6 +3316,77 @@ class BpmnValidateService {
3235
3316
  }
3236
3317
  }
3237
3318
  }
3319
+ validateActivityExecutionV1Bindings(file, payload, owner, bindings, diagnostics) {
3320
+ const contextByName = new Map(getContextInputs(payload).map((input) => [
3321
+ input.attributes.name,
3322
+ input
3323
+ ]));
3324
+ const bindingFields = [
3325
+ {
3326
+ contextName: "connection",
3327
+ propertyAttribute: "ConnectionId"
3328
+ },
3329
+ {
3330
+ contextName: "folderKey",
3331
+ propertyAttribute: "folderKey"
3332
+ }
3333
+ ];
3334
+ const resourceKeys = new Map;
3335
+ for (const field of bindingFields) {
3336
+ const contextInput = contextByName.get(field.contextName);
3337
+ if (!contextInput) {
3338
+ continue;
3339
+ }
3340
+ const value = contextInput.attributes.value?.trim() ?? "";
3341
+ if (!value) {
3342
+ continue;
3343
+ }
3344
+ if (!value.startsWith("=bindings.")) {
3345
+ diagnostics.push({
3346
+ file,
3347
+ element: describeElement(owner),
3348
+ message: `Integration Service activity context input "${field.contextName}" must reference a root binding.`,
3349
+ instruction: `Set ${field.contextName} to =bindings.<bindingId> and declare that binding with resource="Connection" and propertyAttribute="${field.propertyAttribute}".`
3350
+ });
3351
+ continue;
3352
+ }
3353
+ const bindingId = value.slice("=bindings.".length);
3354
+ const binding = bindings.get(bindingId);
3355
+ if (!binding) {
3356
+ continue;
3357
+ }
3358
+ const hasInvalidBindingShape = binding.resource !== "Connection" || binding.propertyAttribute !== field.propertyAttribute;
3359
+ if (hasInvalidBindingShape) {
3360
+ diagnostics.push({
3361
+ file,
3362
+ element: describeElement(owner),
3363
+ message: `Integration Service activity ${field.contextName} binding "${bindingId}" must use resource="Connection" and propertyAttribute="${field.propertyAttribute}".`,
3364
+ instruction: `Set resource="Connection" and propertyAttribute="${field.propertyAttribute}" on that binding.`
3365
+ });
3366
+ }
3367
+ const resourceKey = binding.resourceKey?.trim();
3368
+ if (!resourceKey) {
3369
+ diagnostics.push({
3370
+ file,
3371
+ element: describeElement(owner),
3372
+ message: `Integration Service activity ${field.contextName} binding "${bindingId}" is missing resourceKey.`,
3373
+ instruction: "Set resourceKey on that root binding."
3374
+ });
3375
+ } else if (!hasInvalidBindingShape) {
3376
+ resourceKeys.set(field.contextName, resourceKey);
3377
+ }
3378
+ }
3379
+ const connectionResourceKey = resourceKeys.get("connection");
3380
+ const folderResourceKey = resourceKeys.get("folderKey");
3381
+ if (connectionResourceKey && folderResourceKey && connectionResourceKey !== folderResourceKey) {
3382
+ diagnostics.push({
3383
+ file,
3384
+ element: describeElement(owner),
3385
+ message: "Integration Service activity connection and folder bindings refer to different connection resources.",
3386
+ instruction: "Set the same resourceKey on both root bindings."
3387
+ });
3388
+ }
3389
+ }
3238
3390
  validateInputs(file, payload, owner, contract, diagnostics) {
3239
3391
  const directInputs = childElements(payload, "uipath:input");
3240
3392
  const actual = new Map(directInputs.map((input) => [input.attributes.name, input]));
@@ -3683,6 +3835,24 @@ function findBpmnOwner(payload) {
3683
3835
  }
3684
3836
  return;
3685
3837
  }
3838
+ function getContextInputs(payload) {
3839
+ return childElements(payload, "uipath:context").flatMap((context) => childElements(context, "uipath:input"));
3840
+ }
3841
+ function isIntsvcActivityExecutionV1(nodeVersion, workflowVersion) {
3842
+ const version = nodeVersion ?? workflowVersion;
3843
+ return version === undefined || version === ACTIVITY_CONFIGURATION_V1;
3844
+ }
3845
+ function getOwningProcessActivityConfigurationVersion(payload) {
3846
+ let current = payload.parent;
3847
+ while (current && !hasLocalName(current, "process")) {
3848
+ current = current.parent;
3849
+ }
3850
+ if (!current) {
3851
+ return;
3852
+ }
3853
+ const extensionElements = findChildren(current, (node) => hasLocalName(node, "extensionElements"));
3854
+ return extensionElements.flatMap((node) => childElements(node, "uipath:intsvcActivityConfig")).at(0)?.attributes.version;
3855
+ }
3686
3856
  function describeElement(node) {
3687
3857
  const id = node.attributes.id ? `#${node.attributes.id}` : "";
3688
3858
  const name = node.attributes.name ? ` "${node.attributes.name}"` : "";
@@ -3804,6 +3974,7 @@ function collectInlineBindings(root, bindings) {
3804
3974
  bindings.set(id, {
3805
3975
  id,
3806
3976
  resource: binding.attributes.resource,
3977
+ resourceKey: binding.attributes.resourceKey,
3807
3978
  resourceSubType: binding.attributes.resourceSubType,
3808
3979
  propertyAttribute: binding.attributes.propertyAttribute
3809
3980
  });
@@ -3829,6 +4000,7 @@ function collectBindingRecords(value, bindings) {
3829
4000
  bindings.set(id, {
3830
4001
  id,
3831
4002
  resource: getStringField(value, "resource"),
4003
+ resourceKey: getStringField(value, "resourceKey"),
3832
4004
  resourceSubType: getStringField(value, "resourceSubType"),
3833
4005
  propertyAttribute: getStringField(value, "propertyAttribute")
3834
4006
  });
@@ -4033,4 +4205,4 @@ export {
4033
4205
  BpmnToolFactory
4034
4206
  };
4035
4207
 
4036
- //# debugId=5BF054B517D10FFA64756E2164756E21
4208
+ //# debugId=4F82779C7061602064756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/packager-tool-bpmn",
3
- "version": "1.200.0-preview.109",
3
+ "version": "1.201.0-preview.115",
4
4
  "description": "UiPath ProcessOrchestration (BPMN) tool implementation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,10 +25,10 @@
25
25
  "author": "",
26
26
  "license": "ISC",
27
27
  "peerDependencies": {
28
- "@uipath/solutionpackager-tool-core": "1.200.0"
28
+ "@uipath/solutionpackager-tool-core": "1.201.0"
29
29
  },
30
30
  "dependencies": {
31
- "@uipath/maestro-sdk": "1.200.0"
31
+ "@uipath/maestro-sdk": "1.201.0"
32
32
  },
33
- "gitHead": "fcc01cdae81bbd0c25d3d4fc287537a9d19d99f4"
33
+ "gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
34
34
  }