Skip to content

feat: @W-18480458: Implementation of update references across Omnistudio components #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
8 changes: 4 additions & 4 deletions messages/assess.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
"processingOmniScript": "Processing OmniScript: %s",
"processingGlobalAutoNumber": "Processing GlobalAutoNumber: %s",
"foundDataRaptorsToAssess": "Found %s DataRaptors to assess",
"foundOmniScriptsToAssess": "Found %s OmniScripts and Integration Procedures to assess",
"foundOmniScriptsToAssess": "Found %s %s to assess",
"foundGlobalAutoNumbersToAssess": "Found %s GlobalAutoNumbers to assess",
"startingDataRaptorAssessment": "Starting DataRaptor assessment",
"startingOmniScriptAssessment": "Starting OmniScript assessment",
"startingOmniScriptAssessment": "Starting %s assessment",
"startingGlobalAutoNumberAssessment": "Starting GlobalAutoNumber assessment",
"allVersionsInfo": "allVersions : %s",
"assessmentInitialization": "Assessment Initialization: Using namespace: %s",
Expand All @@ -65,10 +65,10 @@
"globalAutoNumberAssessment": "GlobalAutoNumber Assessment",
"assessedGlobalAutoNumbersCount": "Assessed %s GlobalAutoNumbers",
"globalAutoNumberAssessmentCompleted": "The assessment for Global Auto Number is complete.",
"omniScriptAssessment": "OmniScript and Integration Procedure Assessment",
"omniScriptAssessment": "%s Assessment",
"assessedOmniScriptsCount": "Assessed %s OmniScripts",
"assessedIntegrationProceduresCount": "Assessed %s Integration Procedures",
"omniScriptAssessmentCompleted": "OmniScript and Integration Procedure assessment completed",
"omniScriptAssessmentCompleted": "%s assessment completed",
"startingFlexCardAssessment": "Starting FlexCard assessment",
"foundFlexCardsToAssess": "Found %s FlexCards to assess",
"startingApexAssessment": "Starting Apex assessment in project path: %s",
Expand Down
14 changes: 11 additions & 3 deletions messages/migrate.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"formulaSyntaxError": "There was some problem while updating the formula syntax, please check the all the formula's syntax once : %s",
"foundDataRaptorsToMigrate": "Found %s DataRaptors to migrate",
"foundFlexCardsToMigrate": "Found %s FlexCards to migrate",
"foundOmniScriptsToMigrate": "Found %s OmniScripts and Integration Procedures to migrate",
"foundOmniScriptsToMigrate": "Found %s %s to migrate",
"foundGlobalAutoNumbersToMigrate": "Found %s GlobalAutoNumbers to migrate",
"allVersionsInfo": "allVersions : %s",
"migrationInitialization": "Migration Initialization: Using namespace: %s",
Expand Down Expand Up @@ -150,7 +150,6 @@
"foundGlobalAutoNumbersToAssess": "Found %s Global Auto Numbers to assess",
"unexpectedError": "An unexpected error occurred during processing",
"migrationValidationFailed": "Post Migration validation failed.",
"incompleteMigrationDetected": "Incomplete migration detected. Source objects: %s, Target objects: %s.",
"experienceSiteMetadataConsent": "The consent for exp site is %s",
"experienceSiteConsentNotProvidedWarning": "Consent for experience sites is not provided. Experience sites will not be processed",
"relatedObjectsToProcessAfterExpSitesRemoval": "Objects to process after removing expsite are",
Expand Down Expand Up @@ -199,5 +198,14 @@
"errorMigrationMessage": "Error migrating object: %s",
"experienceSiteException": "Exception occurred while processing experience sites",
"reservedKeysFoundInPropertySet": "Reserved keys found in any of output response transformation fields: %s.",
"nameMappingUndefined": "Name Mapping is undefined"
"incompleteMigrationDetected": "We couldn't complete the migration process",
"nameMappingUndefined": "Name Mapping is undefined",
"errorComponentMapping": "Error during component pre-processing: %s",
"startingComponentPreProcessing": "Pre-processing components for name mapping",
"completeComponentMappingMessage": "Registered name mappings for %s components",
"componentMappingNotFound": "No registry mapping found for %s component: %s, using fallback cleaning",
"flexCardWithAngularOmniScriptWarning": "FlexCard has dependencies on Angular OmniScript(s) which are not migrated. Please convert OmniScript(s) to LWC before migrating this FlexCard.",
"angularOmniScriptDependencyWarning": "Element '%s' references Angular OmniScript '%s' which will not be migrated. Consider converting the referenced OmniScript to LWC",
"skipFlexcardAngularOmniScriptDependencyWarning": "Skipping FlexCard %s due to Angular OmniScript dependencies",
"flexCardMigrationProcessingMessage": "Processing %s FlexCards for migration (%s skipped due to Angular dependencies)"
}
43 changes: 31 additions & 12 deletions src/commands/omnistudio/migration/assess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ export default class Assess extends OmniStudioBaseCommand {
// If no specific component is specified, assess all components
await this.assessDataRaptors(assesmentInfo, namespace, conn);
await this.assessFlexCards(assesmentInfo, namespace, conn, allVersions);
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.All);
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.OS);
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.IP);
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
return;
}
Expand Down Expand Up @@ -265,21 +266,39 @@ export default class Assess extends OmniStudioBaseCommand {
allVersions: boolean,
exportType: OmniScriptExportType
): Promise<void> {
Logger.logVerbose(messages.getMessage('omniScriptAssessment'));
const exportComponentType = exportType === OmniScriptExportType.IP ? 'Integration Procedures' : 'Omniscripts';
Logger.logVerbose(messages.getMessage('omniScriptAssessment', [exportComponentType]));
const osMigrator = new OmniScriptMigrationTool(exportType, namespace, conn, Logger, messages, this.ux, allVersions);
assesmentInfo.omniAssessmentInfo = await osMigrator.assess(
const newOmniAssessmentInfo = await osMigrator.assess(
assesmentInfo.dataRaptorAssessmentInfos,
assesmentInfo.flexCardAssessmentInfos
);
Logger.logVerbose(
messages.getMessage('assessedOmniScriptsCount', [assesmentInfo.omniAssessmentInfo.osAssessmentInfos.length])
);
Logger.logVerbose(
messages.getMessage('assessedIntegrationProceduresCount', [
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos.length,
])
);
Logger.log(messages.getMessage('omniScriptAssessmentCompleted'));

// Initialize omniAssessmentInfo if it doesn't exist
if (!assesmentInfo.omniAssessmentInfo) {
assesmentInfo.omniAssessmentInfo = {
osAssessmentInfos: [],
ipAssessmentInfos: [],
};
}

// Merge results instead of overwriting
if (exportType === OmniScriptExportType.OS) {
// For OmniScript assessment, update osAssessmentInfos
assesmentInfo.omniAssessmentInfo.osAssessmentInfos = newOmniAssessmentInfo.osAssessmentInfos;
Logger.logVerbose(
messages.getMessage('assessedOmniScriptsCount', [assesmentInfo.omniAssessmentInfo.osAssessmentInfos.length])
);
} else {
// For Integration Procedure assessment, update ipAssessmentInfos
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos = newOmniAssessmentInfo.ipAssessmentInfos;
Logger.logVerbose(
messages.getMessage('assessedIntegrationProceduresCount', [
assesmentInfo.omniAssessmentInfo.ipAssessmentInfos.length,
])
);
}
Logger.log(messages.getMessage('omniScriptAssessmentCompleted', [exportComponentType]));
}

private async assessGlobalAutoNumbers(
Expand Down
Loading