@salesforce/plugin-omnistudio-migration-tool 2.0.0-preview.27 → 2.0.0-preview.28

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.
@@ -329,7 +329,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
329
329
  }
330
330
  }
331
331
  // Check for Integration Procedure Action dependencies
332
- if (type === 'Integration Procedure Action') {
332
+ if (type === stringContants_1.Constants.IntegrationProcedureAction) {
333
333
  const nameVal = `${elemName}`;
334
334
  dependencyIP.push({ name: propertySet['integrationProcedureKey'], location: nameVal });
335
335
  if (!existingOmniscriptNames.has(nameVal) && !existingFlexCardNames.has(nameVal)) {
@@ -338,10 +338,10 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
338
338
  }
339
339
  // Check for DataRaptor dependencies
340
340
  if ([
341
- 'DataRaptor Extract Action',
342
- 'DataRaptor Turbo Action',
343
- 'DataRaptor Transform Action',
344
- 'DataRaptor Post Action',
341
+ stringContants_1.Constants.DataRaptorExtractAction,
342
+ stringContants_1.Constants.DataRaptorTurboAction,
343
+ stringContants_1.Constants.DataRaptorTransformAction,
344
+ stringContants_1.Constants.DataRaptorPostAction,
345
345
  ].includes(type)) {
346
346
  const nameVal = `${elemName}`;
347
347
  dependencyDR.push({ name: propertySet['bundle'], location: nameVal });
@@ -349,7 +349,18 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
349
349
  missingDR.push(nameVal);
350
350
  }
351
351
  }
352
- if (type === 'Remote Action') {
352
+ // Check for DataRaptor transform bundle dependencies in various action types
353
+ // These bundles are used for pre/post transformation in HTTP, Remote, Decision Matrix, Expression Set, PDF, and Step actions
354
+ this.collectTransformBundleDependencies(propertySet, elemName, dependencyDR, existingDataRaptorNames, missingDR);
355
+ // Check for DocuSign Envelope Action transform bundle dependencies
356
+ if (type === stringContants_1.Constants.DocuSignEnvelopeAction) {
357
+ this.collectDocuSignBundleDependencies(propertySet, elemName, dependencyDR, existingDataRaptorNames, missingDR);
358
+ }
359
+ // Check for DocuSign Signature Action transform bundle dependencies
360
+ if (type === stringContants_1.Constants.DocuSignSignatureAction) {
361
+ this.collectDocuSignSignatureBundleDependencies(propertySet, elemName, dependencyDR, existingDataRaptorNames, missingDR);
362
+ }
363
+ if (type === stringContants_1.Constants.RemoteAction) {
353
364
  const nameVal = `${elemName}`;
354
365
  const className = propertySet['remoteClass'];
355
366
  const methodName = propertySet['remoteMethod'];
@@ -361,7 +372,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
361
372
  const nameVal = `${elemName}`;
362
373
  dependenciesRA.push({ name: propertySet['optionSource']['source'], location: nameVal });
363
374
  }
364
- if (type === 'Custom Lightning Web Component') {
375
+ if (type === stringContants_1.Constants.CustomLightningWebComponent) {
365
376
  const nameVal = `${elemName}`;
366
377
  const lwcName = propertySet['lwcName'];
367
378
  dependenciesLWC.push({ name: lwcName, location: nameVal });
@@ -373,6 +384,8 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
373
384
  dependenciesLWC.push({ name: lwcName, location: nameVal });
374
385
  }
375
386
  }
387
+ // Collect persistent component bundle dependencies from OmniProcess PropertySetConfig
388
+ this.collectPersistentComponentBundleDependencies(omniscript, dependencyDR, existingDataRaptorNames, missingDR);
376
389
  const omniProcessType = omniscript[this.getFieldKey('IsProcedure__c')] ? 'Integration Procedure' : 'OmniScript';
377
390
  const existingType = omniscript[this.getFieldKey('Type__c')];
378
391
  const existingTypeVal = new stringval_1.StringVal(existingType, 'type');
@@ -510,23 +523,34 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
510
523
  assessmentStatus = 'Needs manual intervention';
511
524
  }
512
525
  }
526
+ // Deduplicate all dependency arrays to ensure no duplicates
527
+ // For Remote Actions and LWCs, deduplicate by name property
528
+ const uniqueRA = Array.from(new Map(dependenciesRA.map((item) => [item.name, item])).values());
529
+ const uniqueLWC = Array.from(new Map(dependenciesLWC.map((item) => [item.name, item])).values());
530
+ const uniqueIP = Array.from(new Map(dependencyIP.map((item) => [item.name, item])).values());
531
+ const uniqueDR = Array.from(new Map(dependencyDR.map((item) => [item.name, item])).values());
532
+ const uniqueOS = Array.from(new Map(dependencyOS.map((item) => [item.name, item])).values());
533
+ // Deduplicate missing dependency arrays (simple string arrays)
534
+ const uniqueMissingDR = [...new Set(missingDR)];
535
+ const uniqueMissingIP = [...new Set(missingIP)];
536
+ const uniqueMissingOS = [...new Set(missingOS)];
513
537
  const result = {
514
538
  name: recordName,
515
539
  id: omniscript['Id'],
516
540
  oldName: oldName,
517
- dependenciesIP: dependencyIP,
518
- dependenciesDR: dependencyDR,
519
- dependenciesOS: dependencyOS,
520
- dependenciesRemoteAction: dependenciesRA,
521
- dependenciesLWC: dependenciesLWC,
541
+ dependenciesIP: uniqueIP,
542
+ dependenciesDR: uniqueDR,
543
+ dependenciesOS: uniqueOS,
544
+ dependenciesRemoteAction: uniqueRA,
545
+ dependenciesLWC: uniqueLWC,
522
546
  infos: [],
523
547
  warnings: warnings,
524
548
  errors: [],
525
549
  migrationStatus: assessmentStatus,
526
550
  type: omniProcessType,
527
- missingDR: missingDR,
528
- missingIP: missingIP,
529
- missingOS: missingOS,
551
+ missingDR: uniqueMissingDR,
552
+ missingIP: uniqueMissingIP,
553
+ missingOS: uniqueMissingOS,
530
554
  };
531
555
  if (omniProcessType === this.OMNISCRIPT) {
532
556
  const nameMapping = {
@@ -1362,6 +1386,18 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1362
1386
  mappedObject = { ...omniScriptRecord };
1363
1387
  }
1364
1388
  mappedObject['Name'] = this.cleanName(mappedObject['Name']);
1389
+ // Process PropertySetConfig to update persistentComponent transform bundle references
1390
+ const propertySetConfig = mappedObject[OmniScript_1.default.PropertySet__c];
1391
+ if (propertySetConfig) {
1392
+ try {
1393
+ const parsedConfig = JSON.parse(propertySetConfig);
1394
+ this.processPersistentComponents(parsedConfig);
1395
+ mappedObject[OmniScript_1.default.PropertySet__c] = JSON.stringify(parsedConfig);
1396
+ }
1397
+ catch (ex) {
1398
+ logger_1.Logger.error(`Failed to parse PropertySetConfig for OmniScript: ${mappedObject['Name']}`);
1399
+ }
1400
+ }
1365
1401
  // BATCH framework requires that each record has an "attributes" property
1366
1402
  mappedObject['attributes'] = {
1367
1403
  type: OmniScriptMigrationTool.OMNIPROCESS_NAME,
@@ -1369,9 +1405,40 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1369
1405
  };
1370
1406
  return mappedObject;
1371
1407
  }
1408
+ /**
1409
+ * Processes persistentComponent array in OmniProcess PropertySetConfig to update transform bundle references
1410
+ * Handles: persistentComponent[].remoteOptions.preTransformBundle, persistentComponent[].remoteOptions.postTransformBundle,
1411
+ * persistentComponent[].preTransformBundle, persistentComponent[].postTransformBundle
1412
+ * @param propertySetConfig The parsed PropertySetConfig object
1413
+ */
1414
+ processPersistentComponents(propertySetConfig) {
1415
+ if (!propertySetConfig || !Array.isArray(propertySetConfig.persistentComponent)) {
1416
+ return;
1417
+ }
1418
+ propertySetConfig.persistentComponent.forEach((component) => {
1419
+ if (!component) {
1420
+ return;
1421
+ }
1422
+ // Handle remoteOptions pre/post transform bundles
1423
+ if (component.remoteOptions) {
1424
+ if (component.remoteOptions.preTransformBundle) {
1425
+ component.remoteOptions.preTransformBundle = this.cleanBundleName(component.remoteOptions.preTransformBundle);
1426
+ }
1427
+ if (component.remoteOptions.postTransformBundle) {
1428
+ component.remoteOptions.postTransformBundle = this.cleanBundleName(component.remoteOptions.postTransformBundle);
1429
+ }
1430
+ }
1431
+ // Handle direct pre/post transform bundles
1432
+ if (component.preTransformBundle) {
1433
+ component.preTransformBundle = this.cleanBundleName(component.preTransformBundle);
1434
+ }
1435
+ if (component.postTransformBundle) {
1436
+ component.postTransformBundle = this.cleanBundleName(component.postTransformBundle);
1437
+ }
1438
+ });
1439
+ }
1372
1440
  // Maps an individual Element into an OmniProcessElement record
1373
1441
  mapElementData(elementRecord, omniProcessId, parentElementUploadResponse, invalidIpReferences) {
1374
- var _a, _b;
1375
1442
  // Transformed object
1376
1443
  let mappedObject = {};
1377
1444
  if (!this.IS_STANDARD_DATA_MODEL) {
@@ -1397,128 +1464,9 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1397
1464
  // We need to fix the child references
1398
1465
  const elementType = mappedObject[Element_1.default.Type__c];
1399
1466
  const propertySet = JSON.parse(mappedObject[Element_1.default.PropertySet__c] || '{}');
1400
- // Use NameMappingRegistry to update all dependency references
1401
- const updatedPropertySet = this.nameRegistry.updateDependencyReferences(propertySet);
1402
- switch (elementType) {
1403
- case 'OmniScript':
1404
- // Use registry for OmniScript references with explicit fallback
1405
- const osType = propertySet['Type'] || '';
1406
- const osSubType = propertySet['Sub Type'] || '';
1407
- const osLanguage = propertySet['Language'] || 'English';
1408
- // Construct full OmniScript name to check registry
1409
- const fullOmniScriptName = `${osType}_${osSubType}_${osLanguage}`;
1410
- if (this.nameRegistry.isAngularOmniScript(fullOmniScriptName)) {
1411
- // Referenced OmniScript is Angular - add warning and keep original reference
1412
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('angularOmniScriptDependencyWarning', [
1413
- 'OmniScript element',
1414
- fullOmniScriptName,
1415
- ])}`);
1416
- // Keep original reference as-is since Angular OmniScript won't be migrated
1417
- updatedPropertySet['Type'] = osType;
1418
- updatedPropertySet['Sub Type'] = osSubType;
1419
- updatedPropertySet['Language'] = osLanguage;
1420
- }
1421
- else if (this.nameRegistry.hasOmniScriptMapping(fullOmniScriptName)) {
1422
- // Registry has mapping for this LWC OmniScript - extract cleaned parts
1423
- const cleanedFullName = this.nameRegistry.getCleanedName(fullOmniScriptName, 'OmniScript');
1424
- const parts = cleanedFullName.split('_');
1425
- if (parts.length >= 2) {
1426
- updatedPropertySet['Type'] = parts[0];
1427
- updatedPropertySet['Sub Type'] = parts[1];
1428
- // Language doesn't typically change, but update if provided
1429
- if (parts.length >= 3) {
1430
- updatedPropertySet['Language'] = parts[2];
1431
- }
1432
- }
1433
- }
1434
- else {
1435
- // No registry mapping - use original fallback approach
1436
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['OmniScript', fullOmniScriptName])}`);
1437
- updatedPropertySet['Type'] = this.cleanName(osType);
1438
- updatedPropertySet['Sub Type'] = this.cleanName(osSubType);
1439
- }
1440
- break;
1441
- case 'Integration Procedure Action':
1442
- const remoteOptions = updatedPropertySet['remoteOptions'] || {};
1443
- // Use registry for DataMapper references with explicit fallback
1444
- const preTransformBundle = (_a = propertySet['remoteOptions']) === null || _a === void 0 ? void 0 : _a['preTransformBundle'];
1445
- if (preTransformBundle) {
1446
- if (this.nameRegistry.hasDataMapperMapping(preTransformBundle)) {
1447
- remoteOptions['preTransformBundle'] = this.nameRegistry.getDataMapperCleanedName(preTransformBundle);
1448
- }
1449
- else {
1450
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', preTransformBundle])}`);
1451
- remoteOptions['preTransformBundle'] = this.cleanName(preTransformBundle);
1452
- }
1453
- }
1454
- const postTransformBundle = (_b = propertySet['remoteOptions']) === null || _b === void 0 ? void 0 : _b['postTransformBundle'];
1455
- if (postTransformBundle) {
1456
- if (this.nameRegistry.hasDataMapperMapping(postTransformBundle)) {
1457
- remoteOptions['postTransformBundle'] = this.nameRegistry.getDataMapperCleanedName(postTransformBundle);
1458
- }
1459
- else {
1460
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', postTransformBundle])}`);
1461
- remoteOptions['postTransformBundle'] = this.cleanName(postTransformBundle);
1462
- }
1463
- }
1464
- updatedPropertySet['remoteOptions'] = remoteOptions;
1465
- const preBundle = propertySet['preTransformBundle'];
1466
- if (preBundle) {
1467
- if (this.nameRegistry.hasDataMapperMapping(preBundle)) {
1468
- updatedPropertySet['preTransformBundle'] = this.nameRegistry.getDataMapperCleanedName(preBundle);
1469
- }
1470
- else {
1471
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', preBundle])}`);
1472
- updatedPropertySet['preTransformBundle'] = this.cleanName(preBundle);
1473
- }
1474
- }
1475
- const postBundle = propertySet['postTransformBundle'];
1476
- if (postBundle) {
1477
- if (this.nameRegistry.hasDataMapperMapping(postBundle)) {
1478
- updatedPropertySet['postTransformBundle'] = this.nameRegistry.getDataMapperCleanedName(postBundle);
1479
- }
1480
- else {
1481
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', postBundle])}`);
1482
- updatedPropertySet['postTransformBundle'] = this.cleanName(postBundle);
1483
- }
1484
- }
1485
- // Use registry for Integration Procedure references
1486
- const key = propertySet['integrationProcedureKey'] || '';
1487
- if (key) {
1488
- const hasRegistryMapping = this.nameRegistry.hasIntegrationProcedureMapping(key);
1489
- if (hasRegistryMapping) {
1490
- const cleanedIpName = this.nameRegistry.getIntegrationProcedureCleanedName(key);
1491
- updatedPropertySet['integrationProcedureKey'] = cleanedIpName;
1492
- }
1493
- else {
1494
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['IntegrationProcedure', key])}`);
1495
- const parts = key.split('_');
1496
- const newKey = parts.map((p) => this.cleanName(p, true)).join('_');
1497
- if (parts.length > 2) {
1498
- invalidIpReferences.set(mappedObject[Element_1.default.Name], key);
1499
- }
1500
- updatedPropertySet['integrationProcedureKey'] = newKey;
1501
- }
1502
- }
1503
- break;
1504
- case 'DataRaptor Turbo Action':
1505
- case 'DataRaptor Transform Action':
1506
- case 'DataRaptor Post Action':
1507
- case 'DataRaptor Extract Action':
1508
- // Use registry for DataMapper references with explicit fallback
1509
- const bundleName = propertySet['bundle'];
1510
- if (bundleName) {
1511
- if (this.nameRegistry.hasDataMapperMapping(bundleName)) {
1512
- updatedPropertySet['bundle'] = this.nameRegistry.getDataMapperCleanedName(bundleName);
1513
- }
1514
- else {
1515
- logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1516
- updatedPropertySet['bundle'] = this.cleanName(bundleName);
1517
- }
1518
- }
1519
- break;
1520
- }
1521
- mappedObject[Element_1.default.PropertySet__c] = JSON.stringify(updatedPropertySet);
1467
+ // Use shared method to process element types
1468
+ this.processElementByType(elementType, propertySet, invalidIpReferences, mappedObject[Element_1.default.Name]);
1469
+ mappedObject[Element_1.default.PropertySet__c] = JSON.stringify(propertySet);
1522
1470
  // BATCH framework requires that each record has an "attributes" property
1523
1471
  mappedObject['attributes'] = {
1524
1472
  type: OmniScriptMigrationTool.OMNIPROCESSELEMENT_NAME,
@@ -1558,6 +1506,10 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1558
1506
  if (content && content['children']) {
1559
1507
  this.processContentChildren(content['children']);
1560
1508
  }
1509
+ // Process persistentComponent array in OmniProcessCompilation Content (inside propSetMap)
1510
+ if (content && content['propSetMap']) {
1511
+ this.processPersistentComponents(content['propSetMap']);
1512
+ }
1561
1513
  mappedObject[OmniScriptDefinition_1.default.Content__c] = JSON.stringify(content);
1562
1514
  }
1563
1515
  catch (ex) {
@@ -1571,6 +1523,59 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1571
1523
  };
1572
1524
  return mappedObject;
1573
1525
  }
1526
+ /**
1527
+ * Shared helper method to process element types and update references
1528
+ * Handles the switch statement logic for different element types
1529
+ * @param elementType Type of the element
1530
+ * @param propSet Property set map from the element
1531
+ * @param invalidIpReferences Optional map to track invalid IP references
1532
+ * @param elementName Optional element name for logging
1533
+ */
1534
+ processElementByType(elementType, propSet, invalidIpReferences, elementName) {
1535
+ switch (elementType) {
1536
+ case stringContants_1.Constants.OmniScriptComponentName:
1537
+ this.processOmniScriptAction(propSet);
1538
+ break;
1539
+ case stringContants_1.Constants.IntegrationProcedureAction:
1540
+ this.processIntegrationProcedureAction(propSet, invalidIpReferences, elementName);
1541
+ break;
1542
+ case stringContants_1.Constants.DataRaptorTurboAction:
1543
+ case stringContants_1.Constants.DataRaptorTransformAction:
1544
+ case stringContants_1.Constants.DataRaptorPostAction:
1545
+ case stringContants_1.Constants.DataRaptorExtractAction:
1546
+ this.processDataRaptorAction(propSet);
1547
+ break;
1548
+ case stringContants_1.Constants.StepElement:
1549
+ this.processStepAction(propSet);
1550
+ break;
1551
+ case stringContants_1.Constants.DocuSignEnvelopeAction:
1552
+ this.processDocuSignEnvelopeAction(propSet);
1553
+ break;
1554
+ case stringContants_1.Constants.DocuSignSignatureAction:
1555
+ this.processDocuSignSignatureAction(propSet);
1556
+ break;
1557
+ case stringContants_1.Constants.DecisionMatrixAction:
1558
+ this.processDecisionMatrixAction(propSet);
1559
+ break;
1560
+ case stringContants_1.Constants.ExpressionSetAction:
1561
+ this.processExpressionSetAction(propSet);
1562
+ break;
1563
+ case stringContants_1.Constants.HTTPAction:
1564
+ this.processHttpAction(propSet);
1565
+ break;
1566
+ case stringContants_1.Constants.PDFAction:
1567
+ this.processPdfAction(propSet);
1568
+ break;
1569
+ case stringContants_1.Constants.RemoteAction:
1570
+ this.processRemoteAction(propSet);
1571
+ break;
1572
+ default:
1573
+ // Handle other element types if needed
1574
+ break;
1575
+ }
1576
+ // Process lwcComponentOverride for all element types (FlexCard reference)
1577
+ this.processLwcComponentOverride(propSet);
1578
+ }
1574
1579
  /**
1575
1580
  * Recursively processes children elements in the content JSON to update bundle/reference names
1576
1581
  * @param children Array of child elements from the content JSON
@@ -1607,32 +1612,58 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1607
1612
  if (!elementType || !propSetMap) {
1608
1613
  return;
1609
1614
  }
1610
- switch (elementType) {
1611
- case 'Integration Procedure Action':
1612
- this.processIntegrationProcedureAction(propSetMap);
1613
- break;
1614
- case 'DataRaptor Turbo Action':
1615
- case 'DataRaptor Transform Action':
1616
- case 'DataRaptor Post Action':
1617
- case 'DataRaptor Extract Action':
1618
- this.processDataRaptorAction(propSetMap);
1619
- break;
1620
- case 'OmniScript':
1621
- this.processOmniScriptAction(propSetMap);
1622
- break;
1623
- case 'Step':
1624
- this.processStepAction(propSetMap);
1625
- break;
1626
- default:
1627
- // Handle other element types if needed
1628
- break;
1615
+ // Use shared method to process element types
1616
+ this.processElementByType(elementType, propSetMap);
1617
+ }
1618
+ /**
1619
+ * Processes DocuSign Envelope Action elements to update transformBundle references
1620
+ * @param propSetMap Property set map from the element
1621
+ */
1622
+ processDocuSignEnvelopeAction(propSetMap) {
1623
+ // Handle docuSignTemplatesGroup[].transformBundle
1624
+ if (Array.isArray(propSetMap.docuSignTemplatesGroup)) {
1625
+ propSetMap.docuSignTemplatesGroup.forEach((template) => {
1626
+ if (template && template.transformBundle) {
1627
+ const bundleName = template.transformBundle;
1628
+ if (this.nameRegistry.hasDataMapperMapping(bundleName)) {
1629
+ template.transformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1630
+ }
1631
+ else {
1632
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1633
+ template.transformBundle = this.cleanName(bundleName);
1634
+ }
1635
+ }
1636
+ });
1637
+ }
1638
+ }
1639
+ /**
1640
+ * Processes DocuSign Signature Action elements to update transformBundle references
1641
+ * @param propSetMap Property set map from the element
1642
+ */
1643
+ processDocuSignSignatureAction(propSetMap) {
1644
+ // Handle docuSignTemplatesGroupSig[].transformBundle
1645
+ if (Array.isArray(propSetMap.docuSignTemplatesGroupSig)) {
1646
+ propSetMap.docuSignTemplatesGroupSig.forEach((template) => {
1647
+ if (template && template.transformBundle) {
1648
+ const bundleName = template.transformBundle;
1649
+ if (this.nameRegistry.hasDataMapperMapping(bundleName)) {
1650
+ template.transformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1651
+ }
1652
+ else {
1653
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1654
+ template.transformBundle = this.cleanName(bundleName);
1655
+ }
1656
+ }
1657
+ });
1629
1658
  }
1630
1659
  }
1631
1660
  /**
1632
1661
  * Processes Integration Procedure Action elements to update reference names
1633
1662
  * @param propSetMap Property set map from the element
1663
+ * @param invalidIpReferences Optional map to track invalid IP references for reporting
1664
+ * @param elementName Optional element name for tracking invalid references
1634
1665
  */
1635
- processIntegrationProcedureAction(propSetMap) {
1666
+ processIntegrationProcedureAction(propSetMap, invalidIpReferences, elementName) {
1636
1667
  // Handle remoteOptions pre/post transform bundles
1637
1668
  if (propSetMap.remoteOptions) {
1638
1669
  if (propSetMap.remoteOptions.preTransformBundle) {
@@ -1641,6 +1672,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1641
1672
  propSetMap.remoteOptions.preTransformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1642
1673
  }
1643
1674
  else {
1675
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1644
1676
  propSetMap.remoteOptions.preTransformBundle = this.cleanName(bundleName);
1645
1677
  }
1646
1678
  }
@@ -1650,6 +1682,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1650
1682
  propSetMap.remoteOptions.postTransformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1651
1683
  }
1652
1684
  else {
1685
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1653
1686
  propSetMap.remoteOptions.postTransformBundle = this.cleanName(bundleName);
1654
1687
  }
1655
1688
  }
@@ -1661,6 +1694,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1661
1694
  propSetMap.preTransformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1662
1695
  }
1663
1696
  else {
1697
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1664
1698
  propSetMap.preTransformBundle = this.cleanName(bundleName);
1665
1699
  }
1666
1700
  }
@@ -1670,6 +1704,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1670
1704
  propSetMap.postTransformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1671
1705
  }
1672
1706
  else {
1707
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1673
1708
  propSetMap.postTransformBundle = this.cleanName(bundleName);
1674
1709
  }
1675
1710
  }
@@ -1680,13 +1715,19 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1680
1715
  propSetMap.integrationProcedureKey = this.nameRegistry.getIntegrationProcedureCleanedName(key);
1681
1716
  }
1682
1717
  else {
1718
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['IntegrationProcedure', key])}`);
1683
1719
  const parts = key.split('_');
1720
+ const newKey = parts.map((p) => this.cleanName(p, true)).join('_');
1684
1721
  // Integration Procedures should have Type_SubType format (2 parts)
1685
1722
  if (parts.length > 2) {
1686
- logger_1.Logger.logVerbose(this.messages.getMessage('integrationProcedureInvalidUnderscoreFormat', [key]));
1687
- return;
1723
+ if (invalidIpReferences && elementName) {
1724
+ invalidIpReferences.set(elementName, key);
1725
+ }
1726
+ else {
1727
+ logger_1.Logger.logVerbose(this.messages.getMessage('integrationProcedureInvalidUnderscoreFormat', [key]));
1728
+ }
1688
1729
  }
1689
- propSetMap.integrationProcedureKey = parts.map((p) => this.cleanName(p, true)).join('_');
1730
+ propSetMap.integrationProcedureKey = newKey;
1690
1731
  }
1691
1732
  }
1692
1733
  }
@@ -1701,9 +1742,12 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1701
1742
  propSetMap.bundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1702
1743
  }
1703
1744
  else {
1745
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1704
1746
  propSetMap.bundle = this.cleanName(bundleName);
1705
1747
  }
1706
1748
  }
1749
+ // Handle postTransformBundle for DataRaptor Post Action
1750
+ this.processTransformBundles(propSetMap);
1707
1751
  }
1708
1752
  /**
1709
1753
  * Processes OmniScript Action elements to update reference names
@@ -1716,6 +1760,11 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1716
1760
  // Construct full OmniScript name to check registry
1717
1761
  const fullOmniScriptName = `${osType}_${osSubType}_${osLanguage}`;
1718
1762
  if (this.nameRegistry.isAngularOmniScript(fullOmniScriptName)) {
1763
+ // Referenced OmniScript is Angular - add warning and keep original reference
1764
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('angularOmniScriptDependencyWarning', [
1765
+ 'OmniScript element',
1766
+ fullOmniScriptName,
1767
+ ])}`);
1719
1768
  // Keep original reference as-is since Angular OmniScript won't be migrated
1720
1769
  return;
1721
1770
  }
@@ -1734,6 +1783,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1734
1783
  }
1735
1784
  else {
1736
1785
  // No registry mapping - use original fallback approach
1786
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['OmniScript', fullOmniScriptName])}`);
1737
1787
  propSetMap['Type'] = this.cleanName(osType);
1738
1788
  propSetMap['Sub Type'] = this.cleanName(osSubType);
1739
1789
  }
@@ -1752,6 +1802,7 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1752
1802
  propSetMap.remoteOptions.preTransformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1753
1803
  }
1754
1804
  else {
1805
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1755
1806
  propSetMap.remoteOptions.preTransformBundle = this.cleanName(bundleName);
1756
1807
  }
1757
1808
  }
@@ -1761,11 +1812,119 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1761
1812
  propSetMap.remoteOptions.postTransformBundle = this.nameRegistry.getDataMapperCleanedName(bundleName);
1762
1813
  }
1763
1814
  else {
1815
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1764
1816
  propSetMap.remoteOptions.postTransformBundle = this.cleanName(bundleName);
1765
1817
  }
1766
1818
  }
1767
1819
  }
1768
1820
  }
1821
+ /**
1822
+ * Generic helper to process common transform bundle properties
1823
+ * Handles: preTransformBundle, postTransformBundle, remoteOptions.preTransformBundle, remoteOptions.postTransformBundle
1824
+ * @param propSetMap Property set map from the element
1825
+ */
1826
+ processTransformBundles(propSetMap) {
1827
+ // Handle remoteOptions pre/post transform bundles
1828
+ if (propSetMap.remoteOptions) {
1829
+ if (propSetMap.remoteOptions.preTransformBundle) {
1830
+ propSetMap.remoteOptions.preTransformBundle = this.cleanBundleName(propSetMap.remoteOptions.preTransformBundle);
1831
+ }
1832
+ if (propSetMap.remoteOptions.postTransformBundle) {
1833
+ propSetMap.remoteOptions.postTransformBundle = this.cleanBundleName(propSetMap.remoteOptions.postTransformBundle);
1834
+ }
1835
+ }
1836
+ // Handle direct pre/post transform bundles
1837
+ if (propSetMap.preTransformBundle) {
1838
+ propSetMap.preTransformBundle = this.cleanBundleName(propSetMap.preTransformBundle);
1839
+ }
1840
+ if (propSetMap.postTransformBundle) {
1841
+ propSetMap.postTransformBundle = this.cleanBundleName(propSetMap.postTransformBundle);
1842
+ }
1843
+ }
1844
+ /**
1845
+ * Helper to clean a single bundle name using registry or fallback
1846
+ * @param bundleName The bundle name to clean
1847
+ * @returns The cleaned bundle name
1848
+ */
1849
+ cleanBundleName(bundleName) {
1850
+ if (!bundleName) {
1851
+ return bundleName;
1852
+ }
1853
+ if (this.nameRegistry.hasDataMapperMapping(bundleName)) {
1854
+ return this.nameRegistry.getDataMapperCleanedName(bundleName);
1855
+ }
1856
+ else {
1857
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['DataMapper', bundleName])}`);
1858
+ return this.cleanName(bundleName);
1859
+ }
1860
+ }
1861
+ /**
1862
+ * Processes Decision Matrix Action elements to update transform bundle references
1863
+ * @param propSetMap Property set map from the element
1864
+ */
1865
+ processDecisionMatrixAction(propSetMap) {
1866
+ this.processTransformBundles(propSetMap);
1867
+ }
1868
+ /**
1869
+ * Processes Expression Set Action elements to update transform bundle references
1870
+ * @param propSetMap Property set map from the element
1871
+ */
1872
+ processExpressionSetAction(propSetMap) {
1873
+ this.processTransformBundles(propSetMap);
1874
+ }
1875
+ /**
1876
+ * Processes HTTP Action elements to update transform bundle references
1877
+ * Handles: preTransformBundle, postTransformBundle, xmlPreTransformBundle, xmlPostTransformBundle
1878
+ * @param propSetMap Property set map from the element
1879
+ */
1880
+ processHttpAction(propSetMap) {
1881
+ this.processTransformBundles(propSetMap);
1882
+ // Handle XML-specific transform bundles
1883
+ if (propSetMap.xmlPreTransformBundle) {
1884
+ propSetMap.xmlPreTransformBundle = this.cleanBundleName(propSetMap.xmlPreTransformBundle);
1885
+ }
1886
+ if (propSetMap.xmlPostTransformBundle) {
1887
+ propSetMap.xmlPostTransformBundle = this.cleanBundleName(propSetMap.xmlPostTransformBundle);
1888
+ }
1889
+ }
1890
+ /**
1891
+ * Processes PDF Action elements to update transform bundle references
1892
+ * @param propSetMap Property set map from the element
1893
+ */
1894
+ processPdfAction(propSetMap) {
1895
+ if (propSetMap.preTransformBundle) {
1896
+ propSetMap.preTransformBundle = this.cleanBundleName(propSetMap.preTransformBundle);
1897
+ }
1898
+ }
1899
+ /**
1900
+ * Processes Remote Action elements to update transform bundle references
1901
+ * @param propSetMap Property set map from the element
1902
+ */
1903
+ processRemoteAction(propSetMap) {
1904
+ this.processTransformBundles(propSetMap);
1905
+ }
1906
+ /**
1907
+ * Processes lwcComponentOverride property to update FlexCard reference names
1908
+ * @param propSetMap Property set map from the element
1909
+ */
1910
+ processLwcComponentOverride(propSetMap) {
1911
+ if (propSetMap.lwcComponentOverride) {
1912
+ const lwcOverride = propSetMap.lwcComponentOverride;
1913
+ // lwcComponentOverride has 'cf' prefix (e.g., 'cfEventManagementBudgetCard')
1914
+ // Registry stores FlexCard names without prefix (e.g., 'EventManagementBudgetCard')
1915
+ if (lwcOverride.startsWith('cf')) {
1916
+ const flexCardName = lwcOverride.substring(2); // Remove 'cf' prefix
1917
+ if (this.nameRegistry.hasFlexCardMapping(flexCardName)) {
1918
+ const cleanedName = this.nameRegistry.getFlexCardCleanedName(flexCardName);
1919
+ propSetMap.lwcComponentOverride = 'cf' + cleanedName;
1920
+ }
1921
+ else {
1922
+ logger_1.Logger.logVerbose(`\n${this.messages.getMessage('componentMappingNotFound', ['FlexCard', flexCardName])}`);
1923
+ propSetMap.lwcComponentOverride = 'cf' + this.cleanName(flexCardName);
1924
+ }
1925
+ }
1926
+ }
1927
+ }
1769
1928
  getOmniScriptFields() {
1770
1929
  return this.IS_STANDARD_DATA_MODEL ? Object.values(OmniScript_1.default) : Object.keys(OmniScript_1.default);
1771
1930
  }
@@ -1822,6 +1981,162 @@ class OmniScriptMigrationTool extends base_1.BaseMigrationTool {
1822
1981
  }
1823
1982
  }
1824
1983
  }
1984
+ /**
1985
+ * Collects DataRaptor transform bundle dependencies from PropertySet
1986
+ * Handles: preTransformBundle, postTransformBundle, xmlPreTransformBundle, xmlPostTransformBundle,
1987
+ * and remoteOptions.preTransformBundle, remoteOptions.postTransformBundle
1988
+ * Used by: HTTP Action, Remote Action, Decision Matrix Action, Expression Set Action, PDF Action, Step
1989
+ * @param propertySet - The PropertySet JSON object
1990
+ * @param elemName - Element name for location tracking
1991
+ * @param dependencyDR - Array to collect DataRaptor dependencies
1992
+ * @param existingDataRaptorNames - Set of existing DataRaptor names
1993
+ * @param missingDR - Array to collect missing DataRaptor names
1994
+ */
1995
+ collectTransformBundleDependencies(propertySet, elemName, dependencyDR, existingDataRaptorNames, missingDR) {
1996
+ const bundleFields = [
1997
+ 'preTransformBundle',
1998
+ 'postTransformBundle',
1999
+ 'xmlPreTransformBundle',
2000
+ 'xmlPostTransformBundle',
2001
+ ];
2002
+ // Check direct transform bundle fields
2003
+ for (const field of bundleFields) {
2004
+ if (propertySet[field]) {
2005
+ const bundleName = propertySet[field];
2006
+ dependencyDR.push({ name: bundleName, location: `${elemName} (${field})` });
2007
+ if (!existingDataRaptorNames.has(bundleName)) {
2008
+ missingDR.push(bundleName);
2009
+ }
2010
+ }
2011
+ }
2012
+ // Check remoteOptions transform bundle fields
2013
+ if (propertySet.remoteOptions) {
2014
+ if (propertySet.remoteOptions.preTransformBundle) {
2015
+ const bundleName = propertySet.remoteOptions.preTransformBundle;
2016
+ dependencyDR.push({ name: bundleName, location: `${elemName} (remoteOptions.preTransformBundle)` });
2017
+ if (!existingDataRaptorNames.has(bundleName)) {
2018
+ missingDR.push(bundleName);
2019
+ }
2020
+ }
2021
+ if (propertySet.remoteOptions.postTransformBundle) {
2022
+ const bundleName = propertySet.remoteOptions.postTransformBundle;
2023
+ dependencyDR.push({ name: bundleName, location: `${elemName} (remoteOptions.postTransformBundle)` });
2024
+ if (!existingDataRaptorNames.has(bundleName)) {
2025
+ missingDR.push(bundleName);
2026
+ }
2027
+ }
2028
+ }
2029
+ }
2030
+ /**
2031
+ * Collects DataRaptor transform bundle dependencies from DocuSign Envelope Action
2032
+ * Handles: docuSignTemplatesGroup[].transformBundle
2033
+ * @param propertySet - The PropertySet JSON object
2034
+ * @param elemName - Element name for location tracking
2035
+ * @param dependencyDR - Array to collect DataRaptor dependencies
2036
+ * @param existingDataRaptorNames - Set of existing DataRaptor names
2037
+ * @param missingDR - Array to collect missing DataRaptor names
2038
+ */
2039
+ collectDocuSignBundleDependencies(propertySet, elemName, dependencyDR, existingDataRaptorNames, missingDR) {
2040
+ if (Array.isArray(propertySet.docuSignTemplatesGroup)) {
2041
+ propertySet.docuSignTemplatesGroup.forEach((template, index) => {
2042
+ if (template && template.transformBundle) {
2043
+ const bundleName = template.transformBundle;
2044
+ dependencyDR.push({
2045
+ name: bundleName,
2046
+ location: `${elemName} (docuSignTemplatesGroup[${index}].transformBundle)`,
2047
+ });
2048
+ if (!existingDataRaptorNames.has(bundleName)) {
2049
+ missingDR.push(bundleName);
2050
+ }
2051
+ }
2052
+ });
2053
+ }
2054
+ }
2055
+ /**
2056
+ * Collects DataRaptor transform bundle dependencies from DocuSign Signature Action
2057
+ * Handles: docuSignTemplatesGroupSig[].transformBundle
2058
+ * @param propertySet - The PropertySet JSON object
2059
+ * @param elemName - Element name for location tracking
2060
+ * @param dependencyDR - Array to collect DataRaptor dependencies
2061
+ * @param existingDataRaptorNames - Set of existing DataRaptor names
2062
+ * @param missingDR - Array to collect missing DataRaptor names
2063
+ */
2064
+ collectDocuSignSignatureBundleDependencies(propertySet, elemName, dependencyDR, existingDataRaptorNames, missingDR) {
2065
+ if (Array.isArray(propertySet.docuSignTemplatesGroupSig)) {
2066
+ propertySet.docuSignTemplatesGroupSig.forEach((template, index) => {
2067
+ if (template && template.transformBundle) {
2068
+ const bundleName = template.transformBundle;
2069
+ dependencyDR.push({
2070
+ name: bundleName,
2071
+ location: `${elemName} (docuSignTemplatesGroupSig[${index}].transformBundle)`,
2072
+ });
2073
+ if (!existingDataRaptorNames.has(bundleName)) {
2074
+ missingDR.push(bundleName);
2075
+ }
2076
+ }
2077
+ });
2078
+ }
2079
+ }
2080
+ /**
2081
+ * Collects DataRaptor transform bundle dependencies from OmniProcess PropertySetConfig persistentComponent array
2082
+ * Handles: persistentComponent[].remoteOptions.preTransformBundle, persistentComponent[].remoteOptions.postTransformBundle,
2083
+ * persistentComponent[].preTransformBundle, persistentComponent[].postTransformBundle
2084
+ * @param omniscript - The OmniScript/Integration Procedure record
2085
+ * @param dependencyDR - Array to collect DataRaptor dependencies
2086
+ * @param existingDataRaptorNames - Set of existing DataRaptor names
2087
+ * @param missingDR - Array to collect missing DataRaptor names
2088
+ */
2089
+ collectPersistentComponentBundleDependencies(omniscript, dependencyDR, existingDataRaptorNames, missingDR) {
2090
+ const propertySetConfigStr = omniscript[this.getFieldKey('PropertySet__c')];
2091
+ if (!propertySetConfigStr) {
2092
+ return;
2093
+ }
2094
+ let propertySetConfig;
2095
+ try {
2096
+ propertySetConfig = JSON.parse(propertySetConfigStr);
2097
+ }
2098
+ catch (ex) {
2099
+ logger_1.Logger.error(`Failed to parse PropertySetConfig for assessment: ${omniscript['Name']}`);
2100
+ return;
2101
+ }
2102
+ if (!propertySetConfig || !Array.isArray(propertySetConfig.persistentComponent)) {
2103
+ return;
2104
+ }
2105
+ const bundleFields = ['preTransformBundle', 'postTransformBundle'];
2106
+ propertySetConfig.persistentComponent.forEach((component, index) => {
2107
+ if (!component) {
2108
+ return;
2109
+ }
2110
+ // Check remoteOptions transform bundle fields
2111
+ if (component.remoteOptions) {
2112
+ bundleFields.forEach((field) => {
2113
+ if (component.remoteOptions[field]) {
2114
+ const bundleName = component.remoteOptions[field];
2115
+ dependencyDR.push({
2116
+ name: bundleName,
2117
+ location: `persistentComponent[${index}].remoteOptions.${field}`,
2118
+ });
2119
+ if (!existingDataRaptorNames.has(bundleName)) {
2120
+ missingDR.push(bundleName);
2121
+ }
2122
+ }
2123
+ });
2124
+ }
2125
+ // Check direct transform bundle fields
2126
+ bundleFields.forEach((field) => {
2127
+ if (component[field]) {
2128
+ const bundleName = component[field];
2129
+ dependencyDR.push({
2130
+ name: bundleName,
2131
+ location: `persistentComponent[${index}].${field}`,
2132
+ });
2133
+ if (!existingDataRaptorNames.has(bundleName)) {
2134
+ missingDR.push(bundleName);
2135
+ }
2136
+ }
2137
+ });
2138
+ });
2139
+ }
1825
2140
  getElementFieldKey(fieldName) {
1826
2141
  return this.IS_STANDARD_DATA_MODEL ? Element_1.default[fieldName] : this.namespacePrefix + fieldName;
1827
2142
  }