Create or Edit a Decision
Create a Decision
The sections below explain how to configure a decision using a use case that involves a business requirement made by our client, GoldBank. Goldbank wants to implement a gamification solution. This means that they want to set a rewards program ("GoldAwards") where app users will receive cashback that represents a percentage of the amount spent in each purchase made under specific circumstances. Then, they will receive that cashback as credit in their accounts. GoldBank gives you the dimensions catalog you need as input, and asks you to provide a potential program so they can review it. The main conditions set by GoldBank are that purchases must fall under the following conditions:
Must be made by app clients under the Silver, Gold, Black and Blanc profiles.
Must be online or in-store purchases.
The app must show different messages according to the amount spent:
If the purchase amount is equal to or higher than USD 5000, the message shown must be: You're doing great!
If the purchase amount is equal to or higher than USD 1000, the message shown must be: Goldgenius!
If the purchase amount is equal to or higher than 100, the message shown must be: Keep using the app to obtain Goldawards.
In addition, the client informs you the cashback percentage that applies to each purchase made. This is a set of specific reference numbers and you have to build the decision based on it:

Refer to the instructions below to learn how to configure the contract.

On the Decisions page, click + Create. First, you have to set the basic configuration of the decision that results in the decision contract (you will then see these data in the Decision contract tab). Only after you configure the contract, you will be able to configure the decision rules.
Complete the Basic info section. The ID and Description fields are mandatory.
In the ID field, enter the name that identifies the decision. For this example, enter GoldAwards_Program.
Note
The ID name cannot be modified in the future.
In the Description field, enter a text to describe the purpose of the decision. For this example, enter GoldAwards gamification solution that gives cashback to clients for each purchase under specific conditions.
In the Tags field, you can enter keywords that allow you and your team to easily identify the decision. For this example, enter the tags GamificationSolution and GoldAwards.
In the Strategy section, select the evaluation method that will be used by the BRMS console to determine the output of the decision rule or rules. Select one of the three strategies explained below, based on the following example: the decision contains three rules that define the points earned by the app users whenever they make different purchases; the first rule has 100 points as output, the second rule has 200 points as output and the third rule has 50 points as output.
Break
To make a decision and return a specific output, BRMS evaluates all the rules, from the first to the last (as ordered in the Decision rules list). Once the logic of one rule is satisfied (regardless of its order) BRMS stops evaluating the rules and gives the expected output or outputs set for that rule - this means that the rest of the rules won't be evaluated. That is to say, the decision results in the output set for the first rule whose conditions are met.
For the example above, if the first rule is not met, but the second is met, BRMS stops evaluating and the output would be 200 points.
Collect
To make a decision and return a specific output, BRMS evaluates all the rules set and returns a set of outputs per each rule whose conditions are met. Therefore, if there are three rules applied, and the three are fulfilled, the decision will return the accumulated three sets of outputs, one set per rule.
For the example above, if the first rule and the third rule are met, BRMS returns 100 points and 50 points, separately.
Collect merge
To make a decision and return a specific output, BRM evaluates all the rules and returns a single set of outputsfor all the rules whose conditions are met. For example, one group with all outputs together.
For the example above, if the first rule and the third rule are met, BRMS returns 150 points in a single set.
For example, a decision may have two rules. The first rule sets that, if the purchase falls under the selected category, the user obtains 100 points. The second rule sets that, if the purchase is made within 30 days after choosing the category, the user obtains 200 points. Therefore, once the decision is activated, the user John P. will obtain points based on his purchases. If this user selected the Clothing category on March 20th and purchased a dress on March 31st, it will earn points based on the strategy defined. If the strategy is Break, he will earn 100 points. If the strategy is Collect, he will earn 100 and 200 points. If the strategy is Collect-merge, he will earn 300 points.
For this example, based on GoldBank requirements, click Break. By choosing Break, BRMS will evaluate the rules from the first to the last, and, the first whose conditions are satisfied, will be the rule that gives the output that impacts on the app.
Then, you have to define the input of the decision, that can be dimensions or input values. These values will be then invoked from the Decision rules page.
In the Dimensions section, click the Select dimension drop-down menu and select the dimensions you want to make available for the decision rules. For this example, considering the project specifications previously described, the dimensions available are Purchase Type and Profile. Click the field and select Purchase_ type and then click again and select Profile.
The Profile dimension contains the values Silver, Gold, Black and Blanc and the Purchase Type dimension contains the values In-store and Online.
Note
The IT member in your project team will be in charge of uploading the dimensions to the BRMS backend.
In the Inputs section, define the input values of the decision (if applicable). The input or inputs defined will be applied to the logic of the decision, together with the dimensions. Click + to create the input value and complete as described below:
In the field that opens, enter the input name. For this example, enter Amount.
Click the icon to the right in the field(
) and select the data type: choose String if the value will be alphanumeric, for example, for the Purchase type dimension, the values can be Online or In-store; select Number if the value is a number, for example, for the Amount dimension, the values can be USD 100, USD 1,000 or USD 10,000; or Boolean if the value will be true or false, for example, for the Of age dimension, the values can be true or false.
For this example, select Number as data type. The values of the input will be defined in the decision rules.
In the Outputs section, define the result of the decision. The outputs defined will be applied to the logic of the decision, together with the dimensions. By default, an output field is created. Complete as described below:
In the field that opens, enter the output name. For this example, enter Cashback.
Click the icon to the right in the field(
) and select the data type. For this example, select Number as data type. The value of the output will be set in the decision rule.
Click + to add a new output and complete as follows.
In the field that opens, enter the output name. For this example, enter Message
Click the icon to the right in the field(
) and select the data type. The types function like in the case of inputs (explained in item 5. above). For this example, select String as data type. The value of the output will be set in the decision rule.
Click Save. The information configured will appear in the Decision Contract tab and the Decision Rules tab will appear available for configuration.
Important
The Decision Rules tab won't appear unless you save the new decision.
If you are creating a new decision, the Decision rules tab will only appear after you saved the contract previously described.
The decision rule sets the logic that must be evaluated by the BRMS to define a specific result, that will impact the app user. The decision can have one or more rules, that will be evaluated by the BRMS depending on the strategy defined in the contract (Break, Collect, Collect-merge). The logic of each rule includes the sentence WHEN
+ dimension(s) + IF
+ Condition + THEN
+ Output. The logic description would be the following:
dimensions:
when
the dimensions are satistified andcondition:
if
they occur under one or more specific circumstances,output:
then
the outcome for the app user will be the specified result.
These elements can be valid from and to a specific time period and can be activated or not.
When you set a new rule, you can define which dimensions are applied, the conditions that must be evaluated and the output that the executed rule will return. Refer to the instructions below to learn how to set a rule. These instructions explain how to configure all the rules applicable to the GoldAwards program, based on the decision contract configured above.

Note
The dimensions and output options that appear will depend on the configuration of the contract previously set.
By default, the table has one rule created. The first rule will be used to show the cashback and the message "You are doing great!", applicable to purchases amounting to 5000 or higher.
Go to the Dimensions section, where you define whether you want to set the rules to each dimension or a combination of dimensions, or to all of them. If you leave Any selected, the dimension applies to all operations. If you want to set a specific dimension to be considered, click the arrow and select it from the list.
For this example, in the Profile column, leave Any selected. This way, the rule applies to all profiles executing a transaction.
In the Purchase_type column, leave Any selected.
Go to the Conditions section, where you set the logic of the rule. This means that you have to define how the rule evaluates the dimensions and returns a value as output. In the Dimensions table, you set the logic considering that all the dimensions must be met so the rule is executed - hence, the logic states that the dimensions are combined by the AND conditional.
Important
To set a condition, you must have logic knowledge.
You can set a condition if you want to define logic that does not use the AND conditional alone, but a combination of other conditionals (such as IF, WHEN, OR, among others). The condition will be executed and return an output if the logic defined occurs. To set a rule condition, type @. A drop-down menu appears, and gives you options to enter a constant (@cons), an input (@input), a dimension (@dim), or the time variable. The time variable is used to evaluate a condition occurring at that moment (for example, whether at that moment is Monday or if it is 2 p.m.). To learn more about syntax, refer to the Rule Syntax section.
Note
You can use the condition as if you were using a dimension. For example, for the dimension card_type you can choose the value credit. To set the same logic as a condition, you must enter @dim.card_type = "credit". In both cases, the rule will evaluate whether the card type used in the transaction is a credit card.
For this example, in the Condition A column, enter @input.Amount >= 5000. This means that the rule will be applied if the amount of the purchase is equal to or higher than 5000.
Note
Make sure to leave spaces before and after the conditional, such as =, > or <.
Go to the Outputs section. In the Message column (the dimension previously set), enter "You're doing great!" .
Note
To enter a text, make sure to start and end it with "".
In the Cashback column, enter @input.Amount*@const.GoldAwards/100. This expression defines that, to obtain the cashback amount, BRMS will multiply the input amount for the data configured in the constant GoldAwards and then divide that result for 100, to obtain the cashback amount. To learn more about constants, read Create or Edit a Constant.
Go to the Validity section, where you can define from and up to which date the rules will be applied to make a decision and whether the rule is active or not. In the To and From columns, you can choose the respective dates. For example, in the case of a campaign that starts on March 2nd, and lasts for two weeks, you will configure the date from March 2nd to March 16th included. In that case, you have set the time frame and you won't need to manually activate the rule on March 2nd or deactivate it on March 16th. For this example, go to the From column, click the calendar icon and select April 1st.
Note
The From and To fields are not mandatory. You can choose a From date, a To date, both or none.
For this example, go to the To column. Click the calendar icon and select March 28, 2025. This means that BRMS will evaluate the rule from March 28th, 2025 onwards.
Go the Active column, where you can define whether the rule is activated or not. Each rule is set as Active by default. To deactivate a rule, click the toggle switch. An active rule is any rule that Active means that the rule is evaluated by BRMS when a transaction is executed. Inactive means that the rule cannot be applied, even if it has a time frame defined. For this example, leave the toggle switch enabled.
Click Add row (
). The new rule appears listed and you can complete its logic. The second rule will be used to show the cashback and the message "Goldgenius!", applicable to purchases amounting to 1000 or higher.
Go to the Dimensions section. For this example, in the Profile column, leave Any selected. This way, the rule applies to all profiles executing a transaction.
In the Purchase_type column, leave Any selected.
Go to the Conditions section. For this example, in the Condition A column, enter @input.Amount >= 1000. This means that the rule will be applied if the amount of the purchase is equal to or higher than 1000.
Go to the Outputs section. For this example, in the Message column (the dimension previously set), enter "tGoldgenius!".
For this example, in the Cashback column, enter @input.Amount*@const.GoldAwards/100.
Go to the Validity section. For this example, go to the To column. Click the calendar icon and select March 28, 2025. This means that BRMS will evaluate the rule from March 28th, 2025 onwards.
Go to the Active column, For this example, leave the toggle switch enabled.
Click Add row (
). The new rule appears listed and you can complete its logic. The second rule will be used to show the cashback and the message "Keep using the app to obtain GoldAwards", applicable to purchases amounting to 100 or higher.
Go to the Dimensions section. For this example, in the Profile column, leave Any selected. This way, the rule applies to all profiles executing a transaction.
In the Purchase_type column, leave Any selected.
Go to the Conditions section. For this example, in the Condition A column, enter @input.Amount >= 100. This means that the rule will be applied if the amount of the purchase is equal to or higher than 100.
Go to the Outputs section. For this example, in the Message column (the dimension previously set), enter "Keep using the app to obtain GoldAwards".
For this example, in the Cashback column, enter @input.Amount*@const.GoldAwards/100.
Go to the Validity section. For this example, go to the To column. Click the calendar icon and select March 28, 2025. This means that BRMS will evaluate the rule from March 28th, 2025 onwards.
Go to the Active column, For this example, leave the toggle switch enabled.
Click Add row (
). The last rule will be the default rule. This means that, if none of the three rules above is satisfied, BRMS will return no message and the cashback will be 0.
Go to the Dimensions section. For this example, in the Profile column, leave Any selected. This way, the rule applies to all profiles executing a transaction.
In the Purchase_type column, leave Any selected.
Go to the Conditions section. For this example, in the Condition A column, leave Any selected.
Go to the Outputs section. For this example, enter "". This indicates that a text should be shown - however, since the user is not receiving any cashback, there will be no message (and the app won't show an error).
For this example, in the Cashback column, enter 0.
Go to the Validity section. For this example, go to the To column. Click the calendar icon and select March 28, 2025. This means that BRMS will evaluate the rule from March 28th, 2025 onwards.
Go to the Active column, For this example, leave the toggle switch enabled.
To add more rules, click Add row (). If you need to create a similar rule with minor differences, click Duplicate row (
) and make the required changes.
If you no longer require a rule, you can click the Active toggle to deactivate it or directly click Remove row () to delete it.
Lastly, you can click Re-order row ( ) and drag it up or down to move the rule within the list - this organizes the rules and how they are executed by BRMS.
How does BRMS evaluate rules?
When a rule is executed, BRMS checks its configuration in steps: first, it checks whether the rule is Active or not. If it is inactive, the rule is disregarded. If the rule is active, it checks whether it has a timeframe specified: if the time frame is set, it will be executed only upon that date; if there is no time frame, the rule will be executed. This means that BRMS only executes rules that are valid - that is to say, rules that are active and, within the time frame specified (if applicable).
Once the Decision rules page opens, you can see the information configured to create the rules. Click + Quick access to see the inputs created for your decision and all constants created in the environment you are working. You can see their values and click Copy ( ) to then paste them in the rules syntax.
You can also use the Simulate decision feature to see the results of the rules once the BRMS evaluates them. To learn more, read Simulate a Decision.
Rule syntax
The list below describes the logic elements that can be invoked in the condition section of a rule.
@input.<input_name>
: invokes the input value used to evaluate the decision@dim.<dimension_name>
: invokes the dimension value used to evaluate the decision.@time.<time>
: invokes the time value used to evaluate the decision.@default
: special word used to reference the default value when expressly invoking a constant.@const.<value_constant_name>
: uses a value constant.@const.<vector_or_matrix_constant_name
: uses a vector or matrix constant inferring the dimension values from the decision, if a dimension is not used in the decision definition, it uses the default value.@const.<vector_constant_name>(@dim.<dimension_name>|@default|string)
: explicitly gets a constant value, using a @dim reference, the @default value or a specific string.@const.<matrix_constant_name>(@dim.<dimension_name>|@default|string, @dim.<dimension_name>|@default|string)
:
In addition, you can use different conditionals that allow you to combine the logic elements mentioned above. Refer to the list below to learn more:
-
: add or concatenate strings*
: substract*
: multiply/
: divide^
: power%
: module==
: equal to!=
: not equal to<
: less than>
: greater than<=
: less than or equal to>=
: greater than or equal toand
or
to
Edit a Decision
To edit a decision, go to the Decisions page. Go through the list to find the decision you want to edit or use the search bar and click it. The decision opens in the Decision contract tab, where you can edit all fields unless the decision ID. To make changes to the rules, click Decision rules and make any required changes. Then, click Save.
Simulate a Decision
The Decision rules page allows you to simulate the evaluation of the rules defined by setting the inputs and dimensions and visualizing the final output - that is to say, the result that will impact on the user when they execute a transaction in the app under those specific conditions.
The instructions below explain how to use the Simulate decision feature. The example follows the GoldAwards program described in the Create or Edit a Decision article. In this case, you need to simulate the amount of cashback that a user receives if: the user has a Gold profile, and the purchase was made in a store and for an amount of USD 100.
In the Decision rules page, click Simulate decision.
In the Inputs section, you only have the Amount input. Enter the value 100.
In the Dimensions section, you have the Profile and the Purchase type dimensions.
In the Profile drop-down menu, select Gold.
In the Purchase type drop-down menu, select In-store.
Click Run.
The Outputs section will show the cashback amount in USD based on the amount of the purchase and the percentage set in the Constant values. In this case, the constant value applicable is 1, so the output value is 1 - that is to say, the user will receive USD 1 as cashback.