ApptSearch Object Format
ApptSearch Object Properties
Property | Type | Required? | Description | |||
Providers | array | Yes | An array of strings, defining which configured Providers should be used when searching for appointment offerings when not directed to specific Providers via a matching See the description above which explains when and how the Supported values:
| |||
PreferredProvider | string | Yes | A string, defining which of the configured Providers values should be used as the preferred Provider, for the relevant tenant. See the description above which explains when and how the When Supported values:
| |||
SearchRules | array | No | An array of SearchRules, which are evaluated in order. If no SearchRules are required, the
| |||
Enabled | boolean | Yes | Is the SearchRule enabled? When false , the SearchRule will be skipped, and not evaluated. | |||
Name | string | Yes | A string describing the SearchRule, to assist with managing SearchRules. | |||
Rules | array | Yes | An array of one or more rules for the SearchRule. All of the rules defined in the SearchRule need to match for the overall SearchRule to match (i.e. logical AND evaluation). | |||
Type | enum | Yes | One of three defined string values, which determines how the rule should be evaluated. Supported values:
| |||
Matches | array | No | An array of one or more matches to be used when evaluating the rule, when the Required when the Each match is a JsonPath filter, which is evaluated against the search object supplied via the REST Work Item Appointment Search. | |||
Params | object | No | An object defining the match to be used when evaluating the rule, when the Required when the | |||
Id | string | Yes | The | |||
Op | enum | Yes | A string defining the relationship between the Value and the data set.
| |||
Value | string | Yes | The field of the search object supplied via the REST Work Item Appointment Search which should be compared with the data set. | |||
Outcome | object | Yes | An object defining the outcome of what should be done when the overall rule matches. Currently the only supported outcome is a Providers array. | |||
Providers | array | Yes | An array defining the Providers that the appointment search should be sent to when the overall rule matches. The array must contain one or more strings, defining which Provider or Providers to send the appointment search to. Supported values:
| |||
TransformIn | object | Yes | An object, containing both an The The
Where no default search object values should be added to the search object, the relevant sub-object should be an empty object - for example: "TransformIn": { "SD": {}, "SS": {} } As an example where default search object values are to be set: "TransformIn": { "SD": { "WorkType": { "Name": "WORK_TYPE" }, "Location": { "Postcode": "12345", "Country": "USA" }, "Product": { "BrandCode": "CODE_1", "ProductCode": "PROD_1" } }, "SS": { "WorkType": { "Name": "WORK_TYPE" } } } With the above
|
SearchRules Examples
For the examples below, assume that the tenant has created a ZIP_CODES
data set containing the following values:
12345 12346 12347
Also assume that the SearchRules value of the tenant's ApptSearch object is:
"SearchRules": [ { "Enabled": false, "Name": "Send ZIP_CODES to SS - Disabled", "Rules": [ { "Type": "DataSet", "Params": { "Id": "ZIP_CODES", "Op": "In", "Value": "$.Location.Postcode" } } ], "Outcome": { "Providers": [ "SS" ] } }, { "Enabled": true, "Name": "Send ZIP_CODES to SD", "Rules": [ { "Type": "DataSet", "Params": { "Id": "ZIP_CODES", "Op": "In", "Value": "$.Location.Postcode" } } ], "Outcome": { "Providers": [ "SD" ] } }, { "Enabled": true, "Name": "Send WORK_TYPE_1 & WORK_TYPE_2 + CODE_1/BRAND_1 to SS", "Rules": [ { "Type": "Any", "Matches": [ "$[?(@.WorkType.Name=='WORK_TYPE_1')]", "$[?(@.WorkType.Name=='WORK_TYPE_2')]" } }, { "Type": "All", "Matches": [ "$[?(@.Product.BrandCode=='BRAND_1')]", "$[?(@.Product.ProductCode=='PRODUCT_1')]" } } ], "Outcome": { "Providers": [ "SS" ] } } ]
Example #1
For this example, assume that the search object provided via the REST Work Item Appointment Search contains the following data (this is not a complete object - it only contains the relevant data for the purposes of evaluating the SearchRules):
{ "Location": { "Postcode": 12346 }, "Product": { "BrandCode": "BRAND_1", "ProductCode": "PRODUCT_1" }, "WorkType": { "Name": "WORK_TYPE_1" } }
For this example:
- The first SearchRule has
Enabled
set tofalse
, therefore the first rule is not evaluated. - The second SearchRule matches when:
- the
Location > Postcode
value of the search object is in theZIP_CODES
data set.
- the
- The search object matches this condition.
- Therefore, this SearchRule matches, and the outcome will be that this appointment search will be sent to ServiceDispatch.
Example #2
For this example, assume that the search object provided via the REST Work Item Appointment Search contains the following data (this is not a complete object - it only contains the relevant data for the purposes of evaluating the SearchRules):
{ "Location": { "Postcode": 12348 }, "Product": { "BrandCode": "BRAND_1", "ProductCode": "PRODUCT_1" }, "WorkType": { "Name": "WORK_TYPE_1" } }
For this example:
- The first SearchRule has
Enabled
set tofalse
, therefore the first rule is not evaluated. - The second SearchRule matches when:
- the
Location > Postcode
value of the search object is in theZIP_CODES
data set.
- the
- The search object has a
Location > Postcode
value of12348
, which is not in theZIP_CODES
data set.- Therefore, the second SearchRule does not match.
- The third SearchRule matches when:
- the
WorkType > Name
value is eitherWORK_TYPE_1
orWORK_TYPE_2
; and - the
Product > Brand Code
value isBRAND_1
and theProduct > Product Code
value isPRODUCT_1
.
- the
- The search object matches this condition.
- Therefore, this SearchRule matches, and the outcome will be that this appointment search will be sent to ServiceScheduling.
Example #3
For this example, assume that the search object provided via the REST Work Item Appointment Search contains the following data (this is not a complete object - it only contains the relevant data for the purposes of evaluating the SearchRules):
{ "Location": { "Postcode": 12348 }, "Product": { "BrandCode": "BRAND_1", "ProductCode": "PRODUCT_2" }, "WorkType": { "Name": "WORK_TYPE_1" } }
For this example:
- The first SearchRule has
Enabled
set tofalse
, therefore the first rule is not evaluated. - The second SearchRule matches when:
- the
Location > Postcode
value of the search object is in theZIP_CODES
data set.
- the
- The search object has a
Location > Postcode
value of12348
, which is not in theZIP_CODES
data set.- Therefore, the second SearchRule does not match.
- The third SearchRule matches when:
- the
WorkType > Name
value is eitherWORK_TYPE_1
orWORK_TYPE_2
; and - the
Product > Brand Code
value isBRAND_1
and theProduct > Product Code
value isPRODUCT_1
.
- the
- The search object has a
Product > Brand Code
value ofBRAND_2
, which means that theAll
requirement of the second part of the rules does not match.- Therefore third SearchRule does not match.
As a result, none of the SearchRules match.
Therefore, the appointment search will be sent as configured based on the tenant's ApptSearch Providers
and PreferredProvider
values.