Menus/Actions Overview¶
menus: []
lists an array of menu items. Each item can be configured as follows with some parts of the configuration being dynamic:
label
: helps user to identify the meaning of a menu item (web, Context Menu, mobile Button in header of the detail section)icon
: specifies the icon of an action. (mobile, slide left/swipe on an entry in the list view)shortLabel
: (mobile, slide left/swipe on an entry in the list view)- scenario group actions together even when in separate trees
action
: specifies the type of actionactionValues
: are specifying special parameters corresponding to the listed actionroles
: optional. Confines availability to the listed security rolesvisibleIn
: optional. The visibility of a menu can be set to mobile or web. If not set, the menu is displayed. Possible values aremobile
andweb
.
"visibleIn": [
"mobile"
]
swipeHidden
: Hides the menu action in insight-mobile's list swipe.
"swipeHidden": true
onlineOnly
: Menu actions with onlineOnly can only be executed online.
"onlineOnly": true
visible
: checks the attribute values of the record. If all hits the condition, the menu is visible.*
is a wildcard for any value.
"visible": {
"FOLDER": "true",
"USER": "${userData.personid}",
"GROUP": "*"
}
tooltip
: Displays a tooltip when hovering over the menu action's button. Insight Explorer only.when
: specifies the moment an action can be triggered without user interaction, only valid for tree-level menu itemsonInit
: the first time a tree is selectedonSelect
: every time a tree is selected
on
: specifies where the menu-entry should be placed:top
: on table header instead of context-menu
{
"label": "Request and to list",
"icon": "icon-site-map",
"action": "request",
"actionValues": [{}],
"then": {
"action": "goto",
"actionValues": [
{
"dstTree": "demo-menu-flow"
}
]
}
}
js
can be used to implement a JavaScript validation function.js
Processing of the objects. Execute a Javascript function, that will get the objects as an array and return the object for the action as an array or a single object. If your js transforms multiple objects to one object and you want to call an action that does not support multiple objects please set an actionValue with "allowMultipleObjects" to true.
Chaining¶
You can chain menu actions. Each menu action can have a then
property, describing the next menu action to be executed, if the previous action was executed successfully. Any number of actions can be chained. Please note, that chained menu actions will only be executed, if the previous menu action was executed successfully, not if the previous menu action was rejected.
visible javascript function¶
You can dynamically hide and show menu actions with the visible.js
function. The visible.js
has access to several properties and callbacks:
object
: server representation of the current object, null if the menu is at tree level.userData
: Properties of the logged in user. (Working with variables/values))swipe
: true if the menu is displayed as swipe action.isSet
: checks if the given property is set.replaceObject
: replaceObject of the current object.getTimeTracker
: gets the currently active timeTracker, if there is one.
{
"label": "Request and to list",
"icon": "icon-site-map",
"action": "request",
"actionValues": [{}],
"visible": {
"js": "return isSet(object, 'OWNER');"
}
}
Common¶
Menu actions available for Explorer and Mobile use
confirm¶
confirm
Shows a confirm dialog on which the user can decide to proceed. actionValues:
message
: Message to show.title
: Title to show. (optional)ok
: OK-Button text. (optional)cancel
: Cancel-Button text. (optional)js
: Javascript code to modify the confirm behavior. (optional)setOkButtonText(text)
setCancelButtonText(text)
showOkButton(false)
showCancelButton(false)
setTitle(text)
setMessage(text)
object
: current insight record.object.$payload
: payload of previous actions.userData
: user profile
{
"label": "Call API",
"icon": "icon-fire",
"action": "confirm",
"actionValues": [
{
"message": "Are you sure?",
"ok": "Yes",
"cancel": "Never"
}
],
"then": {
"action": "request",
"request": {
"url": "https://your-api.com/request",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"params": {
"desc": "${DESCRIPTION}",
"count": "${object.payload.count}"
}
}
}
}
goto¶
Displays a dependent record in another tree. If multiple records are appended, the first is used.
actionValues | |
---|---|
srcNode |
Node name of the record to link to |
dstTree * |
Tree to show the link, Tree to show in Explorer |
dstNode |
Node to show the link |
create |
Show the node in create mode |
listEdit |
Show the node in listEdit mode |
list |
Show the node in list mode |
path * |
Show the path |
params |
Only available at path . Parameters can be passed to the details view. Special parameters are headerLabel and headerLink . These two parameters can be used to control the header link of insight-mobile. Examples below. |
All actionValues
are available in Insight Mobile, actionValues
marked with *
are available in Insight Explorer.
Examples:
Go to the list view of tree asset-flat
:
{
"label": "Asset Öffnen",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"dstTree": "asset-flat"
}
]
}
Go to the node asset
of the tree asset-flat
with the ID of the first child of node assetchild
:
{
"label": "Asset Öffnen",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"srcNode": "assetchild",
"dstTree": "asset-flat",
"dstNode": "asset"
}
]
}
Go to the node asset
of the tree asset-flat
with the ID of the current record:
{
"label": "Asset Öffnen",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"dstTree": "asset-flat",
"dstNode": "asset"
}
]
}
Go to the create view of node asset
of the tree asset-flat
:
{
"label": "Asset Öffnen",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"create": true,
"dstTree": "asset-flat",
"dstNode": "asset"
}
]
}
Go to the listEdit
view: In the current tree. On the node woactivity
. With the records of the child node woactivity
of the current record:
{
"label": "Checklist",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"listEdit": true,
"dstNode": "woactivity"
}
]
}
Go to the listEdit
view: In the given tree. On the given node. With the records of the child node woactivity
of the current record:
{
"label": "Checklist",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"listEdit": true,
"srcNode": "woactivity",
"dstTree": "othertree",
"dstNode": "workorder"
}
]
}
Go to the listView
: In the current tree. On the node woactivity
. With the records of the child node woactivity
of the current record:
{
"label": "Checklist",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"list": true,
"dstNode": "woactivity"
}
]
}
Go to the listView
: In the given tree. On the given node. With the records of the child node woactivity
of the current record:
{
"label": "Checklist",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"list": true,
"srcNode": "woactivity",
"dstTree": "othertree",
"dstNode": "workorder"
}
]
}
Go back
:
{
"label": "Back",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"back": 1
}
]
}
Go to specified path
:
{
"label": "Back",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"path": "${object.path}"
}
]
},
{
"label": "Back",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"path": "tree/node/id"
}
]
}
Go with path
, keep the header link and label:
{
"label": "Go to documents",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"path": "${object.path}",
"params": {
"headerLabel": true,
"headerLink": true
}
}
]
}
Go with path
change the header label:
{
"label": "Go to documents",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"path": "${object.path}",
"params": {
"headerLabel": "Documents of ${WONUM}",
"headerLink": true
}
}
]
}
path
pass attribute values to details view:
{
"label": "Go to details",
"action": "goto",
"icon": "icon-bathtub",
"actionValues": [
{
"path": "${object.path}",
"params": {
"TEXT": "${WONUM} ${DESCRIPTION}"
}
}
]
}
TimeTrack¶
timeTrack
: Starts a time tracker on the current object. The time tracker will continue running even if you open other objects or trees in Insight. A running time tracker is visualized in the top right corner. Clicking on the time tracker icon will automatically navigate the user back to the item the timer was started on. Clicking the timeTrack menu action a second time on the active object will stop the time tracker and the time tracking result can be used in further then
actions. If a time tracker for object a is active and at the same time another time tracker is started on object b, the time tracker on object a will be stopped and a new one started for object b.
The resulting object is available under $payload in the following then
action. Available durations are milliSeconds
, seconds
, minutes
, hours
and days
.
When the timeTrackStart contains a then
action for create
the time tracker will be applied to the newly created object after its creation. The time tracker is started when the create page is loaded and already running when the user fills out the object. Canceling the creation will also stop the time tracker. To ensure that the menu is always displayed, this setting can be made: ignoreRunning
The timeTrackStop menu is only displayed when a TimeTracker has been started. To ensure that the menu is always displayed, this setting can be made: ignoreNotRunning
ATTENTION: No time tracker can have a create
action in the then
part of the timeTrackStop
if any timeTrackStart
has a create
action in the then
part. In these cases the timeTrackStop
must use a createForm
and form
with "mode" = "save"
in the then
actions (example).
ATTENTION: If you plan on using the TimeTracker on InsightMobile, please make sure that the usecase you include it in, supports offline. Several features here do not work fully if switching between online and offline, and the usecase is not downloaded locally on each client.
You can also define a maxTrackTime
for the tracker which will set the resulting duration object to the configured maxTrackTime
, if the tracked time would exceed the configured time.
{
"label": "Time",
"icon": "icon-play",
"action": "timeTrackStart",
"actionValues": [
{
"maxTrackTime": 3600000
}
]
},
{
"label": "Time",
"icon": "icon-stop-circle",
"action": "timeTrackStop",
"then": {
"label": "Zeitrückmeldung",
"action": "create",
"icon": "icon-clock",
"actionValues": [
{
"_node": "LABTRANS",
"WONUM": "${WONUM}",
"TRANSTYPE": "WORK",
"LABORCODE": "${userData.laborcode}",
"CRAFT": "${userData.defaultcraft}",
"GLDEBITACCT": "1000",
"PAYRATE": "${userData.defaultcraftrate}",
"REGULARHRS": "${$context.$timeTrack.duration.hours}"
}
]
}
}
{
"label": "Time",
"icon": "icon-play-circle",
"action": "timeTrackStart",
"actionValues": [
{
"ignoreRunning": true
}
]
},
{
"label": "Time",
"icon": "icon-stop-circle",
"action": "timeTrackStop",
"actionValues": [
{
"ignoreNotRunning": true
}
]
}
Browser¶
browser
: opens a new web page in a new browser tab.
actionValues:
url
: specifies the URL which can be opened. Context specific values can be added to the URL:${ASSETNUM}
inTab
: (inside-explorer only), when true open the defined URL using an iframe inside of the Insight-ExplorerdeepLink
: specifies the URL-Scheme of another installed app. The app will be opened with parameters. Context specific values can be added to the URL:${ASSETNUM}
{
"label": "Fehlerhistorie",
"shortLabel": "FH",
"action": "browser",
"icon": "icon-pie-chart",
"actionValues": [
{
"inTab": true,
"url":"insight/kibana/app/kibana#/dashboard/Stillstand?\_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-15m,mode:quick,to:now))&\_a=(filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!t,index:locations,key:properties.ASSETNUM,negate:!f,value:'${ASSETNUM}')"
}
]
}
"actionValues": [
{
"deepLink": "schemeofapp://hello:world:${ASSETNUM}"
}
]
{
"label": "IBFS",
"icon": "icon-browser",
"action": "browser",
"actionValues": [
{
"deepLink": "ibfslink://system/programm/${id}"
}
]
}
SearchThis¶
searchThis
searches the current object in other trees. From v2.11.1 you can configure in which trees the search is executed. Without any configuration the search is executed in all trees.
{
"label": "Search this",
"action": "searchThis",
"actionValues": [
{
"trees": [
"locations-web",
"locations-others"
]
}
]
}
Request¶
Calls a remote REST/API endpoint.
actionValues |
|
---|---|
payloadKey |
key where the (JSON) response will be stored |
request |
|
---|---|
url |
absolute or relative URL to the http-endpoint |
method |
HTTP method to be used (POST, PUT, DELETE) |
params |
JSON Object of key/values |
timeout |
default: 60 |
{
"action": "request",
"actionValues": [
{
"payloadKey": "activity"
}
],
"request": {
"method": "POST",
"url": "insight/action/business-suite/activity/get",
"params": {
"activityId": "${$context.$record.properties.activityId}"
}
},
"then": {
"action": "request",
"request": {
"method": "POST",
"url": "https://your-other-api.com/request",
"params": {
"result": "${$payload.activity}"
}
}
}
}
Since Version 22.0.0 the request action has new several defaults and improvements for easier configuration:
- You may now emit the params
object in the configuration, if you do not have any parameters to send. No dummy parameters are needed.
- You may now emit the headers
object in the configuration in Insight Standalone. The default (for Insight Standalone) is:
{
"Accept": "application/json",
"Content-Type": "application/json",
}
- You may now use a script tag in the request action configuration. Doing so will set the request method to POST as a default, but can still be overriden via the old configuration.
- You can now break up long request url configurations in the
script
tag. The request url will be generated from these settings:
{
"action": "request",
"script": {
"backend": "business-suite",
"name": "my-script"
}
}
- You can additionally configure the
params
object in the script object as well:
{
"action": "request",
"script": {
"backend": "business-suite",
"name": "my-script",
"params": {
"id": "${id}",
"user": "${userData.login}"
}
}
}
{
"action": "request",
"request": {
"method": "POST",
"url": "rest/mbo/WORKORDER/${WORKORDERID}",
"params": {
"WOPRIORITY": "1",
"DESCRIPTION": "${DESCRIPTION} + ${userData.personid} + ${appParams.standort}"
},
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
}
}
}
request
calls a remote method.
{
"label": "Verheiraten",
"shortLabel": "Verheiraten",
"action": "request",
"icon": "icon-man-woman",
"request": {
"method": "POST",
"url": "insight/eam/rpc/insightTest/mitarbeiter",
"params": {
"vorgesetzter": "${dstObject.uniqueId}",
"mitarbeiter": "${srcObject.uniqueId}"
},
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
}
}
}
Examples:
RPCHandler Implementation
import gis.openframe.bol.BusinessObject;
import java.util.Map;
import de.ibfs.insight.rpc.api.RpcContext;
import de.ibfs.insight.rpc.api.RpcHandler;
public class MitarbeiterVerknueppler implements RpcHandler {
@Override
public void call(RpcContext context) throws Exception {
Map<String, String> parameters = context.getParameters();
String vorgesetzterId = parameters.get("vorgesetzter");
String mitarbeiterId = parameters.get("mitarbeiter");
if (vorgesetzterId.equals(mitarbeiterId)) {
return;
}
Person target = PersonFactory.get(vorgesetzterId);
Person mitarbeiter = PersonFactory.get(mitarbeiterId);
BusinessObject[] parents = mitarbeiter.getLinkSourceObjects(Person.folgt);
for (BusinessObject businessObject : parents) {
((Person) businessObject).removeFolgt(mitarbeiter);
}
target.addFolgt(mitarbeiter);
}
}
Registration in InitComponent
public void globalInit() {
try {
RpcRegistry service = OpenJetServiceRegistry.getService(RpcRegistry.class);
service.register("insightTest/mitarbeiter", MitarbeiterVerknueppler.class);
}
catch (Throwable t) {
gis.util.Trace.error("RpcRegistry", "Fehler beim Versuch RpcRegistry zu laden", t);
}
}
Create¶
create
creates a new node item of referenced node type (Insight Mobile and Insight Explorer), TreeConfig:
- creates a new node and copies data (
"dst": "source"
) - Values of source node can be accessed via
${attributeid}
{
"label": "Material",
"action": "create",
"icon": "icon-plus",
"actionValues": [
{
"_tree": "WORKORDER", // optional, defaults to current tree
"_node": "MATUSETRANS",
"WONUM": "${WONUM}",
"SENDERSYSID": "EXT",
"STORELOC": "MAIN SR",
"ISSUETYPE": "ISSUE"
}
]
}
Refresh¶
refresh
refreshes the current node. By configuring (multiple) paths you can refresh other nodes as well. By configuring (multiple) trees you can refresh/reset trees in the left sidebar.
{
"label": "Aktualisieren",
"shortLabel": "Aktualisieren",
"action": "refresh",
"icon": "icon-sync",
}
Example with paths and trees:
{
"action": "refresh",
"actionValues": [
{
"paths": ["cluster-ab-basis/clusterStatus/KWB001-C0004"],
"trees": ["cluster-ab-basis"]
}
]
}
Save¶
save
assigns values to specified attributes and saves the record. Example:
{
"label": "save the record",
"icon": "icon-fire",
"action": "save",
"actionValues": [
{
"WOPRIORITY": "2"
},
{
"OWNER": "${userData.personid}"
},
{
"DESCRIPTION": "${DESCRIPTION} + ${WOPRIORITY} + ${appParams.standort}"
}
]
}
StaticContent¶
staticContent
shows a html page configured in the ClientConfiguration - staticContent
{
"label": "Legal",
"icon": "icon-fire",
"action": "staticContent",
"actionValues": [
{
"name": "legal"
}
]
}
Remove¶
remove
deletes an object.
{
"label": "Delete",
"shortLabel": "Delete",
"action": "remove",
"icon": "icon-question-circle",
"request": {
"method": "DELETE",
"url": "http://localhost:9080/node-red/tree/node/${WORKORDERID}"
}
}
qr¶
The qr
action will render a QR code based on the given configuration. The generated QR Codes can contain any content, for example deepLinks. Examples:
Simple Text:
{
"label": "QR-Code",
"icon": "icon-barcode",
"action": "qr",
"actionValues": [
{
"qrData": "https://google.de"
}
]
}
DeepLink to a path in Insight-mobile:
{
"label": "QR-Code",
"icon": "icon-barcode",
"action": "qr",
"actionValues": [
{
"qrData": "insightmobile://details:${object.path}"
}
]
}
Debug¶
An action to output all currently available information in the menu flow. Information like the current object
, payloads
or userData
will be printed to console. This action has no further configuration. Please be adviced that this action should only be used during development and should not be deployed on live/production systems!
Form¶
form
shows a dialog on which the user can make inputs. The values are written to the record or a payload and can be used in further actions. Attributes of the node configuration are written to the record, formField
attributes are written to the payload. Important: "mode": "save"
will only save the current record. If you want to save a child of the current object you are standing on, you have to first create an intermediate record with createForm
and set the "_node": "myChildNode"
attribute.
ActionValues:
attributes |
Array of attributes that can be entered. |
mode |
Possible values are: temp or save (default) |
temp |
Write only in the record/payload |
save |
Saves the record |
focusAttribute |
The attribute to be focused when opening the dialog. |
saveButtonText |
Change the default text for the save button |
Shows an input dialog and sends the values to a http service:
{
"label": "Call API",
"icon": "icon-fire",
"action": "form",
"actionValues": [
{
"_tree": "my-tree",
"mode": "temp",
"attributes": [
{
"name": "DESCRIPTION"
},
{
"label": "Count",
"name": "count",
"type": "Decimal"
}
]
}
],
"then": {
"action": "request",
"request": {
"url": "https://your-api.com/request",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"params": {
"desc": "${DESCRIPTION}",
"count": "${$payload.count}"
}
}
}
}
Example: Create a child with two input dialogs and navigate to the created record:
{
"label": "Worklog",
"icon": "icon-plus",
"action": "createForm",
"actionValues": [
{
"_node": "worklog"
}
],
"then": {
"action": "form",
"actionValues": [
{
"mode": "temp",
"attributes": [
{
"name": "DESCRIPTION"
}
]
}
],
"then": {
"action": "form",
"actionValues": [
{
"mode": "save",
"attributes": [
{
"name": "DESCRIPTION_LONGDESCRIPTION"
}
]
}
]
}
}
}
By default, Insight does not check upon leaving the form if there are unsaved changes. If you want to force Insight to dirty check the form action, use the following notation:
{
"label": "Form action",
"icon": "icon-paperclip",
"action": "form",
"actionValues": [
{
"mode": "save",
"attributes": [
{
"name": "myAttribute"
}
],
"dirtyCheck": true
}
]
}
If you want to force Insight to always confirm you leaving the form, use the following notation:
{
"label": "Form action",
"icon": "icon-paperclip",
"action": "form",
"actionValues": [
{
"mode": "save",
"attributes": [
{
"name": "myAttribute"
}
],
"confirmLeave": true
}
]
}
fileUpload¶
Attaches a file using the documents configuration. Example:
{
"label": "File Upload",
"icon": "icon-paperclip",
"action": "fileUpload",
"actionValues": [
{
"documentHandler": "attachments",
}
]
}
createSilent¶
createSilent
creates a new node item of referenced node type without a user input. All other settings are like create.
createForm¶
createForm
Creates a new record without user input and does not save it. All other settings are like create. This record can then be used in further actions.
Example: Create a child with two input dialogs and navigate to the created record:
{
"label": "Worklog",
"icon": "icon-plus",
"action": "createForm",
"actionValues": [
{
"\_node": "worklog"
}
],
"then": {
"action": "form",
"actionValues": [
{
"mode": "temp",
"attributes": [
{
"name": "DESCRIPTION"
}
]
}
],
"then": {
"action": "form",
"actionValues": [
{
"mode": "save",
"attributes": [
{
"name": "DESCRIPTION_LONGDESCRIPTION"
}
]
}
],
"then": {
"action": "goto"
}
}
}
}
focus¶
Insight offers several components that visualize many records, not just one (gantt, chart, table, map, pert). It can sometimes be hard to find and focus a specific element in such a component. The focus action lets a currently open component automatically focus the record in question. Example:
{
"label": "focus",
"action": "focus",
"actionValues": [
{
"path": "tree/node/1"
}
]
}
Explorer¶
Menu actions available for Explorer.
Explorer Tab-Label
It is possible to configure the label of a tab, based on the common template syntax known from labels.
This is possible for the following actions: details
, insert
, mapOpen
, kibanaOpen
, tableOpen
To configure the tab-label the following part must be added to the first element of the actionValues. Possible variables are explained in the Working with variables/values chapter.
{
"label": "Show Details",
"icon": "icon-aim",
"action": "details",
"actionValues": [
{
"tab": {
"label": "Details: ${ASSETNUM}"
}
}
]
}
Open (OpenJet)¶
"open" opens specified application with current object.
{
"label": "Öffnen",
"action": "open",
"icon": "icon-factory",
"actionValues": [
{
"ga": "508:43425:BA",
}
]
}
Open, open parent (Maximo)¶
open
loads object to defined application (Insight Explorer)
- default: selected object is loaded
- option: actionValue
"uniqueid": "${parent.TICKETUID}"
will load the parent object
{
"label": "In neuem Tab öffnen",
"action": "open",
"icon": "icon-arrow-up-right",
"actionValues": [
{
"event": "loadapp",
"value": "LOCATION",
"inTab": "true"
}
],
"roles": [
"MAXEVERYONE"
]
}
Details¶
Details - Basic
details
opens a detail dialog to present all of the listed attributes (if not "hidden": true
)
{
"label": "Details",
"shortLabel": "Details",
"action": "details",
"icon": "icon-question-circle"
}
Details - Different configuration as source
It is possible to configure a different tree as source for the details view. The name of the nodes in both trees must be the same, otherwise the object cannot be fetched.
{
"label": "Details from different tree",
"icon": "icon-aim",
"action": "details",
"actionValues": [
{
"tree": "test-table-assets-more",
"tab": {
"label": "Details: ${ASSETNUM}"
}
}
]
}
Details - open path instead of object
It is possible to execute the details action without a record but by configuring a path, for example a path returned from a request action
{
"label": "Details returned path",
"icon": "icon-aim",
"action": "details",
"actionValues": [
{
"path": "${$payload.req.path}",
"tab": {
"label": "Details: ${ASSETNUM}"
}
}
]
}
Details - Table
The details view can show children in a table below the attributes of the object. To enable this table, configure the attributes of the children in a list configuration. It's possible to enable multiple tables.
Example showing an Asset with its Location child
Select¶
An action to select one or multiple objects from a tree with root-nodes. The initial list can be filtered. By default, multi records can be selected, single selection must be enabled.
The selected elements can be forwarded to the next action via then
. They are accesible in $payload
with the key selections
or by the one specified with payloadKey
. The result is an array of JSON-objects.
actionValues | |
---|---|
tree | source tree for getting (root-)nodes |
payloadKey | key the selections are stored for further processing |
filter | attribute/value object to pre-filter (root-)nodes |
{
"label": "Add Roles",
"action": "select",
"icon": "icon-select",
"actionValues": [
{
"tree": "usergroup"
}
],
"then": {
"action": "request",
"request": {
"method": "POST",
"url": "insight/action/insight-suite/roles",
"params": {
"roles": "${$payload.selections}" ,
"login": "${userData.login}"
}
},
}
}
{
"label": "Add Roles",
"action": "select",
"icon": "icon-select",
"actionValues": [
{
"tree": "usergroup",
"multi": false
}
]
}
{
"label": "Zu AS zuordnen",
"action": "select",
"icon": "icon-select",
"actionValues": [
{
"tree": "as-select",
"filter": {
"measureId": "${$context.$record.properties.id}"
}
}
],
"then": {
"action": "request",
"request": {
"method": "POST",
"url": "insight/action/business-suite/as/link",
"params": {
"arbeitsscheine": "${$payload.selections}",
"activityId": "${$context.$record.properties.id}",
}
}
}
}
{
"label": "Add Roles",
"action": "select",
"icon": "icon-select",
"actionValues": [
{
"payloadKey": "roles",
"tree": "usergroup"
}
],
"then": {
"action": "request",
"request": {
"method": "POST",
"url": "insight/action/insight-suite/roles/add",
"params": {
"roles": "${$payload.roles}",
"login": "${userData.login}"
}
}
}
}
Insert¶
insert
new mbo as additional event after loading an application
- event, additionalevent, value loads application with created object and copies data (src dst) Insight Explorer
{
"label": "Neuer IH-Bedarf",
"action": "insert",
"icon": "icon-warning",
"actionValues": [
{
"event": "loadapp",
"additionalevent": "insert",
"value": "SR",
"inTab": "true",
"node": "SRLOC"
},
{
"src": "LOCATION",
"dst": "LOCATION"
},
{
"static": "IH Bedarf ${LOCATION}: ",
"dst": "DESCRIPTION"
}
]
}
Insert
open specified application with a new object. Context specific data can be passed via additional key value entries. Those can be accessed in the EventHandler.ON_ENTERED()
method execution. EventHandler.getParam("FOO")
{
"label": "Insert",
"action": "insert",
"icon": "icon-snow2",
"actionValues": [
{
"ga": "508:40393:BA",
"FOO": "foo",
"BAR": "bar"
}
]
}
KibanaOpen¶
Please refer to: Kibana Dashboards
MatrixOpen¶
matrixOpen
opens a matrix view on the root nodes of a configuration. Example:
"menus": [
{
"label": "Matrix",
"icon": "icon-user",
"action": "matrixOpen",
"actionValues": [
{
"tab": {
"label": "Matrix"
},
"matrix": {
"tree": "matrix-tree"
},
// optional to display a table alongside the matrix
"table": {
"tree": "matrix-tree"
}
}
]
}
]
TableOpen¶
tableOpen
opens a Table view on the root nodes of a tree. Example:
{
"label": "Table with workorders",
"icon": "icon-question-circle",
"action": "tableOpen",
"actionValues": [
{
"table": {
"tree": "workorder-table"
}
}
]
}
Tables can be opened with additional filters. The filters are identical to those in the filter
action. Example:
{
"label": "Table with workorders for an asset",
"icon": "icon-question-circle",
"action": "tableOpen",
"actionValues": [
{
"table": {
"tree": "workorder-table",
"settings": {
"filter": [
{
"attribute": "assetId",
"operator": "eq",
"value": "${assetId}"
}
]
}
}
}
]
}
Query-Params Filtering¶
To filter to nodes in the table the use of queryParams is possible. Example: Action for an "Asset"-node to show all of it's workorders
{
"label": "Table with workorders for an asset",
"icon": "icon-question-circle",
"action": "tableOpen",
"actionValues": [
{
"table": {
"tree": "workorder-table",
"queryParams": {
"myAssetSelection" : "${ASSETNUM}"
}
}
}
]
}
Corresponding "workorder-table.json"
"root": {
"type": "WORKORDER",
"query": {
"constraint": "HISTORYFLAG=0 AND ASSETNUM in ( '${userData.myAssetSelection}' )",
}
}
The table view is linked by default which will add more nodes into the queryParam-selection list when you click them. The resulting sql can be configured as need, the query-params will be available as comma separated list of values, e.g. "AS-001", "AS-002", ... For every queryParam configured a count will be available in the userData-object to reflect the amount of objects in the selection. In the example above there would be ${userData.myAssetSelectionCount}
to be used in the constraint or anywhere else.
Tab¶
The tab
-action allows you to control the behaviour of tabs in the Explorer. Currently the action allows you to close a tab in any menu-flow. Example, closes the currently active tab:
{
"action": "tab",
"actionValues": [
{
"close": true
}
]
}
Example, closes the tab by its scenario:
{
"action": "tab",
"actionValues": [
{
"close": true,
"scenario": "someScenarioIdFromAnotherMenu"
}
]
}
Mobile¶
Menu actions available for Mobile use.
DownloadRecord¶
downloadRecord
downloads the current record to the mobile device. This can only be used in the root node. This action can only be used in mobile.
{
"label": "Download",
"icon": "icon-paperclip",
"action": "downloadRecord"
}
DeleteLocal¶
deleteLocal
reverts the changes of offline changed records. Deletes offline created records. This action can only be used in mobile.
{
"label": "Delete",
"icon": "icon-cross-circcle",
"action": "deleteLocal"
}
ListEdit¶
This menu action is deprecated. Please use goto. This feature is currently only available in insight-mobile. listEdit
opens the given node in an list edit mode. (See listEdit(inputsupport))
{
"label": "Checklist",
"action": "listEdit",
"icon": "icon-bathtub",
"actionValues": [
{
"tree": "workorder-test",
"node": "activities"
}
]
}
Online¶
This feature is currently only available in insight-mobile. online
sets the app online, if the server is available.
{
"label": "Online",
"action": "online",
"icon": "icon-bathtub"
}
Offline¶
This feature is currently only available in insight-mobile. offline
sets the app offline.
{
"label": "Offline",
"action": "offline",
"icon": "icon-bathtub"
}
Filter¶
This feature is currently only available in insight-mobile.
filter
sets a filter on the root node. (only root node)
{
"label": "High prio",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"attribute": "WOPRIORITY",
"value": "1"
}
]
}
{
"label": "Mine",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"attribute": "OWNER",
"value": "${userData.personid}"
}
]
}
Date range filters react as follows: Filter example: DATE:WEEK:-2
, Today is: 24.01.2019, resulting date filter is: from 07.01.2019 to 27.01.2019.
- Pattern:
<UNIT>:<VALUE>
- UNIT:
TODAY
orWEEK
orMONTH
- VALUE: positiv or negative number
{
"label": "Last week",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"attribute": "REPORTDATE",
"value": "WEEK:-1",
"label": "Last week"
}
]
}
The different operators¶
{
"label": "Not Mine",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"attribute": "OWNER",
"value": "${userData.personid}",
"operator": "notEquals"
}
]
}
{
"label": "No prio",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"label": "No priority",
"attribute": "WOPRIORITY",
"operator": "isNull"
}
]
}
{
"label": "Has prio",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"label": "Has priority",
"attribute": "WOPRIORITY",
"operator": "isNotNull"
}
]
}
{
"label": "Prio 1 + 2",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"label": "High and Middle",
"attribute": "WOPRIORITY",
"value": [
"1",
"2"
]
}
]
}
{
"label": "*m*",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"label": "*m*",
"attribute": "OWNER",
"operator": "like",
"value": "*m*"
}
]
}
{
"label": "Greater than 5",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"label": "Greater than 5",
"attribute": "PRIO",
"operator": "gt",
"value": 5
}
]
}
Extras¶
{
"label": "*m*",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"clear": true
}
]
}
{
"label": "Mine, last week",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"clear": true
},
{
"attribute": "OWNER",
"value": "${userData.personid}"
},
{
"attribute": "REPORTDATE",
"value": "WEEK:-1",
"label": "Last week"
}
]
}
{
"label": "High prio",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"treeName": "my-tree",
"attribute": "WOPRIORITY",
"value": "1"
}
]
}
When set to true, it shows the total number of hits that this filter would display, regardless of other filters and restrictions. Use this carefully as it can affect performance.
{
"label": "High prio",
"icon": "icon-user",
"action": "filter",
"actionValues": [
{
"totalCount": true
},
{
"attribute": "WOPRIORITY",
"value": "1"
}
]
}
OR
filters: Backend search with OR
Geo¶
geo
Gets the current position of the device. The result can be used in further actions. Result of the Action contains the following properties:
longitude
latitude
accuracy
position
: The complete result of the API call tonavigator.geolocation.getCurrentPosition
{
"label": "Position",
"icon": "icon-map-marker",
"action": "geo",
"then": {
"action": "save",
"actionValues": [
{
"LONG": "${$payload.longitude}"
}
]
}
}
BarcodeFilter¶
barcodeFilter
Forces a barcode scan and passes the value in a JavaScript-Function. In the JavaScript-Function filters can be activated. The action values are:
clear
: (optional) clears all filterjs
: A Java-Script-Function to analyze the value of the scan and set filter. The function got the following parameters:value
: The scanned textuserData
: The user profile of the logged in user- Functions to add filters:
eqFilter(name, value)
notEqFilter(name, value)
likeFilter(name, value)
gtFilter(name, value)
gteFilter(name, value)
ltFilter(name, value)
lteFilter(name, value)
isNotNullFilter(name)
isNullFilter(name)
{
"label": "Scan",
"icon": "icon-barcode",
"action": "barcodeFilter",
"actionValues": [
{
"clear": true,
"js": "eqFilter('WONUM', value.split('|')[0]); eqFilter('WOPRIORITY', value.split('|')[1])"
}
]
}
OR filters: Backend search with OR
barcodeDeepLink¶
The barcodeDeeplink action will open the users camera module and scan barcodes. The scanned result will automatically be handled as a deepLink. Example:
{
"label": "Deeplink",
"shortLabel": "Deeplink",
"action": "barcodeDeeplink",
"icon": "icon-paper-plane"
}
barcodeScan¶
The barcodeScan
action will open the users camera module and scan a barcode. The scanned result will be available in the payload of the then
action. They are accessible in $payload
with the fixed key barcode
. If the barcode contains a JSON string which should be parsed, the actionValues
can be set with the parseJson
option set to true. As default the barcode is only read as a string. Example:
{
"label": "Scan Barcode",
"action": "barcodeScan",
"actionValues": [
{
"parseJson": true
}
],
"then": {
"action": "request",
"params": {
"result": "${$payload.barcode}"
}
}
}
NfcRead¶
nfcRead
Forces a NFC scan and passes the result in the payload of the then
chain. The action result contains the following properties:
text
: String: The first entry of the NDEFMessagesid
: String: The id of the tag. (only supported in android)nfcEvent
: Object: The complete result of the native NFC plugin.
Example:
{
"label": "NFC",
"icon": "icon-broadcast",
"action": "nfcRead",
"then": {
"action": "filter",
"actionValues": [
{
"attribute": "DESCRIPTION",
"value": "${object.$payload.text}"
}
]
}
}
{
"label": "NFC Filter",
"icon": "icon-broadcast",
"action": "nfcRead",
"then": {
"action": "scriptFilter",
"actionValues": [
{
"clear": true,
"js": "var desc = value.payload.text.split('|')[1]; eqFilter('DESCRIPTION', desc)"
}
]
}
}
scriptFilter¶
scriptFilter
can be used in then
chains. The previous menu action passes the value object in a JavaScript-Function. In the JavaScript-Function filters can be activated. The action values are:
clear
: (optional) clears all filtersjs
: A Java-Script-Function to analyze the value of the previous action and set filter. The function got the following parameters:value
: The passed object of the previous menu action.userData
: The user profile of the logged in user- Functions to add filters:
eqFilter(name, value)
notEqFilter(name, value)
likeFilter(name, value)
gtFilter(name, value)
gteFilter(name, value)
ltFilter(name, value)
lteFilter(name, value)
isNotNullFilter(name)
isNullFilter(name)
{
"label": "NFC Filter",
"icon": "icon-broadcast",
"action": "nfcRead",
"then": {
"action": "scriptFilter",
"actionValues": [
{
"clear": true,
"js": "var desc = value.payload.text.split('|')[1]; eqFilter('DESCRIPTION', desc)"
}
]
}
}
Select¶
An action to select one record by a selectFromTree
configuration. The selected record can be forwarded to the next action via then
. They are accesible in $payload
with the fixed key selectedRecord
. $payload.selectedRecord
is the selected JSON-object. Example:
{
"label": "Choose template",
"icon": "icon-list",
"action": "select",
"actionValues": [
{
"tree": "demo-document-templates",
"node": "documents",
"attribute": "name"
}
],
"then": {
"action": "fileEdit",
"actionValues": [
{
"documentsAdd": "Workingfiles"
}
]
}
}
fileEdit¶
Add or Edit an attached file. documentsAdd
: Attach the file to this documents
configuration. A full explample can be found here: Documents. Example:
{
"label": "Choose template",
"icon": "icon-list",
"action": "select",
"actionValues": [
{
"tree": "demo-document-templates",
"node": "documents",
"attribute": "name"
}
],
"then": {
"action": "fileEdit",
"actionValues": [
{
"documentsAdd": "Workingfiles"
}
]
}
}
signature¶
Attaches a signature as a file or as Base64 data string. The signature file can be attach to a documents
configuration. Example:
{
"label": "Signature Attachment",
"icon": "icon-paperclip",
"action": "signature",
"actionValues": [
{
"asFile": true
}
],
"then": {
"action": "fileUpload",
"actionValues": [
{
"documentHandler": "signature",
"filePath": "${$payload.filePath}"
}
]
}
}
{
"label": "Signature to Request",
"icon": "icon-paperclip",
"action": "signature",
"then": {
"action": "request",
"request": {
"url": "/insight/some-endpoint",
"method": "POST",
"params": {
"id": "${id}",
"signature": "${object.payload.signature}"
}
}
}
}
js¶
Defines a custom JavaScript function which is executed. The function receives the userData
and the object
objects which can be used. The function can optionally return the following values:
Promise.resolve()
: continues the menu chain without a payloadPromise.resolve(data)
: continues the menu chain withdata
as payload, wheredata
can be an JavaScript objectPromise.reject(error)
: throws the given errorabort()
: cancels the menu chain
When nothing is returned the menu chain will continue without a payload
. Example:
{
"label": "JavaScript",
"icon": "icon-fire",
"action": "js",
"actionValues": [
{
"js": "/* custom js code */"
}
]
}
refreshProfile¶
This action refreshes the user profile without relogin. After profile information has been changed, it can be rebuilt and made available to the server and client. Cannot be used offline. After rebuilding the profile, uncached trees are redownloaded. Cached (cacheDuration
, schedule
) trees are validated by the Insight server and redownloaded, if necessary. In IBM Maximo it can be used after the site has changed. Example:
{
"label": "Refresh Profile",
"icon": "icon-clipboard-user",
"action": "refreshProfile"
}
Flow¶
A guided form of Create. The information can be spread over several pages and also summarized in sections on each page. Attributes can be required. Leaving the page or going to the next page is no longer possible without filling in the fields. To upload or make a photo, "documents": true
must be set on the appropriate page.
Example:
"menus": [
{
"label": "Create",
"icon": "icon-plus",
"action": "create"
}
],
"root": {
"name":"example",
"attributes": [
{
"name": "DESCRIPTION"
},
{
"name": "DESCRIPTION_LONGDESCRIPTION"
},
{
"name": "ASSETNUM"
},
{
"name": "LOCATION"
}
],
"flow": {
"create": {
"title": "Flow",
"pages": [
{
"label": "Page One",
"description": "Description of page one",
"attributes": [
{
"name": "DESCRIPTION",
"section": "Section One"
},
{
"name": "DESCRIPTION_LONGDESCRIPTION",
"section": "Section Two",
"requiered": true
}
]
}
{
"label": "Page Two",
"description": "Description of page two",
"attributes": [
{
"name": "ASSETNUM"
},
{
"name": "LOCATION"
}
],
"documents": true
}
]
}
}
}