Customizing an intent resolver program

K2BTools employs an intent resolver program before invoking the intent resolver object. This program is responsible for mapping intention parameters, which can be either object parameters or session parameters. The intent resolver program determines the appropriate session keys to use and how the object's parameters can be utilized.

K2BTools' intent-based navigation includes three generic programs designed to handle the invocation of the intent resolver object:

  • IntentResolverWorkWith
  • IntentResolverEntityManager
  • IntentResolverWebPanelDesigner

These programs can be customized by developers, or new ones can be created. Each intent resolver program receives an Intent as a parameter, which is an SDT (Structured Data Type) containing:

  • IntentResolverName: to identify the intent in the Intent based navigation metadata
  • Parameters. : Parameters extracted by the LLM.

IntentSDT
Intent parameter SDT

Essentially, these programs perform the following tasks:

  • Identify the object that needs to be called.
    IntentProgramGetObject
    Getting intent resolver object to call

  • Determine which constants can be used as object parameters.
    IntentProgramGetContstant
    In case an entity manager the &TrnMode is declared as a constant of the intention

  • Iterate through the parameters. Depending on each parameter
    IntentProgramIterateParameters
    Iterating through the parameters

    • If it is an object parameter, it will be used to call the object.
      IntentProgramObjectParameter
      Adding parameters to the parameter list

    • If the parameter is a filter, it will be added to the GridState and this state will be set in the session, concerning the object that will be called.
      IntentProgramFilterParameter
      Adding filter to the state of the grid

    • If the parameter is an Attribute Default , it will be added to the TrnContext.
      IntentResolverAttributeDefault
      Adding a default value to an attribute

  • Call the object with the selected parameters
    IntentResolverCallingParameters
    In this case filter parameters are set in the GridState and object parametrs are used to call the object

What Can Be Customized?

Call the Intent Resolver with More Than Five Parameters

In the base code of the intent resolver, the maximum number of parameters the object supports when called is five. If more parameters are needed, developers can add an extra case for this purpose.

Case &Parameters.Count = 6
		&Parameter1 = &Parameters.Item(1)
		&Parameter2 = &Parameters.Item(2)
		&Parameter3 = &Parameters.Item(3)
		&Parameter4 = &Parameters.Item(4)
		&Parameter5 = &Parameters.Item(5)
		&Parameter6 = &Parameters.Item(6)
		Link(&ObjectName, &Parameter1, &Parameter2, &Parameter3, &Parameter4, &Parameter5, &Parameter6)

Use Parameter Encryption

If using encrypted URL parameters, the intent resolver code can be edited to add encryption to the link. This can be modified by appending !"_site_encryption" or !"session_encryption" after the link parameter, depending on the value of the encrypt URL parameter properties.

Case &Parameters.Count = 6
		&Parameter1 = &Parameters.Item(1)
		&Parameter2 = &Parameters.Item(2)
		&Parameter3 = &Parameters.Item(3)
		&Parameter4 = &Parameters.Item(4)
		&Parameter5 = &Parameters.Item(5)
		&Parameter6 = &Parameters.Item(6)
		Link(&ObjectName,!"_site_encryption", &Parameter1, &Parameter2, &Parameter3, &Parameter4, &Parameter5, &Parameter6)