Skip to content

Commit ff38cd6

Browse files
fix: @W-18480496 : Addressed the code review comments
1 parent a53b4df commit ff38cd6

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

messages/migrate.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
"startingComponentPreProcessing": "Pre-processing components for name mapping",
212212
"completeComponentMappingMessage": "Registered name mappings for %s components",
213213
"componentMappingNotFound": "No registry mapping found for %s component: %s, using fallback cleaning",
214+
"integrationProcedureInvalidUnderscoreFormat": "Integration Procedure reference '%s' contains underscores in Type/SubType names. Skipping reference update to avoid incorrect parsing.",
214215
"flexCardWithAngularOmniScriptWarning": "FlexCard has dependencies on Angular Omniscript(s) which are not migrated. Please convert Omniscript(s) to LWC before migrating this FlexCard.",
215216
"angularOmniScriptDependencyWarning": "Element '%s' references Angular Omniscript '%s' which will not be migrated. Consider converting the referenced Omniscript to LWC",
216217
"skipFlexcardAngularOmniScriptDependencyWarning": "Skipping FlexCard %s due to Angular Omniscript dependencies",

src/migration/omniscript.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,12 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
17531753
propSetMap.integrationProcedureKey = this.nameRegistry.getIntegrationProcedureCleanedName(key);
17541754
} else {
17551755
const parts = key.split('_');
1756+
// Integration Procedures should have Type_SubType format (2 parts)
1757+
if (parts.length > 2) {
1758+
Logger.logVerbose(this.messages.getMessage('integrationProcedureInvalidUnderscoreFormat', [key]));
1759+
return;
1760+
}
1761+
17561762
propSetMap.integrationProcedureKey = parts.map((p) => this.cleanName(p, true)).join('_');
17571763
}
17581764
}
@@ -1787,9 +1793,7 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
17871793

17881794
if (this.nameRegistry.isAngularOmniScript(fullOmniScriptName)) {
17891795
// Keep original reference as-is since Angular OmniScript won't be migrated
1790-
propSetMap['Type'] = osType;
1791-
propSetMap['Sub Type'] = osSubType;
1792-
propSetMap['Language'] = osLanguage;
1796+
return;
17931797
} else if (this.nameRegistry.hasOmniScriptMapping(fullOmniScriptName)) {
17941798
// Registry has mapping for this LWC OmniScript - extract cleaned parts
17951799
const cleanedFullName = this.nameRegistry.getCleanedName(fullOmniScriptName, 'OmniScript');
@@ -1815,17 +1819,8 @@ export class OmniScriptMigrationTool extends BaseMigrationTool implements Migrat
18151819
* @param propSetMap Property set map from the element
18161820
*/
18171821
private processStepAction(propSetMap: any): void {
1818-
// Handle remoteClass - typically references Apex classes
1819-
if (propSetMap.remoteClass && propSetMap.remoteClass.trim()) {
1820-
propSetMap.remoteClass = this.cleanName(propSetMap.remoteClass);
1821-
}
1822-
1823-
// Handle remoteMethod - typically references Apex methods
1824-
if (propSetMap.remoteMethod && propSetMap.remoteMethod.trim()) {
1825-
propSetMap.remoteMethod = this.cleanName(propSetMap.remoteMethod);
1826-
}
1827-
18281822
// Handle remoteOptions pre/post transform bundles if they exist in Step elements
1823+
// Note: remoteClass and remoteMethod cleaning is not required for omniscript content step dependencies
18291824
if (propSetMap.remoteOptions) {
18301825
if (propSetMap.remoteOptions.preTransformBundle) {
18311826
const bundleName = propSetMap.remoteOptions.preTransformBundle;

test/migration/omniscript-content-processing.test.ts

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,25 @@ describe('OmniScript Content Processing - Comprehensive Tests', () => {
161161

162162
expect(propSetMap.integrationProcedureKey).to.equal('CustomerAPI_DataProcessorCleaned');
163163
});
164+
165+
it('should skip processing when integrationProcedureKey contains underscores (more than 2 parts)', () => {
166+
const propSetMap = {
167+
integrationProcedureKey: 'Complex_Integration_Procedure_With_Underscores',
168+
label: 'Test IP Action',
169+
timeout: 30000,
170+
};
171+
172+
const originalKey = propSetMap.integrationProcedureKey;
173+
const originalLabel = propSetMap.label;
174+
const originalTimeout = propSetMap.timeout;
175+
176+
// Should skip processing and leave values unchanged
177+
(omniScriptTool as any).processIntegrationProcedureAction(propSetMap);
178+
179+
expect(propSetMap.integrationProcedureKey).to.equal(originalKey);
180+
expect(propSetMap.label).to.equal(originalLabel);
181+
expect(propSetMap.timeout).to.equal(originalTimeout);
182+
});
164183
});
165184

166185
describe('DataRaptor Action Processing', () => {
@@ -276,22 +295,6 @@ describe('OmniScript Content Processing - Comprehensive Tests', () => {
276295
});
277296

278297
describe('Step Action Processing', () => {
279-
it('should clean remoteClass and remoteMethod', () => {
280-
const propSetMap = {
281-
label: 'Step 1',
282-
remoteClass: 'MyCustom-Apex Class_Name',
283-
remoteMethod: 'processData_Method Name',
284-
validationRequired: true,
285-
};
286-
287-
(omniScriptTool as any).processStepAction(propSetMap);
288-
289-
expect(propSetMap.remoteClass).to.equal('MyCustomApexClassName');
290-
expect(propSetMap.remoteMethod).to.equal('processDataMethodName');
291-
expect(propSetMap.label).to.equal('Step 1');
292-
expect(propSetMap.validationRequired).to.equal(true);
293-
});
294-
295298
it('should handle remoteOptions transform bundles with registry mapping', () => {
296299
const propSetMap = {
297300
remoteOptions: {
@@ -333,6 +336,7 @@ describe('OmniScript Content Processing - Comprehensive Tests', () => {
333336
}).to.not.throw();
334337

335338
expect(propSetMap.label).to.equal('Test Step');
339+
// remoteClass and remoteMethod should remain unchanged (no cleaning)
336340
expect(propSetMap.remoteClass).to.equal('');
337341
expect(propSetMap.remoteMethod).to.equal(null);
338342
});
@@ -389,7 +393,7 @@ describe('OmniScript Content Processing - Comprehensive Tests', () => {
389393
expect(children[2].propSetMap['Sub Type']).to.equal('ProfileCleaned');
390394

391395
// Verify Step Action
392-
expect(children[3].propSetMap.remoteClass).to.equal('DataProcessorClass');
396+
expect(children[3].propSetMap.remoteClass).to.equal('Data-Processor Class');
393397
expect(children[3].propSetMap.label).to.equal('Processing Step');
394398
});
395399

@@ -439,7 +443,7 @@ describe('OmniScript Content Processing - Comprehensive Tests', () => {
439443
(omniScriptTool as any).processContentChildren(children);
440444

441445
// Verify Step processing
442-
expect(children[0].propSetMap.remoteClass).to.equal('StepHandlerClass');
446+
expect(children[0].propSetMap.remoteClass).to.equal('Step-Handler Class');
443447

444448
// Verify first nested eleArray
445449
const firstEleArray = children[0].children[0].eleArray;
@@ -481,7 +485,7 @@ describe('OmniScript Content Processing - Comprehensive Tests', () => {
481485
(omniScriptTool as any).processContentChildren(children);
482486
}).to.not.throw();
483487

484-
expect(children[0].children[0].eleArray[0].propSetMap.remoteClass).to.equal('InnerStepHandler');
488+
expect(children[0].children[0].eleArray[0].propSetMap.remoteClass).to.equal('Inner-Step Handler');
485489
});
486490
});
487491

@@ -679,7 +683,7 @@ describe('OmniScript Content Processing - Comprehensive Tests', () => {
679683
'CustomerDataLoaderCleaned'
680684
);
681685
expect(processedContent.children[1].propSetMap.bundle).to.equal('AccountDetailsExtract');
682-
expect(processedContent.children[2].propSetMap.remoteClass).to.equal('StepHandler');
686+
expect(processedContent.children[2].propSetMap.remoteClass).to.equal('Step-Handler');
683687

684688
// Verify nested elements processed
685689
const nestedElement = processedContent.children[2].children[0].eleArray[0];

0 commit comments

Comments
 (0)