View this page in the latest version of Appian. Create a Decision Share Share via LinkedIn Reddit Email Copy Link Print On This Page Overview This page explains how to create and configure a decision object. If you're looking for detailed design information, see Decision Object and Appian Decisions. If you're familiar with decisions or decision tables, you can skip to Create a new decision. What is a decision? A decision is a design object that allows you to capture business rules and logic in a decision table. A decision table takes input values, looks for matching rows in a table, and returns the outputs associated with the matching rows. For example, to determine the legal drinking age: A decision object in Appian can capture the rules of decision table in an equally readable format: Tip: In our example, we use the from operator for the range 19-20. This operator evaluates an inclusive range of values so if we applied it to the range of 1-3, the numbers 1, 2, and 3 would be evaluated in our rule. If we used the between operator, which evaluates an exclusive range of values, only the number 2 would be evaluated in our rule. Create a new decision To create a decision object: In your application, go to the Build view. Click NEW > Decision. In the Create Decision dialog, configure the following: Property Description Name The name that is used when evaluating the decision. Descriptions A short description about the decision object. Save In The rule folder that the decision is saved into. Click CREATE. After creating your new decision object, you will see a prepopulated table with four rows, two blank input columns, one blank output column, and a notes column. Select a hit policy The hit policy specifies how your decision evaluates overlapping rules. Each hit policy defines what outputs will be returned when the decision is evaluated: Unique: Returns outputs for only one possible match. All rows must be unique. First: Only returns outputs for the first match. Rule Order: Returns outputs for all matches in rule order. The default hit policy for a new decision is Unique. To change the hit policy: In the decision object, click the U to open the hit policy dropdown. Select the hit policy. Click SAVE CHANGES. Configure inputs Every decision object requires at least one input. When you create a new decision, the table will be populated with two inputs. You can edit the existing inputs, or add your own. You can add as many inputs as you need. If needed, you can also delete inputs. You can also add Descriptions to the inputs, which can be used to share important information with developers. Information might include examples, standardized values, or whether the input is required. Edit an existing input To edit an existing input: From the top of any input column, click and select Edit Input. In the Edit Input dialog, edit the following properties as needed: Property Description Name The name of the input. This name will appear as the title of the column. Description Used to share important information with developers. Information might include examples, standardized values, or whether the input is required. Type The data type of the input. Use a dropdown… Determines whether you can select input values based on a predefined set of values, or whether you can manually enter them. By default, this option is not selected. Click OK. Add a new input To add a new input: From the top of any input column, click and select Add Input. In the New Input dialog, configure the following properties: Property Description Name The name of the input. This name will appear as the title of the column. Description Used to share important information with developers. Information might include examples, standardized values, or whether the input is required. Type The data type of the input. Use a dropdown… Determines whether you can select input values based on a predefined set of values, or whether you can manually enter them. By default, this option is not selected. Click CREATE. The new column will appear to the right of the existing column. Note: Columns can be reordered by clicking on the column and selecting Move Right or Move Left. Delete an input To delete an input: From the top of any input column, click and select Delete. In the Delete Input? dialog, click DELETE INPUT. Configure outputs Every decision object requires at least one output. When you create a new decision, the table will be populated with one output. You can edit the existing output, or add your own. You can add as many outputs as you need. If you have multiple outputs, the result will return a dictionary. Edit an existing output To edit an existing output: From the top of any output column, click and select Edit Output. In the Edit Input dialog, edit the following properties as needed: Property Description Name The name of the input. This name will appear as the title of the column. Type The data type of the input. Select the Array (multiple values) checkbox if your output has multiple values. Use a dropdown… Determines whether you can select input values based on a predefined set of values, or whether you can manually enter them. By default, this option is not selected. Click OK. Add a new output To add a new output: From the top of any output column, click and select Add Output. In the New Output dialog, configure the following properties: Property Description Name The name of the input. This name will appear as the title of the column. Type The data type of the input. Select the Array (multiple values) checkbox if your output has multiple values. Use a dropdown… Determines whether you can select input values based on a predefined set of values, or whether you can manually enter them. By default, this option is not selected. Click CREATE. Delete an output To delete an output: From the top of any output column, click and select Delete. In the Delete Output? dialog, click DELETE Output. Add decision rules After creating your input and output columns, you can now add your decision rules to the table one row at a time. To add a decision rule: In the first row of each input column: Use the dropdown to select an operator. Depending on the data type of the input, the operator values will differ. Enter a value. In the first row of each output column, determine the value to return based on the results of the inputs. In the Notes column, add any relevant information. This column will not be evaluated in the decision, it is used for reminders or descriptions for you and other developers. Click + Add New Row to add another decision rule. Click Duplicate Row to duplicate a decision rule. Click Move Up or Move Down to change the order of your decision rules. Note: This might be necessary if your decision has a hit policy of Rule Order or First. Click Delete Row to remove a decision rule. For example, the first decision rule in the table below determines that if a person is below 18 and they are from any country, they cannot be served alcohol. Test your decision Testing will check your decision logic in real time. Not only does the decision table provide feedback about any gaps in your logic, it also validates any overlapping rules depending on the hit policy of the decision. For more information, see Design Guidance. To test your decision: In the Test Inputs pane, enter sample values for your input fields. Click Test. The Test Output section populates with the type and value of the output. If the logic passes, the decision table will highlight the matching rules in green. For example, entering the following test values return an expected output: If there is an error, the conflicting rules will be highlighted in red. For example, the following decision table uses a Unique hit policy, but there are two decision rules with the same inputs. When you test the decision, the test output and table will notify you that there are rules with overlapping logic. Use a decision in other expressions Decisions can be called from any expression, so they can be reused across multiple objects throughout the system. Decisions are similar to other Appian rules. You can call a decision in an interface or process model by using the rule! domain. In the example below, we are passing three parameters in the rule because our decision has three inputs: age, state, and isMarried. Note: Decisions must use keywords when passing in parameters. 1 rule!IQ_determineCarInsuranceQuote(age: pv!age, state: pv!state, isMarried: pv!isMarried) Feedback Was this page helpful? SHARE FEEDBACK Loading...