AppManager
5.22.1The Application Management API provides a way to manage Glue42 Enterprise applications. It offers abstractions for:
Application - a program as a logical entity, registered in Glue42 Enterprise with some metadata (name, description, icon, etc.) and with all the configuration needed to spawn one or more instances of it. The Application Management API provides facilities for retrieving application metadata and for detecting when an application is started.
Instance - a running copy of an application. The Application Management API provides facilities for starting/stopping application instances and tracking application related events.
The Application Management API is accessible through the glue.appManager
object.
APIobject
Description
Application Management API
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
inMemory | InMemoryStore | In memory store for applications - allows you to import application definitions at runtime Available since version Glue42 3.12 |
||
myApplication | Application | Returns the current application. |
||
myInstance | Instance | Returns the current application instance. |
Methods
applicationmethod
Signature
(name: string) => Application
Description
Returns an application by name.
Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | Name of the desired application. |
applicationsmethod
Signature
() => Application[]
Description
Returns an array with all registered applications for the current branch.
exitmethod
getConfigurationsmethod
Signature
(apps?: string[]) => Promise<Definition[]>
Description
Returns the configuration of the applications.
Available since version Glue42 3.17
Parameters
Name | Type | Required | Description |
---|---|---|---|
apps | string[] |
instancesmethod
onAppAddedmethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when an application is registered in the environment.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the added application as a parameter. |
onAppAvailablemethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when an application is available and can be started.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the available application as a parameter. |
onAppChangedmethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when the configuration for an application has changed.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the changed application as a parameter. |
onAppRemovedmethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when the application is removed from the environment.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the removed application as a parameter. |
onAppUnavailablemethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when an application is no longer available and cannot be started.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the unavailable application as a parameter. |
onInstanceStartedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when a new application instance has been started.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the started application instance as a parameter. |
onInstanceStartFailedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when starting a new application instance has failed.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the started application instance as a parameter. |
onInstanceStoppedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when an application instance has been stopped.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the stopped application instance as a parameter. |
onInstanceUpdatedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when an application instance is updated.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the updated application instance as a parameter. |
onShuttingDownmethod
Signature
(callback: (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean; }>) => void
Description
Notifies when Glue42 GD will shut down or restart. If you return a promise from the callback it will be waited (up until 60 sec) before shutdown continues
Available since version 5.4.0
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean; }> | Callback to handle the event. Receives as an argument object with the property restarting. |
readymethod
Signature
() => Promise<void | {}>
Description
Notifies when the Application Management API is ready to be used.
Applicationobject
Description
Object describing an application.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
activityType | string | The activity type associated with this application (populated only if this is an activity application). Available since version 3.1.0 |
||
activityWindowType | string | The activity window type associated with this application (populated only if this is an activity application). Available since version 3.1.0 |
||
allowMultiple | boolean | true | If |
|
autoStart | boolean | If |
||
available | boolean | If |
||
caption | string | The caption of the application. Available since version 3.1.0 |
||
configuration | LegacyAppConfigProperties | Glue42 Desktop legacy configuration object for the application. This is kept for legacy applications, all properties are available in the application object now. |
||
container | string | The container identifier. |
||
hidden | boolean | false | Whether the application is present in the Application Manager or not. Available since version 3.1.0 |
|
icon | string |
|
||
iconURL | string | The URL of the app icon. |
||
instances | Instance[] | Instances of that app. |
||
isActivity | boolean | If |
||
isShell | boolean | false | Whether the application is a shell application. |
|
keywords | string[] | An array of keywords that can help discovering the application easier |
||
mode | "html" | "flat" | "tab" | "frameless" | "unknown" | Mode of the application window. If the application is running in a Glue42 window, the possible modes are "flat", "html" or "tab". If the mode cannot be determined (e.g., external apps, activity definitions), the value is "unknown". |
||
name | string | Application name. |
||
sortOrder | number | Sort indicator used when ordering apps in a list. |
||
title | string | Application title. |
||
type | string | Type of the application. |
||
userProperties | PropertiesObject | Custom configuration object attached to the application. |
||
version | string | Application version. |
||
windowSettings | WindowSettings | The window settings object passed to Glue42 Desktop. Available since version 3.1.0 |
Methods
getConfigurationmethod
Signature
() => Promise<Definition>
Description
Returns the configuration of the application.
Available since version Glue42 3.17
onAvailablemethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies you when the application becomes available.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback to handle the event. Receives the application object as an argument. |
onChangedmethod
Signature
(callback: (app: Application) => any) => void
Description
Notifies you when the application configuration is changed.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback to handle the event. Receives the application object as an argument. |
onInstanceStartedmethod
onInstanceStoppedmethod
onRemovedmethod
Signature
(callback: (app: Application) => any) => void
Description
Notifies you when the application is removed.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback to handle the event. Receives the application object as an argument. |
onUnavailablemethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies you when the application becomes unavailable.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback to handle the event. Receives the application object as an argument. |
startmethod
Signature
(context?: object, options?: ApplicationStartOptions) => Promise<Instance>
Description
Start an instance of the application.
Available since version 3.0.5
Parameters
Name | Type | Required | Description |
---|---|---|---|
context | object | Context to be passed to the started application. |
|
options | ApplicationStartOptions | Options object in which you can specify window setting (that will override the default configuration settings), as well as other additional options. |
ApplicationStartOptionsobject
Description
Object with options for starting an application.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
allowChannels | boolean | false | If |
|
allowClose | boolean | true | If |
|
allowCollapse | boolean | true | If |
|
allowExtract | boolean | false | If |
|
allowForward | boolean | true | If |
|
allowLockUnlock | boolean | false | If |
|
allowMaximize | boolean | true | If |
|
allowMinimize | boolean | true | If |
|
allowTabClose | boolean | true | If |
|
allowUnstick | boolean | true | If |
|
autoAlign | boolean | true | If |
|
autoSnap | boolean | true | If |
|
base64ImageSource | string | Image as |
||
borderColor | string | Can be a color name such as "red", or a hex-encoded RGB or ARGB value. |
||
cascade | { enabled?: boolean; offset?: number; } | Settings for opening new window instances of the same app in a cascade. |
||
channelId | string | Name of the Channel which the app will join. |
||
collapseHeight | number | -1 | Defines the height of the window when collapsed. |
|
devToolsEnable | boolean | true | If |
|
downloadSettings | DownloadSettings | Object that defines file download behavior in the window. |
||
focus | boolean | true | If |
|
hasMoveAreas | boolean | true | If |
|
hasSizeAreas | boolean | true | If |
|
height | number | 400 | Window height. |
|
hidden | boolean | false | If |
|
historyNavigationEnabled | boolean | true | If |
|
ignoreFromLayouts | boolean | If |
||
ignoreSavedLayout | boolean | false | If |
|
isChild | boolean | false | If |
|
isCollapsed | boolean | false | If |
|
isPopup | boolean | false | If |
|
isSticky | boolean | true | If |
|
left | number | 0 | Distance of the top left window corner from the left edge of the screen. |
|
loader | Loader | Object that defines loader behavior. |
||
maxHeight | number | Specifies the maximum window height. |
||
maxWidth | number | Specifies the maximum window width. |
||
minHeight | number | 30 | Specifies the minimum window height. |
|
minWidth | number | 50 | Specifies the minimum window width. |
|
mode | WindowMode | "flat" | Glue42 Window type. Possible values are |
|
moveAreaThickness | string | "0, 12, 0, 0" | How much of the window area is to be considered as a moving area (meaning you can move the window using it).
The string value corresponds to the left, top, right and bottom borders of the window.
Setting |
|
moveAreaTopMargin | string | "0, 0, 0, 0" | Margin for the top window move area. The string value corresponds to the left, top, right and bottom borders of the move area.
Setting |
|
onTop | boolean | false | If |
|
placement | PlacementSettings | Specifies the window position relative to the screen. Available since version Glue42 3.11 |
||
relativeDirection | RelativeDirection | "right" | Direction ( |
|
relativeTo | string | The ID of the window that will be used to relatively position the new window. Can be combined with |
||
showInTaskbar | boolean | true | If |
|
showTitleBar | boolean | true | Determines whether the window will have a title bar. |
|
sizeAreaThickness | string | "5, 5, 5, 5" | How much of the window area is to be considered as a sizing area (meaning you can resize the window using that area). The string value corresponds to the left, top, right and bottom borders. |
|
snappingEdges | string | "all" | Specifies the active Glue42 Window snapping edges.
Possible values are: |
|
startLocation | string | Specifies the start window location.
Possible options are |
||
stickyFrameColor | string | "#5b8dc9" | Specifies the Glue42 window frame color. Accepts hex color as string (e.g. |
|
stickyGroup | string | "Any" | If set, the Glue42 Window can only stick to windows that have the same group. |
|
tabGroupId | string | Specifies the tab group ID. If two or more tab windows are defined with the same ID, they will be hosted in the same tab window. |
||
tabIndex | number | The tab index of the current window. All tabs in a common tab container have different indices. |
||
tabSelected | boolean | true | Tab is selected. |
|
tabTitle | string | "" | The tab title. |
|
tabTooltip | string | "" | The tab tooltip. |
|
title | string | Sets the window title. To work properly, there should be a title HTML tag in the page. |
||
top | number | 0 | Distance of the top left window corner from the top edge of the screen. |
|
urlLoadOptions | LoadURLOptions | Options for loading the window URL. Can be used for POST requests like uploading a file or specifying additional headers. Available since version Glue42 3.17 |
||
useRandomFrameColor | boolean | false | If |
|
waitForAGMReady | boolean | true | Whether to wait for the Interop library to be initialized. |
|
width | number | 400 | Window width. |
|
windowState | FrameState | "normal" | If set, the window will start in the specified state (maximized, minimized, normal). |
AppManagerobject
Description
Application Management API that allows you to handle your Glue42 enabled applications.
Methods
applicationmethod
Signature
(name: string) => Application
Description
Returns an application by name.
Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | Name of the desired application. |
applicationsmethod
Signature
() => Application[]
Description
Returns an array with all registered applications for the current branch.
getConfigurationsmethod
Signature
(apps?: string[]) => Promise<Definition[]>
Description
Returns the configuration of the applications.
Available since version Glue42 3.17
Parameters
Name | Type | Required | Description |
---|---|---|---|
apps | string[] |
getConfigurationsmethod
Signature
(apps?: string[]) => Promise<Definition[]>
Parameters
Name | Type | Required | Description |
---|---|---|---|
apps | string[] |
instancesmethod
onAppAddedmethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when an application is registered in the environment.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the added application as a parameter. |
onAppAvailablemethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when an application is available and can be started.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the available application as a parameter. |
onAppChangedmethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when the configuration for an application has changed.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the changed application as a parameter. |
onAppRemovedmethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when the application is removed from the environment.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the removed application as a parameter. |
onAppUnavailablemethod
Signature
(callback: (app: Application) => any) => UnsubscribeFunction
Description
Notifies when an application is no longer available and cannot be started.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (app: Application) => any | Callback function to handle the event. Receives the unavailable application as a parameter. |
onInstanceStartedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when a new application instance has been started.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the started application instance as a parameter. |
onInstanceStartFailedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when starting a new application instance has failed.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the started application instance as a parameter. |
onInstanceStoppedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when an application instance has been stopped.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the stopped application instance as a parameter. |
onInstanceUpdatedmethod
Signature
(callback: (instance: Instance) => any) => UnsubscribeFunction
Description
Notifies when an application instance is updated.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (instance: Instance) => any | Callback function to handle the event. Receives the updated application instance as a parameter. |
Definitionobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
activityTarget | ActivityTarget | |||
allowCapture | boolean | If |
||
allowCookiesManipulation | boolean | If |
||
allowHeadersManipulation | boolean | If |
||
allowLogging | boolean | If |
||
allowMultiple | boolean | If |
||
allowRegisteringWorkspaceShortcuts | boolean | Will allow registering shortcuts in any workspace. |
||
allowWorkspaceDrop | boolean | If |
||
asset | { src?: string; headers?: { name: string; value: string; }[]; noCache?: boolean; } | Configuration for an archived app that will be downloaded and extracted at a specified location. The default location is |
||
autoStart | boolean | If |
||
caption | string | User friendly (longer) description that can be used by the Glue42 Desktop clients to show more detailed application information. |
||
closeOnHibernate | boolean | Whether to close the application when it is part of a hibernating layout. |
||
configMode | "All" | "File" | "CM" | Specifies in which Glue42 Desktop configuration mode these applications will be available. |
||
customProperties | { [k: string]: any; } | These name/value pairs are sent to the Glue42 Desktop clients. The Application Manager API exposes them as well, allowing custom UIs to interpret and use the values. |
||
details | WindowConfig | ActivityConfig | ExeConfig | NodeConfig | CanvasConfig | WorkspacesConfig | WebGroupConfig | ClickOnceConfig | CitrixConfig | ChildWindowConfig | Detailed configuration based on the application type. |
||
disabled | boolean | If |
||
hidden | boolean | If |
||
icon | string | URL or the Base64 encoding (only the data part from the URI scheme) of the icon used as a taskbar icon for the application. |
||
ignoreFromLayouts | boolean | If |
||
ignoreSavedLayout | boolean | If |
||
ignoreSaveOnClose | boolean | Deprecated. Use |
||
intents | Intent[] | |||
keywords | string[] | An array of keywords that can help discovering the application easier |
||
launcherApp | string | Name of the application to be used to launch this app. |
||
name | string | Name of the application. Should be unique. |
||
noDelayedRestore | boolean | If |
||
requiresSSO | boolean | This option is valid for system and auto start applications and if it is |
||
reuseInLayouts | boolean | If |
||
runPriority | number | If the |
||
saveMultipleInstances | boolean | When |
||
service | boolean | If |
||
shell | boolean | This option is valid for system applications and if |
||
shortcut | string | Will be registered as global shortcut and will start the app or focus it. |
||
shutdownApplicationName | string | Specify another application to be started in order to shut down the current application instances. |
||
sortOrder | number | Defines the (ascending) order used by Glue42 Desktop when sending the user applications list to its clients. |
||
supportEmails | string[] | Emails of the owners of the application |
||
suspendMetrics | boolean | If |
||
title | string | Title used when visualizing the application. |
||
tooltip | string | Tooltip (extended description) that will be used when visualizing the application. |
||
type | "window" | "activity" | "exe" | "node" | "canvas" | "workspaces" | "webGroup" | "clickonce" | "citrix" | "childWindow" | Type of the application. |
||
version | string | Version of the application. |
ImportResultobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
errors | { app: string; error: string; }[] | |||
imported | string[] |
InMemoryStoreobject
Methods
clearmethod
Signature
() => Promise<void>
Description
Removes all applications from the store
exportmethod
Signature
() => Promise<Definition[]>
Description
Exports all known application definitions from the in memory store
importmethod
Signature
(definitions: Definition[], mode?: "replace" | "merge") => Promise<ImportResult>
Description
Imports the provided collection of application definitions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
definitions | Definition[] | A collection of application definition objects to be imported. |
|
mode | "replace" | "merge" | Import mode, by default it is "replace". "replace" mode replaces all existing definitions with the provided collection, "merge" mode adds (if new) or updates (if already existing) the provided definitions. |
removemethod
Signature
(name: string) => Promise<void>
Description
Removes an app definition. If removed successfully, this will fire an event that can be handled with the onAppRemoved()
method.
Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | The name of the application to be removed. |
Instanceobject
Description
Object describing an application instance
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
activity | Glue42 | Returns the activity object if the instance is part of an activity. |
||
activityId | string | The activity ID (only if the apps is part of an activity). Available since version 3.0.8 |
||
activityInstances | Instance[] | Returns the instances of the other windows in the activity if this instance is part of an activity. Available since version 3.0.8 |
||
activityOwnerInstance | Instance | Returns the instance of the owner window of the activity if this instance is part of an activity. Available since version 3.0.8 |
||
agm | Partial<Instance> | Interop instance. Use this to invoke Interop methods for that instance. |
||
application | Application | The application object of that instance. |
||
context | object | The starting context of the instance. |
||
id | string | Instance ID. |
||
inActivity | boolean | If |
||
isActivityInstance | boolean | Whether the application instance is an activity instance. Available since version 3.0.8 |
||
isSingleWindowApp | boolean | If |
||
title | string | Title of the instance. |
||
window | GDWindow | The window associated with the instance (as an object from the Window Management API).
If the application instance is an activity instance, this is |
Methods
activatemethod
getContextmethod
Signature
() => Promise<object>
getWindowmethod
Signature
() => Promise<GDWindow>
Description
Retrieves the window object corresponding to that instance
Available since version 3.6.7
onAgmReadymethod
onStoppedmethod
stopmethod
Signature
() => Promise<void>
Description
Stops the instance.
Intentobject
Description
An intent definition.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
contexts | string[] | A comma separated list of the types of contexts the intent offered by the application can process, here the first part of the context type is the namespace e.g."fdc3.contact, org.symphony.contact". |
||
customConfig | object | Custom configuration for the intent that may be required for a particular desktop agent. |
||
displayName | string | An optional display name for the intent that may be used in UI instead of the name. |
||
name | string | The name of the intent to 'launch'. In this case the name of an Intent supported by an Application. |
||
resultType | string | Metadata describing the return type of the callback which handles the intent. May be a type name, the string "channel" (which indicates that the app will return a channel) or a string indicating a channel that returns a specific type, e.g. "channel<fdc3.instrument>" |
LegacyAppConfigPropertiesobject
Description
Legacy application configuration options.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
activityType | string | Activity type (if the application is in an activity). |
||
allowMultiple | boolean | If |
||
autoStart | boolean | Whether to auto start the application. |
||
caption | string | Caption for the application. |
||
container | string | Container identifier. |
||
hidden | boolean |
PropertiesObjectobject
Description
Generic object for passing properties, settings, etc., in the for of key/value pairs.
ShuttingDownEventArgsobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
initiator | Instance | |||
reason | string | |||
restarting | boolean |