|
An intent resolver defines how the system interprets and fulfills user intentions. Each intent resolver is characterized by the following components:
- Description of the intention it can resolve: Clearly explains the types of user queries or actions the resolver is designed to handle.
- ObjectName: The name of the object that resolves the intent.
- Set of constants: Predefined values that remain unchanged across different instances and are essential for the operation of the program.
- Set of parameters: Variables that may be derived from user input or other sources during execution.
A single GeneXus object can implement multiple intent resolvers, depending on the parameters involved.
Each parameter associated with an intention can be linked to a realm. A realm represents the domain of possible values that a parameter can take. For example, if a parameter is TeacherId (a foreign key), its realm consists of the records in the Teacher table. Similarly, if a parameter is ProductType and is based on an enumerated domain, its realm is the set of valid values defined by that domain. In GeneXus, a parameter is considered to be based on a realm if its values can be derived from a table or an enumerated domain. When the values can be derived from a table a description mapper is automatically generated by K2BTools to map values from descriptions.
To better illustrate these concepts, let's consider a practical example using an Education Application with a Course transaction.
In this scenario, each Course is assigned to a Teacher. The WWCourse object lists all courses, and users can filter the courses by teacher and course name. The page includes a dynamic combo box that allows users to select a teacher.
- Description of the intention it can resolve: Allows the user to view all instances of the Course entity.
- ObjectName WWCourse
- Set of constants: GridName = "Grid" (used interally by the program)
- Set of parameters:
- CourseName: Not based on any realm, as the user can input any value.
- TeacherId: Based on the realm att:TeacherId, as it must correspond to values from the Teachers table.
- Description of the intention it can resolve: Allows the user to create a new course.
- ObjectName: EntityManagerCourse
- Set of constants: Mode = "Insert"
- Set of parameters:
- TeacherId: Based on the realm att:TeacherId, as the user could assign the course to a specific teacher.
- Description of the intention it can resolve: Allows the user to delete a course.
- ObjectName: EntityManagerCourse
- Set of constants: Mode = "Delete"
- Set of parameters:
- CourseId: Based on the realm att:CourseId, as it must correspond to an existing course record.
These examples demonstrate how intent resolvers, parameters, and realms work together to provide flexible and context-aware navigation within an application.
|