Skip to content

Commit ca8a51d

Browse files
committed
Merge remote-tracking branch 'origin/prerelease/develop-ga' into flexipage_wrapper_assess
2 parents 780a2aa + 5ffe2da commit ca8a51d

20 files changed

+1625
-28
lines changed

README.md

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ sfdx omnistudio:migration:assess -u [email protected]
4141
sfdx omnistudio:migration:migrate -u [email protected]
4242
4343
44-
// To migrate/assess specific components: FlexCards, DataMappers, Integration Procedures, or OmniScripts, add the following parameters:
45-
--only=dr
46-
--only=ip
47-
--only=os
48-
--only=fc
44+
// To migrate/assess specific components: FlexCards, DataMappers, Integration Procedures, OmniScripts, or Global Auto Numbers, add the following parameters:
45+
--only=dr // DataMappers (DataRaptors)
46+
--only=ip // Integration Procedures
47+
--only=os // OmniScripts
48+
--only=fc // FlexCards
49+
--only=autonumber // Global Auto Numbers
4950
5051
// To migrate all versions of the components and not just the active ones:
5152
--allversions
@@ -59,6 +60,47 @@ sfdx omnistudio:migration:migrate -u [email protected]
5960

6061
5. An HTML page will be open in your default browser with the results of your migration/assessment reports.
6162

63+
## Global Auto Number Migration
64+
65+
Global Auto Numbers are components that generate sequential numbers across your Omnistudio org. The migration tool supports both assessment and migration of these components.
66+
67+
### Prerequisites for Global Auto Number Migration
68+
69+
Before migrating Global Auto Numbers, ensure that:
70+
71+
1. **Org Preference is Disabled**: The `OmniGlobalAutoNumberPref` org preference must be disabled before migration
72+
2. **Rollback Flags are Disabled**: Both `RollbackIPChanges` and `RollbackDRChanges` flags must be disabled
73+
3. **Namespace is Specified**: Provide the correct namespace for your OmniStudio package
74+
75+
### Global Auto Number Migration Process
76+
77+
The migration process for Global Auto Numbers includes:
78+
79+
1. **Pre-migration Checks**: Validates that org preferences and rollback flags are properly configured
80+
2. **Data Migration**: Transforms Global Auto Number settings from custom objects to standard Business Process Objects (BPO)
81+
3. **Post-migration Cleanup**: Removes source objects and enables the `OmniGlobalAutoNumberPref` org preference
82+
4. **Validation**: Ensures all records are successfully migrated before cleanup
83+
84+
### Global Auto Number Assessment
85+
86+
Assessment provides detailed information about:
87+
88+
- **Name Changes**: Identifies any naming modifications required to comply with API naming standards
89+
- **Migration Readiness**: Determines if components can be automatically migrated or require manual intervention
90+
- **Warnings**: Highlights potential issues that may affect migration success
91+
92+
### Usage Examples for Global Auto Numbers
93+
94+
```bash
95+
# Assess Global Auto Numbers only
96+
sfdx omnistudio:migration:assess -u [email protected] --only=autonumber
97+
98+
# Migrate Global Auto Numbers only
99+
sfdx omnistudio:migration:migrate -u [email protected] --only=autonumber
100+
```
101+
102+
5. An HTML page will be open in your default browser with the results of your migration/assessment job.
103+
62104
### Assess Usage & parameters
63105

64106
```
@@ -88,7 +130,7 @@ OPTIONS
88130
89131
--only=only specify components to assess:
90132
dr (DataRaptors), ip (Integration Procedures),
91-
os (OmniScripts), fc (FlexCards)
133+
os (OmniScripts), fc (FlexCards), autonumber (Global Auto Numbers)
92134
93135
--relatedobjects=relatedobjects specify related objects to assess:
94136
'apex' for Apex classes

messages/assess.json

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
{
22
"examples": [
3-
"omnistudio:migration:assess -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE",
4-
"omnistudio:migration:assess -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=dr",
5-
"omnistudio:migration:assess -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=ip",
6-
"omnistudio:migration:assess -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=os",
7-
"omnistudio:migration:assess -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=fc"
3+
"omnistudio:migration:assess -u [email protected] ",
4+
"omnistudio:migration:assess -u [email protected] --only=dr",
5+
"omnistudio:migration:assess -u [email protected] --only=ip",
6+
"omnistudio:migration:assess -u [email protected] --only=os",
7+
"omnistudio:migration:assess -u [email protected] --only=fc",
8+
"omnistudio:migration:assess -u [email protected] --only=autonumber"
89
],
910
"commandDescription": "Assess migration of omnistudio components from custom objects to standard objects",
1011
"namespaceFlagDescription": "The namespaced of the package",
1112
"apiVersionFlagDescription": "The Salesforce API version to use",
1213
"errorNoOrgResults": "No results found for the org '%s'.",
13-
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr",
14-
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr",
14+
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr | autonumber",
15+
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr | autonumber",
1516
"couldNotDeactivateOmniProcesses": "Could not deactivate current OmniProcesses",
1617
"couldNotTruncate": "Could not truncate {0}",
1718
"couldNotTruncateOmnniProcess": "Could not truncate OmniProcess. Please make sure your OS/IP is not referenced in an OmniScrirpt or Flex Card.",
@@ -39,13 +40,17 @@
3940
"formulaSyntaxError": "There was some problem while updating the formula syntax, please check the all the formula's syntax once : %s",
4041
"errorDuringFlexCardAssessment": "Error during FlexCard assessment",
4142
"errorDuringOmniScriptAssessment": "Error during OmniScript assessment",
43+
"errorDuringGlobalAutoNumberAssessment": "Error during GlobalAutoNumber assessment",
4244
"processingFlexCard": "Processing FlexCard: %s",
4345
"processingDataRaptor": "Processing DataRaptor: %s",
4446
"processingOmniScript": "Processing OmniScript: %s",
47+
"processingGlobalAutoNumber": "Processing GlobalAutoNumber: %s",
4548
"foundDataRaptorsToAssess": "Found %s DataRaptors to assess",
4649
"foundOmniScriptsToAssess": "Found %s OmniScripts and Integration Procedures to assess",
50+
"foundGlobalAutoNumbersToAssess": "Found %s GlobalAutoNumbers to assess",
4751
"startingDataRaptorAssessment": "Starting DataRaptor assessment",
4852
"startingOmniScriptAssessment": "Starting OmniScript assessment",
53+
"startingGlobalAutoNumberAssessment": "Starting GlobalAutoNumber assessment",
4954
"allVersionsInfo": "allVersions : %s",
5055
"assessmentInitialization": "Assessment Initialization: Using namespace: %s",
5156
"apiVersionInfo": "API Version: %s",
@@ -57,6 +62,9 @@
5762
"flexCardAssessment": "FlexCard Assessment",
5863
"assessedFlexCardsCount": "Assessed %s FlexCards",
5964
"flexCardAssessmentCompleted": "FlexCard assessment completed",
65+
"globalAutoNumberAssessment": "GlobalAutoNumber Assessment",
66+
"assessedGlobalAutoNumbersCount": "Assessed %s GlobalAutoNumbers",
67+
"globalAutoNumberAssessmentCompleted": "GlobalAutoNumber assessment completed",
6068
"omniScriptAssessment": "OmniScript and Integration Procedure Assessment",
6169
"assessedOmniScriptsCount": "Assessed %s OmniScripts",
6270
"assessedIntegrationProceduresCount": "Assessed %s Integration Procedures",
@@ -89,6 +97,8 @@
8997
"methodCallBundleNameUpdated": "Method call bundle name will be updated in %s for class %s method %s",
9098
"cardNameChangeMessage": "Card name will be changed from {0} to {1} to follow API naming standards",
9199
"authordNameChangeMessage": "Author name will be changed from {0} to {1} to follow API naming standards",
100+
"globalAutoNumberNameChangeMessage": "GlobalAutoNumber name will be changed from %s to %s to follow API naming standards",
101+
"duplicateGlobalAutoNumberNameMessage": "Potential duplicate: Another Global Auto Number has the same name %s after name cleaning. This may cause conflicts during migration",
92102
"omniScriptNameChangeMessage": "OmniScript reference part {0} will be changed to {1} during migration.",
93103
"dataRaptorNameChangeMessage": "DataRaptor reference {0} will be changed to {1} during migration.",
94104
"integrationProcedureNameChangeMessage": "Integration Procedure reference {0} will be changed to {1} during migration.",

messages/migrate.json

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
{
22
"examples": [
3-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE",
4-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=dr",
5-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=ip",
6-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=os",
7-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE --only=fc",
8-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE -r apex,lwc",
9-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE -r apex",
10-
"omnistudio:migration:migrate -u [email protected] --namespace=YOUR_PACKAGE_NAMESPACE -r lwc"
3+
"omnistudio:migration:migrate -u [email protected] ",
4+
"omnistudio:migration:migrate -u [email protected] --only=dr",
5+
"omnistudio:migration:migrate -u [email protected] --only=ip",
6+
"omnistudio:migration:migrate -u [email protected] --only=os",
7+
"omnistudio:migration:migrate -u [email protected] --only=fc",
8+
"omnistudio:migration:migrate -u [email protected] --only=autonumber",
9+
"omnistudio:migration:migrate -u [email protected] -r apex,lwc",
10+
"omnistudio:migration:migrate -u [email protected] -r apex",
11+
"omnistudio:migration:migrate -u [email protected] -r lwc"
1112
],
1213
"commandDescription": "Migrate omnistudio components from custom objects to standard objects",
1314
"namespaceFlagDescription": "The namespace of the package",
1415
"apiVersionFlagDescription": "The Salesforce API version to use",
1516
"errorNoOrgResults": "No results found for the org '%s'.",
16-
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr",
17-
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr",
17+
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr | autonumber",
18+
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr | autonumber",
1819
"couldNotDeactivateOmniProcesses": "Could not deactivate current OmniProcesses",
1920
"couldNotTruncate": "Could not truncate {0}",
2021
"couldNotTruncateOmnniProcess": "Could not truncate OmniProcess. Please make sure your OS/IP is not referenced in an OmniScrirpt or Flex Card.",
@@ -63,11 +64,13 @@
6364
"cleaningComponent": "Cleaning: %s",
6465
"cleaningDone": "Cleaning Done: %s",
6566
"migratingComponent": "Migrating: %s",
67+
"cleaningFailed": "Cleaning Failed: %s",
6668
"migrationCompleted": "Migration completed: %s",
6769
"formulaSyntaxError": "There was some problem while updating the formula syntax, please check the all the formula's syntax once : %s",
6870
"foundDataRaptorsToMigrate": "Found %s DataRaptors to migrate",
6971
"foundFlexCardsToMigrate": "Found %s FlexCards to migrate",
7072
"foundOmniScriptsToMigrate": "Found %s OmniScripts and Integration Procedures to migrate",
73+
"foundGlobalAutoNumbersToMigrate": "Found %s GlobalAutoNumbers to migrate",
7174
"allVersionsInfo": "allVersions : %s",
7275
"migrationInitialization": "Migration Initialization: Using namespace: %s",
7376
"apiVersionInfo": "API Version: %s",
@@ -121,5 +124,26 @@
121124
"updatedModifiedContent": "updated content in file: %s",
122125
"generatedDiffForFile": "Generated diff for file: %s",
123126
"errorProcessingFlexiPage": "Error processing flexipage file: %s, %s",
124-
"flexipagesWithChanges": "Found %s flexipage files with changes"
127+
"flexipagesWithChanges": "Found %s flexipage files with changes",
128+
"omniGlobalAutoNumberPrefEnabled": "Successfully enabled OmniGlobalAutoNumberPref org preference",
129+
"errorEnablingOmniGlobalAutoNumberPref": "Error enabling OmniGlobalAutoNumberPref org preference",
130+
"performingPreMigrationChecks": "Performing pre-migration checks for Global Auto Number...",
131+
"preMigrationChecksPassed": "Pre-migration checks passed. Proceeding with Global Auto Number migration.",
132+
"preMigrationChecksFailed": "Pre-migration checks failed. Migration cannot proceed.",
133+
"globalAutoNumberPrefEnabledError": "Global Auto Number preference (OmniGlobalAutoNumberPref) is enabled. Please disable it before proceeding with migration.",
134+
"bothRollbackFlagsEnabledError": "Both RollbackIPChanges and RollbackDRChanges flags are enabled. Please disable both flags before proceeding with Global Auto Number migration.",
135+
"rollbackIPFlagEnabledError": "RollbackIPChanges flag is enabled. Please disable this flag before proceeding with Global Auto Number migration.",
136+
"rollbackDRFlagEnabledError": "RollbackDRChanges flag is enabled. Please disable this flag before proceeding with Global Auto Number migration.",
137+
"errorCheckingRollbackFlags": "Error checking rollback flags status.",
138+
"startingPostMigrationCleanup": "Starting post-migration cleanup for Global Auto Number...",
139+
"postMigrationCleanupCompleted": "Post-migration cleanup completed successfully.",
140+
"errorDuringPostMigrationCleanup": "Error during post-migration cleanup.",
141+
"globalAutoNumberNameChangeMessage": "Global Auto Number name has been modified to fit naming rules: %s",
142+
"duplicatedGlobalAutoNumberName": "Duplicated Global Auto Number name",
143+
"errorWhileUploadingGlobalAutoNumber": "An error occurred while uploading Global Auto Number: ",
144+
"startingGlobalAutoNumberAssessment": "Starting Global Auto Number assessment...",
145+
"foundGlobalAutoNumbersToAssess": "Found %s Global Auto Numbers to assess",
146+
"unexpectedError": "An unexpected error occurred during processing",
147+
"migrationValidationFailed": "Post Migration validation failed.",
148+
"incompleteMigrationDetected": "Incomplete migration detected. Source objects: %s, Target objects: %s."
125149
}

src/commands/omnistudio/migration/assess.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AssessmentReporter } from '../../../utils/resultsbuilder/assessmentRepo
77
import { OmniScriptExportType, OmniScriptMigrationTool } from '../../../migration/omniscript';
88
import { CardMigrationTool } from '../../../migration/flexcard';
99
import { DataRaptorMigrationTool } from '../../../migration/dataraptor';
10+
import { GlobalAutoNumberMigrationTool } from '../../../migration/globalautonumber';
1011
import { DebugTimer } from '../../../utils';
1112
import { Logger } from '../../../utils/logger';
1213
import OmnistudioRelatedObjectMigrationFacade from '../../../migration/related/OmnistudioRelatedObjectMigrationFacade';
@@ -102,6 +103,7 @@ export default class Assess extends OmniStudioBaseCommand {
102103
apexAssessmentInfos: [],
103104
dataRaptorAssessmentInfos: [],
104105
flexCardAssessmentInfos: [],
106+
globalAutoNumberAssessmentInfos: [],
105107
omniAssessmentInfo: {
106108
osAssessmentInfos: [],
107109
ipAssessmentInfos: [],
@@ -166,6 +168,7 @@ export default class Assess extends OmniStudioBaseCommand {
166168
await this.assessDataRaptors(assesmentInfo, namespace, conn);
167169
await this.assessFlexCards(assesmentInfo, namespace, conn, allVersions);
168170
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.All);
171+
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
169172
return;
170173
}
171174

@@ -182,6 +185,9 @@ export default class Assess extends OmniStudioBaseCommand {
182185
case Constants.IntegrationProcedure:
183186
await this.assessOmniScripts(assesmentInfo, namespace, conn, allVersions, OmniScriptExportType.IP);
184187
break;
188+
case Constants.GlobalAutoNumber:
189+
await this.assessGlobalAutoNumbers(assesmentInfo, namespace, conn);
190+
break;
185191
default:
186192
throw new Error(messages.getMessage('invalidOnlyFlag'));
187193
}
@@ -232,4 +238,18 @@ export default class Assess extends OmniStudioBaseCommand {
232238
);
233239
Logger.log(messages.getMessage('omniScriptAssessmentCompleted'));
234240
}
241+
242+
private async assessGlobalAutoNumbers(
243+
assesmentInfo: AssessmentInfo,
244+
namespace: string,
245+
conn: Connection
246+
): Promise<void> {
247+
Logger.logVerbose(messages.getMessage('startingGlobalAutoNumberAssessment'));
248+
const globalAutoNumberMigrationTool = new GlobalAutoNumberMigrationTool(namespace, conn, Logger, messages, this.ux);
249+
assesmentInfo.globalAutoNumberAssessmentInfos = await globalAutoNumberMigrationTool.assess();
250+
Logger.logVerbose(
251+
messages.getMessage('assessedGlobalAutoNumbersCount', [assesmentInfo.globalAutoNumberAssessmentInfos.length])
252+
);
253+
Logger.log(messages.getMessage('globalAutoNumberAssessmentCompleted'));
254+
}
235255
}

0 commit comments

Comments
 (0)