Skip to content

Commit a8affc3

Browse files
authored
Merge pull request #353 from sf-kishore-kurri/u/kkurri/W-18480458
feat: @W-18480458: Implementation of update references across Omnistudio components
2 parents 912eb61 + 39ba058 commit a8affc3

18 files changed

+3610
-148
lines changed

messages/assess.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
"processingOmniScript": "Processing OmniScript: %s",
4747
"processingGlobalAutoNumber": "Processing GlobalAutoNumber: %s",
4848
"foundDataRaptorsToAssess": "Found %s DataRaptors to assess",
49-
"foundOmniScriptsToAssess": "Found %s OmniScripts and Integration Procedures to assess",
49+
"foundOmniScriptsToAssess": "Found %s %s to assess",
5050
"foundGlobalAutoNumbersToAssess": "Found %s GlobalAutoNumbers to assess",
5151
"startingDataRaptorAssessment": "Starting DataRaptor assessment",
52-
"startingOmniScriptAssessment": "Starting OmniScript assessment",
52+
"startingOmniScriptAssessment": "Starting %s assessment",
5353
"startingGlobalAutoNumberAssessment": "Starting GlobalAutoNumber assessment",
5454
"allVersionsInfo": "allVersions : %s",
5555
"assessmentInitialization": "Assessment Initialization: Using namespace: %s",
@@ -65,10 +65,10 @@
6565
"globalAutoNumberAssessment": "GlobalAutoNumber Assessment",
6666
"assessedGlobalAutoNumbersCount": "Assessed %s GlobalAutoNumbers",
6767
"globalAutoNumberAssessmentCompleted": "The assessment for Global Auto Number is complete.",
68-
"omniScriptAssessment": "OmniScript and Integration Procedure Assessment",
68+
"omniScriptAssessment": "%s Assessment",
6969
"assessedOmniScriptsCount": "Assessed %s OmniScripts",
7070
"assessedIntegrationProceduresCount": "Assessed %s Integration Procedures",
71-
"omniScriptAssessmentCompleted": "OmniScript and Integration Procedure assessment completed",
71+
"omniScriptAssessmentCompleted": "%s assessment completed",
7272
"startingFlexCardAssessment": "Starting FlexCard assessment",
7373
"foundFlexCardsToAssess": "Found %s FlexCards to assess",
7474
"startingApexAssessment": "Starting Apex assessment in project path: %s",

messages/migrate.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"formulaSyntaxError": "There was some problem while updating the formula syntax, please check the all the formula's syntax once : %s",
7171
"foundDataRaptorsToMigrate": "Found %s DataRaptors to migrate",
7272
"foundFlexCardsToMigrate": "Found %s FlexCards to migrate",
73-
"foundOmniScriptsToMigrate": "Found %s OmniScripts and Integration Procedures to migrate",
73+
"foundOmniScriptsToMigrate": "Found %s %s to migrate",
7474
"foundGlobalAutoNumbersToMigrate": "Found %s GlobalAutoNumbers to migrate",
7575
"allVersionsInfo": "allVersions : %s",
7676
"migrationInitialization": "Migration Initialization: Using namespace: %s",
@@ -150,7 +150,6 @@
150150
"foundGlobalAutoNumbersToAssess": "Found %s Global Auto Numbers to assess",
151151
"unexpectedError": "An unexpected error occurred during processing",
152152
"migrationValidationFailed": "Post Migration validation failed.",
153-
"incompleteMigrationDetected": "Incomplete migration detected. Source objects: %s, Target objects: %s.",
154153
"experienceSiteMetadataConsent": "The consent for exp site is %s",
155154
"experienceSiteConsentNotProvidedWarning": "Consent for experience sites is not provided. Experience sites will not be processed",
156155
"relatedObjectsToProcessAfterExpSitesRemoval": "Objects to process after removing expsite are",
@@ -199,5 +198,14 @@
199198
"errorMigrationMessage": "Error migrating object: %s",
200199
"experienceSiteException": "Exception occurred while processing experience sites",
201200
"reservedKeysFoundInPropertySet": "Reserved keys found in any of output response transformation fields: %s.",
202-
"nameMappingUndefined": "Name Mapping is undefined"
201+
"incompleteMigrationDetected": "We couldn't complete the migration process",
202+
"nameMappingUndefined": "Name Mapping is undefined",
203+
"errorComponentMapping": "Error during component pre-processing: %s",
204+
"startingComponentPreProcessing": "Pre-processing components for name mapping",
205+
"completeComponentMappingMessage": "Registered name mappings for %s components",
206+
"componentMappingNotFound": "No registry mapping found for %s component: %s, using fallback cleaning",
207+
"flexCardWithAngularOmniScriptWarning": "FlexCard has dependencies on Angular OmniScript(s) which are not migrated. Please convert OmniScript(s) to LWC before migrating this FlexCard.",
208+
"angularOmniScriptDependencyWarning": "Element '%s' references Angular OmniScript '%s' which will not be migrated. Consider converting the referenced OmniScript to LWC",
209+
"skipFlexcardAngularOmniScriptDependencyWarning": "Skipping FlexCard %s due to Angular OmniScript dependencies",
210+
"flexCardMigrationProcessingMessage": "Processing %s FlexCards for migration (%s skipped due to Angular dependencies)"
203211
}

src/commands/omnistudio/migration/assess.ts

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ export default class Assess extends OmniStudioBaseCommand {
210210
// If no specific component is specified, assess all components
211211
await this.assessDataRaptors(assesmentInfo, namespace, conn);
212212
await this.assessFlexCards(assesmentInfo, namespace, conn, allVersions);
213-
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.All);
213+
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.OS);
214+
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.IP);
214215
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
215216
return;
216217
}
@@ -265,21 +266,39 @@ export default class Assess extends OmniStudioBaseCommand {
265266
allVersions: boolean,
266267
exportType: OmniScriptExportType
267268
): Promise<void> {
268-
Logger.logVerbose(messages.getMessage('omniScriptAssessment'));
269+
const exportComponentType = exportType === OmniScriptExportType.IP ? 'Integration Procedures' : 'Omniscripts';
270+
Logger.logVerbose(messages.getMessage('omniScriptAssessment', [exportComponentType]));
269271
const osMigrator = new OmniScriptMigrationTool(exportType, namespace, conn, Logger, messages, this.ux, allVersions);
270-
assesmentInfo.omniAssessmentInfo = await osMigrator.assess(
272+
const newOmniAssessmentInfo = await osMigrator.assess(
271273
assesmentInfo.dataRaptorAssessmentInfos,
272274
assesmentInfo.flexCardAssessmentInfos
273275
);
274-
Logger.logVerbose(
275-
messages.getMessage('assessedOmniScriptsCount', [assesmentInfo.omniAssessmentInfo.osAssessmentInfos.length])
276-
);
277-
Logger.logVerbose(
278-
messages.getMessage('assessedIntegrationProceduresCount', [
279-
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos.length,
280-
])
281-
);
282-
Logger.log(messages.getMessage('omniScriptAssessmentCompleted'));
276+
277+
// Initialize omniAssessmentInfo if it doesn't exist
278+
if (!assesmentInfo.omniAssessmentInfo) {
279+
assesmentInfo.omniAssessmentInfo = {
280+
osAssessmentInfos: [],
281+
ipAssessmentInfos: [],
282+
};
283+
}
284+
285+
// Merge results instead of overwriting
286+
if (exportType === OmniScriptExportType.OS) {
287+
// For OmniScript assessment, update osAssessmentInfos
288+
assesmentInfo.omniAssessmentInfo.osAssessmentInfos = newOmniAssessmentInfo.osAssessmentInfos;
289+
Logger.logVerbose(
290+
messages.getMessage('assessedOmniScriptsCount', [assesmentInfo.omniAssessmentInfo.osAssessmentInfos.length])
291+
);
292+
} else {
293+
// For Integration Procedure assessment, update ipAssessmentInfos
294+
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos = newOmniAssessmentInfo.ipAssessmentInfos;
295+
Logger.logVerbose(
296+
messages.getMessage('assessedIntegrationProceduresCount', [
297+
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos.length,
298+
])
299+
);
300+
}
301+
Logger.log(messages.getMessage('omniScriptAssessmentCompleted', [exportComponentType]));
283302
}
284303

285304
private async assessGlobalAutoNumbers(

0 commit comments

Comments
 (0)