Configuring the widget manually
When you add a widget to Homepages or workspaces, you are prompted to either upload a widget or configure a widget.
To configure a widget:
- Click Configure to launch the wizard.
-
Specify this information for the Infor Business Context
parameters:
- Context name
- Specify the type or namespace of the message sent. The default value is InforBusinessContext.
- Automatically predict upon receiving IBC message
- Toggle On to display the response immediately. Toggle Off to display the response after the user request. A button option is` available in the contextual application.
- Entity property
-
Specify a property in the IBC message. For example, id1, id2. Entity property values must be unique for the same entity type.
Note: The in-context application will only perform the operation if the received IBC message type matches the context name, it has a defined entity type, and all defined IBC parameters have a value. - Name
- Specify a name for later use in the configuration. For example, specify VendorID.
- Entity Type
- Specify the entityType coming from the IBC message. For example, specify vendorItemMaster.
-
Optionally, specify this information for the API Gateway
input parameters:
This screen defines input parameters and path variables that allow configuration of dynamic values used as an input for API Gateway. Each parameter must have a source property specified. For API Gateway, these are the sources:
- IBC message: values defined in the first step of the configuration - Infor Business Context
- Helper function: The helper functions are: current day, current month, current year and custom value
- Products and Operations
- Specify the controls that are used to help the user find the desired API to call. The selected operation is used to fill the API Gateway path value and request method.
- ION API Path
- Specify the API Gateway operation to call. The path starts
with a slash. If the path contains any path variables, they should
be specified within curly brackets. For example,
/api/{variable}
. - httpMethod
- Select the request method. After you select the request method, such as POST or
PUT, additional configuration is displayed for the input parameters.
You can define a variable in a POST request. Click Check for variables and select Infor Business Context or helper Function from the list.
-
Optionally, specify this information for API Gateway:
- Name
- Specify a user defined alias for the parameter.
- Path
- Specify a configuration that defines which value to be used in the widget resulting from the API Gateway. This value can be a string or dot notation.
-
Optionally, specify these Infor AI API
parameters:
- Endpoint name
- Search for and select the endpoint to call. After you select the endpoint, the input parameters count will be defined to match the endpoint schema.
- Input parameters
- The input parameters allow you to configure values used as an input payload to the Infor AI prediction.
- Source
- Specify the source. This is defined similarly to the API Gateway input parameters. There is a difference of an extra source. For example, the output parameters of API Gateway can be used as input to the Infor AI API.
- Name
- Specify a name based on the selected source. The options vary based on the configuration in the previous steps.
-
Optionally, configure the Decision Manager API parameters. When using the
Decision Manager API, the configuration for Infor AI data
transformations and visualization are disabled.
- Endpoint name
- Search for and select the Plans endpoint to call and configure the input parameters. Currently, Recommendation Feedback plans are supported.
- Use Description
- Select this option if the output of the Infor AI API includes item descriptions.
- Cache Name
- This is the top-level grouping used for reading and writing the feedback. This can be a single value or multiple values from the business context. For example, if the business context contains an entity representing the customer, this can be used to group all feedback for that customer. If the context includes a warehouse or store entity, you can include those as part of the cache name. This constrains the feedback to be specific for only that context.
- Base Key
- Similar to Cache Name, this represents a second level for
grouping the feedback. For example, warehouse, store, or user ID can
be used here.
By default, all feedback is specific to the Item from the context and each associated recommended item from the Infor AI API endpoint.
- Snooze Intervals
- Three intervals can be defined: short, medium, and long. For each interval, select a time unit. For example, days, weeks, or months. Then, specify the number for that time unit.
-
Optionally, specify any data transformations if an available Infor AI API is used.
- Transformer name
- Specify a name for the transformer. This name is available to select in the Visualization section.
- ION API "Required"
- Toggle this field on to make an API Gateway call to use interpolations.
- ION API Path
- Specify the API Gateway path. The path has the same configuration that was used in Step 4.
- Request method
- Select a request method.
- Format result
- The format result determines how a formatted result should
be displayed. These are the two options:
- Interpolation: A text in the result input finds all
variables that are wrapped with double curly braces. For
example,
{{ variable }}
. Variable refers to the alias in the API Gateway output names. - Let the transformer define its own HTML to be shown in the contextual app.
Note: JavaScript is not allowed and any script tags or JavaScript code are stripped out or sanitized. If you want to use the original value, the{{originalValue}}
variable is available. This value is determined at runtime based on which field the transformer is used. See the Visualization step.Note: The{{originalValue}}
variable is available when the ION API "Required" field is toggled on. - Interpolation: A text in the result input finds all
variables that are wrapped with double curly braces. For
example,
When the ION API "Required" field is toggled off in Infor AI data transformations, you can use the
{{predictionIndex}}
variable to pull the Infor AI API response values in the HTML transformer. This replaces the response indexes with corresponding values during the widget visualization.Make sure to toggle Transform to HTML while using it. For example, a general notation of
{{predictionIndex}}
can be:{{predictionIndex}}+n
Where
n
is a positive integer from 0 to Infor AI API response length - 1.When the widget renders the visualization, the displayed index is computed by adding
n
to the prediction index.Use this syntax to pull multiple Infor AI API response values transformed to HTML.
The final index computed should not point to a non-existing index in the Infor AI response.
-
Specify the Message publishing parameters:
- IBC Publisher name
- Specify the name of the publisher. This name can be used in the Visualization step to assign the publisher to a part of the in-context application interface.
- Context name
- Specify the name that is used as a namespace of the IBC message being sent from the in-context application to the parent window. This field is required. The recommended default value is inforWidgetContext.
- Trigger publish
- Select a value that determines how to trigger the endpoint response publishing. You can select a Single click or a Double click.
- Message to publish
- Specify the message to publish. This must be a valid JSON string where the
variable interpolation is supported with double curly braces. For
example,
{{variable}}
after the correct format message is available in the input.
-
Click Check for variables to load
all used variables. After you check the variables, the value of each variable
can be configured.
Note: If the publisher wants to send the IBC message for another generic Infor AI API application, the message must be formatted as an IBC message. It must have a property entity as an array, because the in-context application only checks entities array in the IBC message and looks for
entityType
andid1
throughidX
. For example:{ "entities": [{ "entityType": "<entityType>", "id1": "{{originalValue}}" }] }
-
Specify these Visualization parameters:
-
Specify these fields to configure the Metadata display:
- Display label
- Prediction index
- Source
- Transform value
- Business context publishing
- Display label
- Name
- Source
- Business context publishing
-
Specify these fields for the Primary
display. The primary display can be prefixed and
suffixed.
- Display label
- Prediction index
- Source
- Transform value
- Business context publishing
- Prefix
- Suffix
-
Specify these fields for the Secondary
display. The secondary display can be prefixed and
suffixed.
- Display label
- Prediction index
- Source
- Transform value
- Business context publishing
- Prefix
- Suffix
Note: If you do not configure a primary or a secondary display, the metadata display is used for the available space of the widget. -
Specify these fields to configure the Metadata display:
- Click Save. After saving, you can preview and download the configuration.
-
Click Test configuration to test
the widget before you use it as an in-context application. You can apply hard
coded values for the configured IBC messages. The test of the widget performs
the same logic that applies for the in-context application after it receives an
IBC message in the desired format.
Note: The toolbar is only available in the widget and is hidden in the in-context application.