• Back to Glue42 Enterprise Docs
Glue42 enterprise documentation

Reference Documentation

  • Back to Glue42 Enterprise Docs
Press/
  • Glue
  • App Management
  • App Preferences
  • Channels
  • Connection
  • Cookies
  • Displays
  • Hotkeys
  • Intents
  • Interop
  • Layouts
  • Logger
  • Metrics
  • Notifications
  • Pub Sub
  • Shared Contexts
  • Themes
  • Windows
  • Workspaces

Intents

5.23.0

In certain workflow scenarios, your app may need to start (or activate) a specific app. For instance, you may have an app showing client portfolios with financial instruments. When the user clicks on an instrument, you want to start an app which shows a chart for that instrument. In other cases, you may want to present the user with several options for executing an action or handling data from the current app. The Intents API makes all that possible by enabling apps to register, find and raise Intents.

The Intents API is accessible through the glue.intents object.

APIobject

Description

Intents API

Available since version Glue42 3.9

Properties

Property Type Default Required Description
resolver Resolver

API for controlling the Intents Resolver UI app.

Methods

  • all
  • find
  • raise
  • register

allmethod

Signature

() => Promise<Intent[]>

Description

Retrieves all registered Intents.

findmethod

Signature

(intentFilter?: string | IntentFilter) => Promise<Intent[]>

Description

Retrieves Intents by a specified filter. If no filter is supplied, all available Intents will be retrieved.

Parameters

Name Type Required Description
intentFilter string | IntentFilter

can be the intent name or a IntentFilter filtering criteria.

raisemethod

Signature

(request: string | IntentRequest) => Promise<IntentResult>

Description

Raises an intent.

Parameters

Name Type Required Description
request string | IntentRequest

The name of the Intent to raise, or an IntentRequest object holding settings for targeting Intent handlers, passing context, app start options and more.

registermethod

Signature

(intent: string | AddIntentListenerRequest, handler: (context: IntentContext) => any) => Promise<{ unsubscribe: UnsubscribeFunction; }>

Description

Registers an Intent handler. If your app is already registered as an Intent handler through its configuration, use this method to supply a handler for the specified Intent. Otherwise, you can use it to register your app as an Intent handler dynamically at runtime. Dynamically registered Intent handlers share the life span of the respective app instance.

Parameters

Name Type Required Description
intent string | AddIntentListenerRequest

The name of the Intent to be handled, or an object specifying the Intent name and additional settings for handling the Intent.

handler (context: IntentContext) => any

Handler function for the raised Intent.

AddIntentListenerRequestobject

Description

Object used for defining Intents dynamically. Dynamically registered Intent handlers share the life span of the respective app instance.

Properties

Property Type Default Required Description
contextTypes string[]

The types of predefined data structures with which the app can work.

description string

Description for the Intent.

displayName string

The human readable name of the Intent. Can be used in context menus or other UI elements to visualize the Intent.

icon string

Icon for the Intent to be displayed in a UI.

intent string

Name of the Intent to register.

resultType string

The type of predefined data structure which the Intent handler returns.

Configobject

Description

Global Intent API settings.

Properties

Property Type Default Required Description
enableIntentsResolverUI boolean true

If true, will enable using the Intents Resolver UI for handling raised Intents. The Intents Resolver UI provides the user with a list of all available apps and running instances which can handle the raised Intent. In case there is only one Intent handler available, it will be automatically selected for handling the raised Intent, without displaying the Intents Resolver UI to the user.

intentsResolverAppName string

Specify the name of your custom Intents Resolver app to be used for raised Intents. If not provided, the Intents API will use the default Intents Resolver UI app.

methodResponseTimeoutMs number 60000

Interval in milliseconds to wait for a response from Intents Resolver UI.

Intentobject

Description

Describes an Intent.

Properties

Property Type Default Required Description
handlers IntentHandler[]

Collection of objects describing Intent handler implementations for the Intent.

name string

Name of the Intent.

IntentContextobject

Description

Describes the predefined data structure that will be passed to an Intent handler.

Properties

Property Type Default Required Description
data { [key: string]: any; }

Data passed as an argument to the Intent handler implementation.

type string

Type of the predefined data structure.

IntentFilterobject

Description

Filter for retrieving Intents.

Properties

Property Type Default Required Description
contextType string

The type of predefined data structure with which the Intent handler works.

name string

Name of the Intent to retrieve.

resultType string

The type of predefined data structure which the Intent handler returns.

IntentHandlerobject

Description

Describes an Intent handler implementation.

Properties

Property Type Default Required Description
applicationDescription string

User-friendly description of the app, as specified in the app configuration.

applicationIcon string

Icon of the app that has registered the Intent handler, as specified in the app configuration.

applicationName string

Name of the app that has registered the Intent, as specified in the app configuration.

applicationTitle string

Title of the app that has registered the Intent, as specified in the app configuration.

contextTypes string[]

The types of predefined data structures with which the Intent handler works.

displayName string

The human readable name of the Intent, as specified in the Intent definition.

instanceId string

ID of the running app instance.

instanceTitle string

Title of the window of the running app instance.

resultType string

The type of predefined data structure which the Intent handler returns.

type "app" | "instance"

The type of the Intent handler - an app declared as an Intent handler via its configuration, or a running instance of an app. Dynamically registered Intent handlers are also counted as running instances.

IntentRequestobject

Description

Describes a request for raising an Intent.

Properties

Property Type Default Required Description
context IntentContext

Context data that will be provided to the Intent handler.

handlers IntentHandler[]

Collection of Intent handlers that can be presented to the user via an Intents Resolver UI. If there isn't an Intents Resolver app available (or if the list consists of only one handler), the first member of the collection will be used as an Intent handler.

intent string

Name of the intent to raise.

options ApplicationStartOptions

ApplicationStartOptions object that will be passed to a newly started app instance, if such is to be used as an Intent handler.

target "startNew" | "reuse" | { app?: string; instance?: string; }

Target for the raised Intent. Use "startNew" to start a new instance of the first available Intent handler. Use "reuse" to reuse the first available running instance of an Intent handler. Will fall back to "startNew" if there are no running instances available. Use an object with optional app and instance properties to target specific apps or app instances. The app property accepts an app name, the instance property - an ID of a running app instance. Provide a value for the app property to start a new instance of a specific Intent handler app. Provide a value for the instance property to reuse a specific running instance of an Intent handler. If both app and instance are set, instance will take precedence.

timeout number 90000

Interval in milliseconds to wait for the raise() method to resolve when raising an Intent.

Available since version Glue42 3.21
waitUserResponseIndefinitely boolean false

If true, the framework will wait for the user to choose a handler for the raised Intent from the Intents Resolver UI before starting the timeout specified in the timeout property of the Intent request. Otherwise, the timeout will start when the raise() method is invoked.

Available since version Glue42 3.21

IntentResultobject

Description

Describes the result from a raised Intent.

Properties

Property Type Default Required Description
handler IntentHandler

The Intent handler implementation used for handling the Intent.

request IntentRequest

The IntentRequest object that was used for raising the Intent.

result any

Data returned by the Intent handler implementation.

Resolverobject

Description

API for controlling the Intents Resolver UI app.

Properties

Property Type Default Required Description
intent string

Name of the raised Intent.

Methods

  • onHandlerAdded
  • onHandlerRemoved
  • sendResponse

onHandlerAddedmethod

Signature

(callback: (handler: ResolverIntentHandler) => void) => UnsubscribeFunction

Description

Notifies when a handler for the current Intent is added. Replays already existing handlers.

Parameters

Name Type Required Description
callback (handler: ResolverIntentHandler) => void

Callback function for handling the event.

onHandlerRemovedmethod

Signature

(callback: (removedHandler: ResolverIntentHandler) => void) => UnsubscribeFunction

Description

Notifies when a handler for the current Intent is removed.

Parameters

Name Type Required Description
callback (removedHandler: ResolverIntentHandler) => void

Callback function for handling the event.

sendResponsemethod

Signature

(handler: ResolverIntentHandler) => Promise<InvocationResult<any>>

Description

Sends the chosen Intent handler to the app which raised the Intent.

Parameters

Name Type Required Description
handler ResolverIntentHandler

ResolverIntentHandlerobject

Description

Object used in the Intents Resolver API for describing an Intent handler app.

Properties

Property Type Default Required Description
applicationIcon string

Icon of the Intent handler app.

applicationName string

Name of the Intent handler app.

instanceId string

ID of the Intent handler app instance.

  • © 2023 Glue42
  • Home
  • Privacy policy
  • Contact Sales
  • Glue42.com
  • Tick42.com
  • Overview
  • API
  • AddIntentListenerRequest
  • Config
  • Intent
  • IntentContext
  • IntentFilter
  • IntentHandler
  • IntentRequest
  • IntentResult
  • Resolver
  • ResolverIntentHandler
Navigate
Go