Understanding functions
When working with conceptual graphs, users often want to repeat a commonly required business action. For instance, calculate the average or maximum of a set of numbers. In the Behaviour Authoring Environment, this can be done using a function.
When creating a conclusion during the conclusion and justification process, the user is able to enter an expression that will be evaluated and displayed as the concept's literal. These expressions can be simple, using the built in arithmetic facilities, or they can use functions; these can be either provided by Erudine or custom functions created to fulfil domain-specific needs. The user of the Behaviour Authoring Environment is able to pass function parameters; these can be explicit strings or references to the literals of other concepts.
The behaviour of functions is fairly limited. They can accept only a fixed number of parameters and return a single result. Where behaviour that is more complex is required, for example summing all the bills in a situation, an action plug-in must be used.
The Erudine Behaviour Engine contains a number of standard functions ready to use with any knowledge model. The following table lists all the functions that are shipped with the Erudine Behaviour Engine.
| Name | Category | Description |
| Abs | Maths | Returns the absolute number, which is the number without a positive or negative sign. |
| Exp | Maths | Returns e raised to the power of a number. |
| Log10 | Maths | Returns the base 10 of a number. |
| Max | Maths | Returns the maximum number from a group of numbers. |
| Min | Maths | Returns the minimum number from a group of numbers. |
| Neg | Maths | Changes the sign of the number, from negative to positive or positive to negative. |
| Numberformat | Maths | Adds formatting to a number. |
| Power | Maths | Returns the result of a number raised to a power. |
| Round | Maths | Rounds up or down to the nearest whole number. |
| Sqrt | Maths | Returns the square root of a number. |
| Trunc | Maths | Rounds a number down to a specific decimal place. |
| Concat | Text | Joins text strings together to create one text string. |
| Lowercase | Text | Converts all text in a string into lowercase characters. |
| Replaceall | Text | Finds a string and replaces it with another string. |
| Stringformat | Text | Adds formatting to a string. |
| Substring | Text | Returns the specific characters within a string. |
| Trim | Text | Removes any white space before and after a string. |
| Uppercase | Text | Converts all text in a string into uppercase characters. |
| Datedayoffset | Date/Time | Adds a number of days to a date. The date can be formatted using the java.text.SimpleDateFormat class. |
| Dateformat | Date/Time | Adds formatting to a date, using the java.text.SimpleDateFormat class. |
| Dayofweek | Date/Time | Returns the day of the week. The date can be formatted using the java.text.SimpleDateFormat class. |
| Type | Concept | Returns the concept type. |
| Note Concept literals cannot be entered if they begin within either a plus |
Platform: all
EBE Version: 2.4
Category: Development Reference Guide
Author: Patrick Peisker