Wizard¶
Basic configuration¶
The wizard main configuration is at the root node and contains main information for the wizard.
properties | ||
---|---|---|
allPagesAllowed |
allows to go to a other page before finishing the current page. Normally it goes straight from the first page to the last page | boolean |
complete |
define the behavior when saving and on the summary. See complete. | object |
description |
shows an attribute as title for the wizard. It is a reference to the attribute. For changes change the attribtue value. | string |
tooltip |
can also handle rich text and images (base64 formatted). It is displayed by a notification mark and triggers a popup. It is a reference to the attribute. For changes change the attribtue value. | string |
autoRefresh |
refreshs a tree automatically | object |
save
handles what happend, if the inspection will be saved. For example changing the status to 'COMPLETE'. key is the name of the attribute and the value to be changed when saving<attribute>: "<Value by completing>"
summary
handles the UI of the summary at the endcompact
if true, the summary will be only display the amount of answered, open and failured questions
"wizard": {
"main": {
"allPagesAllowed": true,
"complete": {
"save": {
"STATUS": "COMPLETED"
},
"summary": {
"compact": true
}
},
"description": {
"attribute": "INSPECTIONFORM/DESCRIPTION"
},
"tooltip": {
"attribute": "INSPECTIONFORM/DESCRIPTION_LONGDESCRIPTION"
},
"autoRefresh": {
"fetchTree": "inspection-wizard-fetch",
"dateFilterAttribute": "ENTEREDDATE",
"filter": [
{
"attribute": "RESULTNUM",
"value": "${RESULTNUM}"
}
]
}
}
}
The wizard page config is at a children of the root node and contains the information about the page.
properties | ||
---|---|---|
title |
shows the title of the page. It is a reference to the attribute. For changes change the attribtue value. | string |
tooltip |
can handle rich text and images (base64 formatted). It is displayed by a notification mark and triggers a popup. It is a reference to the attribute. It is a reference to the attribute. For changes change the attribtue value. | string |
"wizard": {
"page": {
"title": {
"attribute": "DESCRIPTION"
},
"tooltip": {
"attribute": "DESCRIPTION_LONGDESCRIPTION"
}
}
},
The wizard section configurations is a children of the root node
properties | ||
---|---|---|
label |
shows the label of the section. It is a reference to the attribute. For changes change the attribtue value. | string |
tooltip |
can handle rich text and images (base64 formatted). It is displayed by a notification mark and triggers a popup. See tooltip. | object |
warnIcon |
displays a warning icon next to the label. See warnIcon. | object |
number |
defines the number of the section | string / number |
image |
no maximo standard. Can handle an rich text image (base64 formatted). Displayes between label and the values of the section | string |
existsAttribute
checks if a tooltip existssideLoad
to reduce the traffic and get a better performance. The tooltip will be loaded by clickingattribute
is a refenrence to the attributefetchTree
defines the extra treefetchNode
defines the node
attribute
as attribute referencemapping
is an object and the keys are the different typesicon
the icon to be displayedcolor
of the icon. Click here for the available colors (optional)
"wizard": {
"section": {
"label": {
"attribute": "INSPQUESTION/DESCRIPTION"
},
"tooltip": {
"existsAttribute": "HASLD",
"sideLoad": {
"attribute": "DESCRIPTION_LONGDESCRIPTION",
"fetchTree": "insp-big-data",
"fetchNode": "quest"
}
},
"warnIcon": {
"attribute": "TYPE",
"attribute": "INSPFIELD/FIELDTYPE",
"mapping": {
"TR": {
"color": "color-red",
"icon": "icon-ghost"
},
"SE": {
"color": "color-yellow",
"icon": "icon-rocket"
}
}
},
"number": {
"attribute": "GROUPSEQ"
}
}
}
The wizard value configuration is a children of the root node and they contains
properties | ||
---|---|---|
attributeIdent |
need to be set to identify the value. requires an attribute reference in attribute |
object |
pageMatch |
need the groupId to match the values and the pages. requires an attribute in GROUPID |
object |
sectionMatch |
need the groupId to match the values and the pages. requires an attribute in INSPQUESTIONNUM |
object |
value |
of the input. See value |
object |
type |
of the value. See type |
object |
widget |
is a functionality of insight and optimized the view of the value. See widget For more information check widgets |
object |
required |
is a value required. Requires an attribute reference in attribute |
object |
label |
of the value. See label |
object |
tooltip |
can handle rich text and images (base64 formatted). It is displayed by a notification mark and triggers a popup. See tooltip . |
object |
labelBeside |
if true, the label is displayed inline next to the input. See labelBeside . |
object |
labelBeside |
if true, the label is displayed inline next to the input. See labelBeside . |
object |
warnIcon |
displays a warning icon next to the label. See warnIcon . |
object |
multiValue |
Enable/ disable the multiselection of values. See multiValue . |
object |
actionIcon |
Shows an icon next to the label. It triggers a menu action if clicked. See actionIcon . |
object |
options |
TODO | object |
image |
no maximo standard. Can handle an rich text image (base64 formatted). Displayes between label and the values of the section. requires an attribute reference in attribute |
object |
- In
attributes
which attribute should interpreted as these. Insight can handle String, Decimal, Date and Boolean. See attributes for more information. typeValue
is for special attribute like time and date
"value": {
"attributes": {
"String": "TXTRESPONSE",
"Decimal": "NUMRESPONSE",
"Date": "DATERESPONSE",
"Boolean": "boolValue"
},
"typeValue": {
"TO": "TIMERESPONSE",
"DT": {
"date": "DATERESPONSE",
"time": "TIMERESPONSE"
}
}
}
- requires an attribute reference in
attribute
- the assignment in the
mapping
refers to the different values of the referenced attributes js
for special characters
"type": {
"attribute": "INSPFIELD/FIELDTYPE",
"mapping": {
"String": [
"TR",
"SOD",
"SO",
"MO",
"MOD"
],
"Decimal": [
"SE",
"MM"
],
"Date": [
"DO",
"DT",
"TO"
],
"Boolean": "boolean",
"FileUpload": "FU"
},
"js": "if(object.properties['METER/METERTYPE'] == 'CHARACTERISTIC'){return 'String'}"
}
- requires an attribute reference in
attribute
- the assignment in the
mapping
refers to the different values of the referenced attributes js
for special characters
"widget": {
"attribute": "INSPFIELD/FIELDTYPE",
"mapping": {
"htmlInput:time": "TO",
"Datetime": "DT",
"InlineSelect": [
"SO",
"SOD",
"MO"
]
},
"js": "if(object.properties['INSPFIELD/FIELDTYPE'] == 'MOD'){return 'SelectList'}"
}
- requires an attribute reference in
attribute
- With
additional
additional information such as meter name, meter type or meter description etc. can be added
"label": {
"attribute": "INSPFIELD/DESCRIPTION",
"additional": [
"METERNAME",
"meter/METERTYPE",
"meter/DESCRIPTION"
]
}
existsAttribute
checks if a tooltip existssideLoad
to reduce the traffic and get a better performance. The tooltip will be loaded by clickingattribute
is a refenrence to the attributefetchTree
defines the extra treefetchNode
defines the node
"tooltip": {
"existsAttribute": "HASLD",
"sideLoad": {
"attribute": "DESCRIPTION_LONGDESCRIPTION",
"fetchTree": "insp-big-data",
"fetchNode": "quest"
}
}
- requires an attribute reference in
attribute
enabled
is an array of strings. If a string is matches the value of the attribute, the label is switched automaticallylabelWidth
can set the width of the label. Reduces the input. By default the label is 30% (optional)
"labelBeside": {
"attribute": "INSPFIELD/DESCRIPTION",
"enabled": [
"Foobar"
],
"labelWidth": "70%"
}
attribute
as attribute referencemapping
is an object and the keys are the different typesicon
the icon to be displayedcolor
of the icon. Click here for the available colors (optional)
"warnIcon": {
"attribute": "INSPFIELD/FIELDTYPE",
"mapping": {
"TR": {
"color": "color-red",
"icon": "icon-ghost"
},
"SE": {
"color": "color-yellow",
"icon": "icon-rocket"
},
"DT": {
"icon": "icon-cactus"
},
"SO": {
"color": "color-light-blue",
"icon": "icon-umbrella"
}
}
}
attribute
as attribute referenceenabled
is an array of strings. Enabled the multislection if a string is matches the value of the attribute.
"multiValue": {
"attribute": "INSPFIELD/FIELDTYPE",
"enabled": [
"MOD",
"MO"
]
}
menus
define a menu to be execute. See menusjs
it is possible to switch between two or more menusvisible
like menus visible. See menus visible
"actionIcon": {
"js": "if(object.properties['METER/METERTYPE'] == 'CONTINUOUS'){ executeMenu(0); }else{ executeMenu(1); }",
"menus": [
{
"action": "listDialog",
"actionValues": [
{
"tree": "meterreading",
"filter": [
{
"attribute": "METERNAME",
"value": "${METERNAME}"
}
]
}
]
},
{
"action": "listDialog",
"actionValues": [
{
"tree": "measurement",
"filter": [
{
"attribute": "METERNAME",
"value": "${METERNAME}"
}
]
}
]
}
]
}
"wizard": {
"value": {
"attributeIdent": {
"attribute": "INSPFIELDRESULTID"
},
"pageMatch": {
"GROUPID": "${INSPQUESTION/GROUPID}"
},
"sectionMatch": {
"INSPQUESTIONNUM": "${INSPQUESTIONNUM}"
},
"type": {
"attribute": "INSPFIELD/FIELDTYPE",
"mapping": {
"String": [
"TR",
"SOD",
"SO",
"MO",
"MOD"
],
"Decimal": [
"SE",
"MM"
],
"Date": [
"DO",
"DT",
"TO"
],
"Boolean": "boolean",
"FileUpload": "FU"
},
"js": "if(object.properties['METER/METERTYPE'] == 'CHARACTERISTIC'){return 'String'}"
},
"value": {
"attributes": {
"String": "TXTRESPONSE",
"Decimal": "NUMRESPONSE",
"Date": "DATERESPONSE",
"Boolean": "boolValue"
},
"typeValue": {
"TO": "TIMERESPONSE",
"DT": {
"date": "DATERESPONSE",
"time": "TIMERESPONSE"
}
}
},
"required": {
"attribute": "INSPFIELD/REQUIRED"
},
"label": {
"attribute": "INSPFIELD/DESCRIPTION",
"additional": [
"METERNAME",
"meter/METERTYPE",
"meter/DESCRIPTION"
]
},
"widget": {
"attribute": "INSPFIELD/FIELDTYPE",
"mapping": {
"htmlInput:time": "TO",
"Datetime": "DT",
"InlineSelect": [
"SO",
"SOD",
"MO",
"MOD"
]
},
"js": "if(object.properties['INSPFIELD/FIELDTYPE'] == 'MOD'){return 'SelectList'}"
},
"tooltip": {
"attribute": "INSPQUESTION/DESCRIPTION_LONGDESCRIPTION"
},
"labelBeside": {
"attribute": "INSPFIELD/FIELDTYPE",
"enabled": [
"MOD",
"MO"
],
"labelWidth": "70%"
},
"image": {
"attribute":"INSPFIELD/ICP_IMAGE"
},
"warnIcon": {
"attribute": "INSPFIELD/FIELDTYPE",
"mapping": {
"TR": {
"color": "color-red",
"icon": "icon-ghost"
},
"SE": {
"color": "color-yellow",
"icon": "icon-rocket"
},
"DT": {
"icon": "icon-cactus"
},
"SO": {
"color": "color-light-blue",
"icon": "icon-umbrella"
}
}
},
"multiValue": {
"attribute": "INSPFIELD/FIELDTYPE",
"enabled": [
"MOD",
"MO"
]
},
"options": {
"mapping": {
"SO": {
"hint": "INSPFIELDOPTION;DESCRIPTION",
"info": "INSPECTORFEEDBACK",
"color": "COLOR"
},
"SOD": {
"hint": "${MAXDOMAIN/DOMAINTYPE};VALUE"
},
"MO": {
"hint": "INSPFIELDOPTION;DESCRIPTION",
"info": "INSPECTORFEEDBACK",
"color": "COLOR"
},
"MOD": {
"hint": "${MAXDOMAIN/DOMAINTYPE};VALUE"
},
"MM": {
"hint": "${MAXDOMAIN/DOMAINTYPE};VALUE"
}
}
},
"actionIcon": {
"js": "if(object.properties['METER/METERTYPE'] == 'CONTINUOUS'){ executeMenu(0); }else{ executeMenu(1); }",
"menus": [
{
"action": "listDialog",
"actionValues": [
{
"tree": "meterreading",
"filter": [
{
"attribute": "METERNAME",
"value": "${METERNAME}"
}
]
}
]
},
{
"action": "listDialog",
"actionValues": [
{
"tree": "measurement",
"filter": [
{
"attribute": "METERNAME",
"value": "${METERNAME}"
}
]
}
]
}
],
"visible": {
"js": "return !!record.properties.METERNAME"
}
},
"readonly": {
"js": "return record.properties.formulaAttribute ? true : false;"
},
}
}
Conditions¶
Error and warning conditions¶
Wizards support error conditions, meaning a value is seen as invalid, as long as it does not pass the condition, blocking the ability to save the current record. To create an error condition, use the following notation:
{
"name": "myNodeConfig",
"icon": "icon-clock",
"label": "${myLabelAttribute}",
"wizard": {
"value": {
"error": [
{
"threshold": {
"attribute": "NUMBER1"
},
"operator": {
"attribute": "OPERATOR1"
},
"message": {
"attribute": "ERRORMESSAGE"
}
}
]
}
}
}
Please note that error and warnings need to be configured as children of the value
nodeConfig.
Error conditions support basic mathematical conditions which are taken from the configured operator
attribute and compared to the configured threshold
attribute. To show custom error messages, configure a message
attribute. Otherwise, default error messages are shown. Supported conditions are:
>
<
>=
<=
=
!=
Warning conditions act the same, but do not block the ability to save. Example:
{
"name": "myNodeConfig",
"icon": "icon-clock",
"label": "${myLabelAttribute}",
"wizard": {
"value": {
"warning": [
{
"threshold": {
"attribute": "NUMBER1"
},
"operator": {
"attribute": "OPERATOR1"
},
"message": {
"attribute": "WARNINGMESSAGE"
}
}
]
}
}
}
You can also invert the condition by using the inverted
flag. This will flip the logic applied and create a success message, if the condition is met, instead of creating an error when the condition is not met. Example:
{
"name": "myNodeConfig",
"icon": "icon-clock",
"label": "${myLabelAttribute}",
"wizard": {
"value": {
"warning": [
{
"inverted": true,
"threshold": {
"attribute": "NUMBER1"
},
"operator": {
"attribute": "OPERATOR1"
},
"message": {
"attribute": "WARNINGMESSAGE"
}
}
]
}
}
}
Formulas¶
Wizards support mathematical formulas. When configuring a formula, the resulting value will be written to the attribute value. Formulas support the typical operators as well as basic functions and referencing the values of other fields.
Supported Operators:
+
-
*
/
Supported functions:
SUM()
MIN()
MAX()
AVG()
If you want to configure a formula, you need to tell from which attribute to retrieve the to-be-calculated-formula as well as how to interprete the idents with which to reference other fields in the same wizard. Example:
{
"name": "myNodeConfig",
"icon": "icon-clock",
"label": "${myLabelAttribute}",
"wizard": {
"value": {
"formula": {
"attribute": "REF1SE + MIN(1, 5)",
"ident": "REF${sequence}${fieldType}"
}
}
}
}
Important:
- Make sure that no special characters exist in the ident to reference other fields. A field reference cannot start with a number.
- As a rule of thumb, make sure that all fields that contribute to the formula being calculated are visible to the user.
Formulas also support Date
and Time
based calculations. For these calculations to work, a few rules exist. Date
and Time
calculations cannot be mixed with each other or with numbers. Only subtraction is supported as addition, multiplication, division or any of the mentioned functions above would produce nonsensical results.
Examples:
2020-01-31 - 2020-01-30
: This is valid and would produce1
as a result10:00 - 8:30
: This is valid and would produce1.5
as a result2020-01-31 + 2020-01-30
: This is not valid2020-01-31 / 2020-01-30
: This is not valid2020-01-31 * 2020-01-30
: This is not validMIN(2020-01-31, 2020-01-30)
: This is not validMAX(2020-01-31, 2020-01-30)
: This is not validSUM(2020-01-31, 2020-01-30)
: This is not validAVG(2020-01-31, 2020-01-30)
: This is not valid2020-01-31 - 1
: This is not valid10:30 - 1
: This is not valid2020-01-31 - 10:30
: This is not valid