@@ -61,6 +61,8 @@ sf plugins
6161<!-- commands -->
6262
6363- [ ` sf cml convert prod-cfg-rules ` ] ( #sf-cml-convert-prod-cfg-rules )
64+ - [ ` sf cml convert surcharge-rules ` ] ( #sf-cml-convert-surcharge-rules )
65+ - [ ` sf cml convert underwriting-rules ` ] ( #sf-cml-convert-underwriting-rules )
6466- [ ` sf cml import as-expression-set ` ] ( #sf-cml-import-as-expression-set )
6567
6668## ` sf cml convert prod-cfg-rules `
@@ -120,6 +122,83 @@ EXAMPLES
120122 $ sf cml convert prod-cfg-rules --pcr-file data/ProductConfigurationRules.json --cml-api MY_TEST --workspace-dir data --target-org breMigOrg
121123```
122124
125+ ## ` sf cml convert surcharge-rules `
126+
127+ Converts BRE-based Product Surcharge dynamic rules to CML eligibility constraints.
128+
129+ ```
130+ USAGE
131+ $ sf cml convert surcharge-rules -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-c <value>] [-d <value>]
132+ [--update-records] [-f <value>]
133+
134+ FLAGS
135+ -c, --cml-api=<value> CML API Name. If omitted, auto-discovers an existing CML associated with the same root
136+ products.
137+ -d, --workspace-dir=<value> Directory where output files will be written.
138+ -f, --surcharge-file=<value> Optional JSON file with pre-exported ProductSurcharge records. If omitted, records are
139+ queried from the org.
140+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
141+ configuration variable is already set.
142+ --api-version=<value> Override the api version used for api requests made by this command
143+ --update-records Update source records in the org with RuleEngineType=ConstraintEngine.
144+
145+ GLOBAL FLAGS
146+ --flags-dir=<value> Import flag values from a directory.
147+ --json Format output as json.
148+
149+ DESCRIPTION
150+ Converts BRE-based Product Surcharge dynamic rules to CML eligibility constraints.
151+
152+ Reads ProductSurcharge records from the org (or a JSON file), parses their RuleDefinition, and generates CML
153+ constraints that evaluate surcharge eligibility. Each surcharge rule becomes a named constraint that returns
154+ true/false. The command outputs a .cml file with the constraint model, an \_Associations.csv file for
155+ ExpressionSetConstraintObj records, and a \_RuleKeyMapping.json with the ProductSurcharge ID to RuleKey mapping for
156+ updating records.
157+
158+ EXAMPLES
159+ $ sf cml convert surcharge-rules --cml-api SURCHARGE_CML --target-org myOrg
160+
161+ $ sf cml convert surcharge-rules --cml-api SURCHARGE_CML --surcharge-file path/to/surcharges.json --workspace-dir data --target-org myOrg
162+ ```
163+
164+ ## ` sf cml convert underwriting-rules `
165+
166+ Converts BRE-based Insurance Underwriting dynamic rules to CML eligibility constraints.
167+
168+ ```
169+ USAGE
170+ $ sf cml convert underwriting-rules -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-c <value>] [-d <value>]
171+ [--update-records] [-f <value>]
172+
173+ FLAGS
174+ -c, --cml-api=<value> CML API Name. If omitted, auto-discovers an existing CML associated with the same root
175+ products.
176+ -d, --workspace-dir=<value> Directory where output files will be written.
177+ -f, --uw-file=<value> Optional JSON file with pre-exported UnderwritingRule records. If omitted, records are
178+ queried from the org.
179+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
180+ configuration variable is already set.
181+ --api-version=<value> Override the api version used for api requests made by this command
182+ --update-records Update source records in the org with RuleEngineType=ConstraintEngine.
183+
184+ GLOBAL FLAGS
185+ --flags-dir=<value> Import flag values from a directory.
186+ --json Format output as json.
187+
188+ DESCRIPTION
189+ Converts BRE-based Insurance Underwriting dynamic rules to CML eligibility constraints.
190+
191+ Reads UnderwritingRule records from the org (or a JSON file), parses their DynamicRuleDefinition, and generates CML
192+ constraints that evaluate underwriting eligibility. Each rule becomes a named constraint that returns true/false. The
193+ command outputs a .cml file with the constraint model, an \_Associations.csv file for ExpressionSetConstraintObj
194+ records, and a \_RuleKeyMapping.json with the UnderwritingRule ID to RuleKey mapping for updating records.
195+
196+ EXAMPLES
197+ $ sf cml convert underwriting-rules --cml-api UW_CML --target-org myOrg
198+
199+ $ sf cml convert underwriting-rules --cml-api UW_CML --uw-file data/underwriting.json --workspace-dir data --target-org myOrg
200+ ```
201+
123202## ` sf cml import as-expression-set `
124203
125204Imports CML and associations to the target org
0 commit comments