Rules
JSON types and schemas for the five eXvisory logic rule types.
Type | Description |
String ​ ​ | JSON string. Example: "device_restart_fix" |
Multiline ​ ​ ​ | JSON array of Strings (used for readability of long strings). Example:
[
"line one\\n\\n",
"line two" ] |
Condition ​ ​ ​ ​ | Reference (by "_class" and "label") to test or eliminator. For simple conditions "result" is a logic variable. By convention the variable has the same name as the condition "label". ?var ⇒ evaluate condition (if not already evaluated) $var ⇒ assign variable (if condition already evaluated) Example:
{ "_class" : "device_restart", "label" : fix", "result" : "?fix" } |
Variant condition ​ ​ ​ | See Variants.
As condition but "result" refers to a logic expression. The variable used in the logic expression must begin with ? and have the same name as the "label".
The special empty string "result" expression "" means evaluate this variant if no other variant conditions match.Examples:
|
Expression ​ ​ ​ | Legal characters: alphanumeric and ()_?$ Example:
"(or (not ?http_public) (not ?https_public))" |
Resources ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ | A JSON object containing string templates used by logic rules. Keys: alphanumeric + underscores. Example:
{ "key1" : "**resource 1** with {{ test_label }} macro",
"key2" : [ "Multiline _resource 2_ ",
"with {{ another_test_label }} macro ",
"and [markdown link](https://exvisory.ai)"
] } |
​Faults are specific diagnosable problems.
Note: we also use the plural term 'faults' to refer collectively to both fault and fault group logic rules (but we'll always try to make that clear from the context).
Schema
Example
Key | Type | Description |
"_class" ​ ​ ​ | Fault class (unique across all faults and fault groups).
Legal characters: alphanumeric (a-zA-Z0-9_) Example:
"device_restart_fix" | |
"comment" | Developer comment to describe the fault.
Example:
"Temporary problem fixed by restarting device" | |
"conditions" ​ ​ ​ ​ ​ | Conditions are tests or eliminators evaluated to find or eliminate this fault (query tests ask the user questions). All conditions are evaluated and their results assigned to variables. Example:
[ { "_class" : "device_restart", "label" : "fix", "result" : "?fix" } ] | |
"result" ​ ​ | Result of fault evaluation. Refers to variables assigned by evaluating "conditions". Example:
"(eq ?fix y)" | |
"resources" ​ ​ ​ ​ ​ | String templates used by Fault.
Valid resource keys:
At least one of "found" or "eliminated" should be present.
Example:
{
"found" : "Unknown problem, fixed by restarting device." } |
device_restart_fix fault at https://dev.exvisory.ai/apps/sample-mobile
{
"_class" : "device_restart_fix",
"comment" : "Temporary problem fixed by restarting device",
"conditions" : [
{ "_class" : "device_restart", "label" : "fix", "result" : "?fix" }
],
"result" : "(eq ?fix y)",
"resources" : {
"found" : "Unknown problem, fixed by restarting device."
}
}
​Fault groups are groups of related faults organised into a containment hierarchy.
Note: we also use the plural term 'faults' to refer collectively to both fault and fault group logic rules (but we'll always try to make that clear from the context).
Schema
Example
Key | Type | Description |
"_class" ​ | Fault class (unique across all faults and fault groups). Legal characters: alphanumeric (a-zA-Z0-9_) Example:
"power" | |
"comment" ​ ​ | Developer comment to describe the fault group. Example:
"problem related to battery, power or charging" | |
"subclasses" ​ ​ | ​ | Ordered array of "_class" names of sub-faults.
Example:
[ "battery", "charging", "power_up" ] |
"resources"
​ ​ | String templates used by fault group. Valid resource keys:
All these resource keys are optional.
Example:
{ "scoped" : [ "Unknown problem with device battery, power or charging" ] } |
power (fault group) at https://dev.exvisory.ai/apps/sample-mobile
{
"_class" : "power",
"comment" : "problem related to battery, power or charging",
"subclasses" : [ "battery", "charging", "power_up" ],
"resources" : {
"scoped" : [
"Unknown problem with device battery, power or charging"
]
}
}
​
Schema
Example
Key | Type | Description |
"_class" ​ ​ ​ | Fault group class to which the eliminator applies. Legal characters: alphanumeric (a-zA-Z0-9_) Example: "cellular_data" | |
"label" ​ | ​ | Eliminator label (unique within fault), must be "eliminator". Legal characters: alphanumeric (a-zA-Z0-9_) |
"variant" ​ ​ ​ ​ | Eliminator variant (required, unique within eliminator).
Legal characters: alphanumeric (a-zA-Z0-9_) By convention "default" if only one variant. Example: "default" | |
"comment" ​ ​ | Developer comment to describe the eliminator. Example: "ELIMINATED if not using mobile network" | |
"conditions" ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ | Eliminator conditions are tests or eliminators evaluated to ELIMINATE or SCOPE this fault "_class" (query tests ask the user questions). If the first condition is a variant condition its "result" field is a logic expression that decides which eliminator variant is to be fully evaluated. When an eliminator is fully evaluated all its conditions are evaluated and their results assigned to variables. Example:
[
{ "_class" : "wireless", "label" : "eliminator", "result" : "?we" },
{ "_class" : "internet", "label" : "network", "result" : "?network" }
] | |
"result" ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ | Object ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ | ​Eliminators evaluate to ELIMINATED, SCOPED or UNKNOWN by logically combining the variables from their conditions. This is captured by a JSON object with keys "ELIMINATED", "SCOPED" or "UNKNOWN" referring to logic expressions that refer to the condition variables.
There are a limited number of key combinations:
Example: { "ELIMINATED" : "(neq ?network mobile)",
"SCOPED" : "(eq ?we SCOPED)",
"UNKNOWN" : "" } which means"if not using mobile data network ELIMINATE this fault, otherwise if fault is scoped to parent narrow SCOPE to this fault, otherwise evaluate as UNKNOWN and continue inference". |
"resources" ​ ​ ​ ​ ​ ​ ​ | String templates used by eliminator. Valid resource keys:
|
cellular_data eliminator at https://dev.exvisory.ai/apps/sample-mobile
{
"_class" : "cellular_data",
"label" : "eliminator",
"variant" : "default",
"comment" : "ELIMINATED if not using mobile network",
"conditions" : [
{ "_class" : "wireless", "label" : "eliminator", "result" : "?we" },
{ "_class" : "internet", "label" : "network", "result" : "?network" }
],
"result" : {
"ELIMINATED" : "(neq ?network mobile)",
"SCOPED" : "(eq ?we SCOPED)",
"UNKNOWN" : ""
},
"resources" : {
"eliminated" : "Fault is not with mobile network - using {{internet_network_usr}} network."
}
}
Schema
Example
Key | Type | Description |
"_class" ​ ​ |