Configuring the widget manually
When you add a widget to Homepages, you are prompted to either upload a widget or configure a widget.
To configure a widget:
- Click Configure to launch the wizard. .
-
2 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 prediction immediately. Toggle Off to display the prediction after the user request. A button option will be 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 ION API input
parameters:
This screen defines input parameters and path variables that allow configuration of dynamic values used as an input for ION API. Each parameter must have a source property specified. For ION API, these are the sources:
- IBC message: values defined in the 1st step of the configuration - Infor Business Context
- Helper function: currently available helper functions: 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 will be used to fill ION API path value and request method.
- ION API Path
- Specify the ION API operation to be called. The path starts with slash. If the path contains any path variables, they should be specified within curly brackets, for example, /api/{variable}).
- httpMethod
- Select the request method from the drop-down menu. After you select the request method, such as POST or PUT, additional configuration is displayed for the input parameters.
-
Optionally, specify this information for ION API
- Name
- Specify a user defined alias for the parameter. output parameters:
- Path
- Specify a configuration that defines which value to be used in the widget resulting from the ION API. This value can be a string or dot notation.
-
Optionally specify these Coleman 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 Coleman prediction.
- Source
- Specify the source. This is defined similarly to ION API input parameters. There is a difference of an extra source, for example, the output parameters of ION API can be used as input to the Coleman API.
- Name
- Specify a name based on the selected source. The options will vary based on the configuration in the previous steps.
-
Optionally, specify these Coleman data transformations if
an available Coleman API is used.
- Transformer name
- Specify a name for the transformer. This name will be available to select in the Visualization section.
- ION API Path
- Specify the ION API Path. The path has the same configuration that was used in Step 4.
- Request method
- Select a request method from the drop-down list.
- 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 will find all variables that are wrapped with double curly braces, for example, {{ variable }}. Variable refers to the alias in the ION API 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 will be stripped out or sanitized. If you want to use the original value, the variable {{originalValue}} is available. This value will be determined at runtime based on which field the transformer is used. See the visualization step.
-
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.
- 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 Coleman 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 and id1 through idX.
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 you click Save, you can preview and download the configuration.
-
Click Text 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 will apply 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.