====ValueMatch====
**ValueMatch** is a //method// (or type) of [[state_rules|rule]] used to assign a [[state|state]] to your asset.
===Parameters===
^Name^Usage^
|property|The ARDI property to read from|
|regex|The regular expression to match with|
|name|The state of the value of //property// matches //regex//|
===Notes===
The 'property' value should be the name of an ARDI property found on all of the [[resource|resources]].
The 'regex' value should be a regular expression that is matched against the value of that property.
===Matching with Specific Values===
If you're matching with a single value, such as the example below...
{
"name": "Stopped",
"method": "ValueMatch",
"property": "Speed",
"regex": "0"
}
//The rule above will change the state of your resource to 'Stopped' if //Speed// drops to 0//.
===The Default Status===
You can match with //anything// using the '*' symbol.
{
"name": "Unknown",
"method": "ValueMatch",
"property": "Speed",
"regex": "*"
}
//This will set the status to 'Unknown' if the value of 'Speed' is anything at all - working as a 'default' or 'fallback' status.//
===Extracting a Secondary Status===
If you have a **group** in your regular expression, this is used as your [[secondary state|secondary state]].
{
"name": "Constrained",
"method": "ValueMatch",
"property": "Status",
"regex": "Stuck Behind (.*)"
}
//This will change the status to 'Constrained' when the 'Status' property contains "Stuck Behind " followed by a name. This name is then used as the secondary status//
//For example, if the machine status was 'Stuck Behind Unit 5', the final status would be **Constrained:Unit 5**.//