Behavior Rules
Behavior Rules
Behavior Rules
are very flexible in structure to cover most use cases that you will come across. Behavior Rules
are clustered in Groups
. Behavior Rules
are executed sequential within each Group
. As soon as one Behavior Rule
succeeds, all remaining Behavior Rules
in this Group
will be skipped.
Groups
Type of Conditions
Each Behavior Rule
has a list of conditions
, that, depending on the condition
, might have a list of sub-conditions
.
If all conditions are true, then the Behavior Rule is successful and it will trigger predefined actions.
List of available conditions:
General Structure
conditions
are always children of either a Behavior Rule
or another condition
. It will always follows that same structure.
Description of condition structure
Input Matcher
The inputmatcher
is used to match user inputs. Not directly the real input of the user, but the meaning of it, represented by expressions
that are resolved from by the parser
.
Description
If the user would type "hello", and the parser resolves this as expressions "greeting(hello)
" [assuming it has been defined in one of the dictionaries], then a condition
could look as following in order to match this user input meaning:
This inputmatcher
condition
will match any expression
of type greeting, may that be "greeting(hello)
", "greeting(hi)
" or anything else. Of course, if you would want to match greeting(hello)
explicitly, you would put "greeting(hello)
" as value for the "expressions
" field.
Context Matcher
The contextmatcher
is used to match context
data that has been handed over to EDDI alongside the user input. This is great to check certain conditions
that come from another system, such as the day time or to check the existence of user data.
Description
Examples
Connector
The connector
is there to all logical OR
conditions within rules. By default all conditions are AND
conditions
, but in some cases it might be suitable to connect conditions with a logical OR
.
Description
Examples
Negation
Inverts the overall outcome of the children conditions
In some cases it is more relevant if a condition
is false
than if it is true
, this is where the negation
condition
comes into play. The logical result of all children together (AND
connected), will be inverted.
Example:
Occurrence
Defines the occurrence/frequency of an action in a Behavior Rule
.
Dependency
Check if another Behavior Rule
has met it's condition or not in the same conversationStep
. Sometimes you need to know if a rule has succeeded , dependency
will take that rule that hasn't been executed yet in a sandbox environment as a reference
for an other behavior rule.
Action Matcher
As inputMatcher
doesn't look at expressions but it looks for actions instead, imagine a Behavior Rule
has been triggered and you want to check if that action has been triggered before.
Dynamic Value Matcher
This will allow you to compile a condition based on any http request/properties or any sort of variables available in EDDI's context.
The Behavior Rule API Endpoints
The API Endpoints below will allow you to manage the Behavior Rule
s in your EDDI instance.
The {id}
is a path parameters that indicate which behavior rule you want to alter.
API Methods
Example
We will demonstrate here the creation of a BehaviorSet
Request URL
POST http://localhost:7070/behaviorstore/behaviorsets
Request Body
Response Body
no content
Response Code
201
Response Headers
Last updated