Skip to content

Commit ea8ef59

Browse files
committed
chore(release): 1.0.2 [skip ci]
1 parent 3390e1b commit ea8ef59

3 files changed

Lines changed: 36 additions & 32 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## 1.0.2 (2025-08-06)
2+
3+
### Bug Fixes
4+
5+
- let devscripts control dev-deps ([8737f24](https://github.com/salesforcecli/plugin-bre-to-cml/commit/8737f24865eeec95f99cea58add97f127b9de58a))

README.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -69,70 +69,71 @@ Converts BRE based Standard Configurator rules represented as JSON to CML and sa
6969

7070
```
7171
USAGE
72-
$ sf cml convert prod-cfg-rules -o <value> -r <value> -c <value> [--json] [--flags-dir <value>] [--api-version <value>] [-d <value>] [-x <value>] [-v <value>]
72+
$ sf cml convert prod-cfg-rules -o <value> -r <value> -c <value> [--json] [--flags-dir <value>] [--api-version <value>] [-d
73+
<value>] [-x <value>] [-v <value>]
7374
7475
FLAGS
7576
-c, --cml-api=<value> (required) Unique CML API Name to be created.
76-
-d, --workspace-dir=<value> Directory where working files are located, exported rules JSON and where CMLs will be created.
77-
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org` configuration variable is already set.
78-
-r, --pcr-file=<value> (required) Name of the JSON file that contain exported standard Product Configuration Rules.
79-
-v, --products-file=<value> Name of the JSON file that contain exported Products from PCM (if not present products will be fetched automatically).
80-
-x, --additional-products=<value> Comma-separated list of additional product IDs for which CML types should be generated.
77+
-d, --workspace-dir=<value> Directory where working files are located, exported rules JSON and where CMLs will
78+
be created.
79+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
80+
configuration variable is already set.
81+
-r, --pcr-file=<value> (required) Name of the JSON file that contain exported standard Product
82+
Configuration Rules.
83+
-v, --products-file=<value> Name of the JSON file that contain exported Products from PCM (if not present
84+
products will be fetched automatically).
85+
-x, --additional-products=<value> Comma-separated list of additional product IDs for which CML types should be
86+
generated.
8187
--api-version=<value> Override the api version used for api requests made by this command
8288
8389
GLOBAL FLAGS
8490
--flags-dir=<value> Import flag values from a directory.
8591
--json Format output as json.
8692
8793
DESCRIPTION
88-
Converts BRE based Standard Configurator rules represented as JSON to CML and saves it as a pair of CML and association files.
94+
Converts BRE based Standard Configurator rules represented as JSON to CML and saves it as a pair of CML and
95+
association files.
8996
90-
Before you execute this command make sure to migrate you PCM or that you are performing migration of rules within the same org.
97+
Before you execute this command make sure to migrate you PCM or perform migration of rules within the same org.
9198
92-
Authenticate to the orgs and export BRE based Standard Configurator rules using sf data export bulk plugin and save results in a JSON file, see examples.
99+
Export BRE based Standard Configurator rules using sf data export bulk plugin and save results in a JSON file:
100+
sf data export bulk -o breMigOrg --query "SELECT ApiName, ConfigurationRuleDefinition,Description, EffectiveFromDate,
101+
EffectiveToDate, Id, IsDeleted, Name, ProcessScope, RuleSubType, RuleType, Sequence, Status FROM
102+
ProductConfigurationRule WHERE RuleType = 'Configurator' AND ApiName = 'myTestBundle'" --output-file
103+
./data/ProductConfigurationRules.json --result-format json --wait 10 --all-rows
93104
94105
This command executes following logic:
95106
96-
- Read SC Rules from the json file and build a list of `ConfiguratorRuleInput` to mimic the JSON structure of `ConfigurationRuleDefinition`
107+
- Read SC Rules from the json file and build a list of `ConfiguratorRuleInput` to mimic the JSON structure of
108+
`ConfigurationRuleDefinition`
97109
- Group rules by non-intersecting `Product2` IDs (CMLs can’t share products)
98110
- For each group:
99111
- Query PCM for related products (for bundle rules) or root definitions (for others)
100112
- Build an in-memory representation of the CML
101113
- Apply logic to build constraints
102114
- Serialize the in-memory CML to a blob for import as an Expression Set, save it in a cml-api.cml file.
103-
- Create `ExpressionSetConstraintObj` association records pointing to the `cml-api` name and write them to `cml-api_associations.csv` file.
115+
- Create `ExpressionSetConstraintObj` association records pointing to the `cml-api` name and write them to
116+
`cml-api_associations.csv` file.
104117
- If multiple CML and association files are produced 1-N number will be appended to the names of files.
105118
106119
EXAMPLES
107-
Authenticate to target orgs:
108-
109-
$ sf auth:web:login --instance-url https://sdb3.test1.pc-rnd.pc-aws.salesforce.com -a breSourceOrg
110-
$ sf auth:web:login --instance-url https://sdb3.test2.pc-rnd.pc-aws.salesforce.com -a cmlTargetOrg
111-
$ sf org list
112-
113-
Export Standard Configurator rules:
114-
115-
$ sf data export bulk -o breSourceOrg --query "SELECT ApiName, ConfigurationRuleDefinition, Description, EffectiveFromDate, EffectiveToDate, Id, IsDeleted, Name, ProcessScope, RuleSubType, RuleType, Sequence, Status FROM ProductConfigurationRule WHERE RuleType = 'Configurator'" --output-file data/ProductConfigurationRules.json --result-format json --wait 10 --all-rows
116-
117-
Convert to CML:
118-
119-
$ sf cml convert prod-cfg-rules --pcr-file data/ProductConfigurationRules.json --cml-api MY_TEST --workspace-dir data --target-org breSourceOrg
120+
$ sf cml convert prod-cfg-rules --pcr-file data/ProductConfigurationRules.json --cml-api MY_TEST --workspace-dir data --target-org breMigOrg
120121
```
121122

122-
_See code: [src/commands/cml/convert/prod-cfg-rules.ts](https://github.com/salesforcecli/plugin-bre-to-cml/blob/main/src/commands/cml/convert/prod-cfg-rules.ts)_
123-
124123
## `sf cml import as-expression-set`
125124

126125
Imports CML and associations to the target org
127126

128127
```
129128
USAGE
130-
$ sf cml import as-expression-set -o <value> -x <value> -c <value> [--json] [--flags-dir <value>] [--api-version <value>] [-d <value>]
129+
$ sf cml import as-expression-set -o <value> -x <value> -c <value> [--json] [--flags-dir <value>] [--api-version <value>] [-d
130+
<value>]
131131
132132
FLAGS
133133
-c, --cml-api=<value> (required) Unique CML API Name to be created.
134134
-d, --workspace-dir=<value> Directory where converted CML and assocciations csv files are located.
135-
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org` configuration variable is already set.
135+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
136+
configuration variable is already set.
136137
-x, --context-definition=<value> (required) Context Definition name to be assocciated with the CML.
137138
--api-version=<value> Override the api version used for api requests made by this command
138139
@@ -151,9 +152,7 @@ DESCRIPTION
151152
- Upload the CML blob
152153
153154
EXAMPLES
154-
$ sf cml import as-expression-set --cml-api MY_TEST --context-definition PricingTransactionCD2 --workspace-dir data --target-org cmlTargetOrg
155+
$ sf cml import as-expression-set --cml-api MY_TEST --context-definition PricingTransactionCD2 --workspace-dir data --target-org tgtOrg
155156
```
156157

157-
_See code: [src/commands/cml/import/as-expression-set.ts](https://github.com/salesforcecli/plugin-bre-to-cml/blob/main/src/commands/cml/import/as-expression-set.ts)_
158-
159158
<!-- commandsstop -->

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/plugin-bre-to-cml",
33
"description": "Plugin for migrating BRE based configurator rules to CML.",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"salesforceRelease": "256.11",
66
"dependencies": {
77
"@oclif/core": "^4",

0 commit comments

Comments
 (0)