In addition to fields and rules, calculations comprise the entity's data structure. Calculations are a special type of rule that are "always on". Whenever other fields, calculations, or rules that the calculation is dependent on change, the rule engine will recalculate the calculation rule's value.
Use calculations to create values that are the result of arithmetic operations, expressions, conditional statements, function calls, etc. InRule features a spreadsheet-like syntax for creating the logic, conditions, and expressions used for calculations and rules. Once created, your applications can leverage these potentially complex calculations by name for display or use within other processes.
Calculations are most appropriate when there is benefit to referencing a given expression in multiple places or when you want to define a value in output state via a single expression, and when the rule expression is relatively simple.
Adding a calculation
Right-click on the element to which you want to add to. Select Add -> Calculation
Deleting a calculation
There are a few ways to do this:
- Right-click on the calculation you wish to delete, and select Delete.
- Click on the calculation you wish to delete and click Delete on the Home Banner.
- Click on the calculation you wish to delete and hit the [Delete]
You will be prompted to confirm the deletion. Click Yes.
Settings
Name
Specifies the name of the calculation.
Display Name
Specifies the name that will be used in the business language editor when referring to this field.
Data Type
Specifies the data type of the field. The available options are:
- Text
- Integer
- Date
- Datetime
- Decimal
- Boolean
- Complex
- Entity
Expression
Specifies the expression that will be evaluated when rule and calculations are run.
Clicking on the button will display the Expression editor.
Clicking on the button will switch between InRule syntax and business language syntax.
Vocabulary
Clicking on the hyperlink will navigate to the Vocabulary folder for the entity in which this calculation is contained. Any calculation may have one or more classifications associated with it, such as a “Young” classification for an “Age” field meaning < 30 years.
Constraints
Any calculation may have one or more Constraints associated with it, which will automatically be enforced for any data that is set for the calculation. When a Constraint is violated, InRule triggers a validation message containing information about the field and Constraint that is in violation. Clicking on the Constraint hyperlink will navigate to the Constraints for the entity in which this calculation is contained.
Related Topics
Comments
0 comments
Please sign in to leave a comment.