30 hash<string, AbstractDataField> record_type;
32 #! The original field type names
33 hash<string, string> field_types;
35 #! Hash of date/time fields for this record
36 hash<string, bool> date_time_fields;
38 #! Hash of boolean fields for this record
39 hash<string, bool> bool_fields;
41 #! Hash of integer fields for this record
42 hash<string, bool> int_fields;
70 "value":
"glide_date_time",
80 "value":
"glide_date_time",
88 "exp": AbstractDataProvider::GenericExpressions{DP_OP_AND},
89 "impl":
string sub (
string cn,
auto arg) {
90 throw "WHERE-ERROR",
"ServiceNow does not support nested boolean logic in queries";
94 "exp": sym(AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_EQ},
QUERY_OP_EQ),
95 "impl":
string sub (
string cn,
auto arg) {
96 return sprintf(
"%s=%s", cn, arg);
100 "exp": sym(AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_NE},
QUERY_OP_NE),
101 "impl":
string sub (
string cn,
auto arg) {
102 return sprintf(
"%s!=%s", cn, arg);
106 "exp": sym(AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LT},
QUERY_OP_LT),
107 "impl":
string sub (
string cn,
auto arg) {
108 return sprintf(
"%s<%s", cn, arg);
112 "exp": sym(AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_LE},
QUERY_OP_LE),
113 "impl":
string sub (
string cn,
auto arg) {
114 return sprintf(
"%s<=%s", cn, arg);
118 "exp": sym(AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GT},
QUERY_OP_GT),
119 "impl":
string sub (
string cn,
auto arg) {
120 return sprintf(
"%s>%s", cn, arg);
124 "exp": sym(AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_GE},
QUERY_OP_GE),
125 "impl":
string sub (
string cn,
auto arg) {
126 return sprintf(
"%s>=%s", cn, arg);
130 "exp": sym(AbstractDataProvider::GenericExpressions{DP_SEARCH_OP_IN},
QUERY_OP_IN),
131 "impl":
string sub (
string cn,
auto arg) {
132 return sprintf(
"%sIN%s", cn, (foldl $1 +
"," + $2, arg));
136 "exp": <DataProviderExpressionInfo>{
137 "type": DET_Operator,
140 "desc":
"An expression with the ServiceNow 'notin' operator",
142 "args": (DataProviderSignatureFieldType, DataProviderSignatureStringValueType),
143 "return_type": AbstractDataProviderTypeMap.
"bool",
145 "impl":
string sub (
string cn,
auto arg) {
146 return sprintf(
"%sNOTIN%s", cn, (foldl $1 +
"," + $2, arg));
150 "exp": <DataProviderExpressionInfo>{
151 "type": DET_Operator,
154 "desc":
"An expression with the ServiceNow 'like' operator",
156 "args": (DataProviderSignatureFieldType, DataProviderSignatureStringValueType),
157 "return_type": AbstractDataProviderTypeMap.
"bool",
159 "impl":
string sub (
string cn,
auto arg) {
160 return sprintf(
"%sLIKE%s", cn, arg);
164 "exp": <DataProviderExpressionInfo>{
165 "type": DET_Operator,
168 "desc":
"An expression with the ServiceNow 'notlike' operator",
170 "args": (DataProviderSignatureFieldType, DataProviderSignatureStringValueType),
171 "return_type": AbstractDataProviderTypeMap.
"bool",
173 "impl":
string sub (
string cn,
auto arg) {
174 return sprintf(
"%sNOTLIKE%s", cn, arg);
178 "exp": <DataProviderExpressionInfo>{
179 "type": DET_Operator,
182 "desc":
"An expression with the ServiceNow 'startswith' operator",
183 "symbol":
"STARTSWITH",
184 "args": (DataProviderSignatureFieldType, DataProviderSignatureStringValueType),
185 "return_type": AbstractDataProviderTypeMap.
"bool",
187 "impl":
string sub (
string cn,
auto arg) {
188 return sprintf(
"%sSTARTSWITH%s", cn, arg);
192 "exp": <DataProviderExpressionInfo>{
193 "type": DET_Operator,
196 "desc":
"An expression with the ServiceNow 'endswith' operator",
197 "symbol":
"ENDSWITH",
198 "args": (DataProviderSignatureFieldType, DataProviderSignatureStringValueType),
199 "return_type": AbstractDataProviderTypeMap.
"bool",
201 "impl":
string sub (
string cn,
auto arg) {
202 return sprintf(
"%sISEMPTY", cn);
206 "exp": <DataProviderExpressionInfo>{
207 "type": DET_Operator,
210 "desc":
"An expression with the ServiceNow 'isnotempty' operator",
211 "symbol":
"ISNOTEMPTY",
212 "args": (DataProviderSignatureFieldType,),
213 "return_type": AbstractDataProviderTypeMap.
"bool",
215 "impl":
string sub (
string cn,
auto arg) {
216 return sprintf(
"%sISNOTEMPTY", cn);
243 *hash<string, DataProvider::AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
254 *hash<auto> search_options) {
286 *hash<auto> search_options) {
294 AbstractDataProviderRecordIterator i =
searchRecords(where_cond, search_options + {
"columns":
"sys_id"});
333 return <DataProviderExpression>{
334 "exp": info.expressions.eq,
335 "args": (<DataProviderFieldReference>{
"field": key},) + value,
342hash<DataProviderExpressionInfo> sym(hash<DataProviderExpressionInfo> exp,
string label);
AbstractDataProviderRecordIterator searchRecords(*hash< auto > where_cond, *hash< auto > search_options)
Defines the record iterator class for Table-based iterators.
Definition: ServiceNowRestRecordIterator.qc.dox.h:28
The ServiceNowTableDataProvider data provider class.
Definition: ServiceNowTableDataProvider.qc.dox.h:46
const SysColumns
System columns.
Definition: ServiceNowTableDataProvider.qc.dox.h:62
getRecordInfoIntern()
Retrieves the record type.
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Creates the given record to the data provider.
hash< auto > meta
Metadata description.
Definition: ServiceNowTableDataProvider.qc.dox.h:59
hash< auto > access
Access description.
Definition: ServiceNowTableDataProvider.qc.dox.h:56
deleteSingleRecord(string id)
deletes a single record
private hash< DataProviderExpression > getEqualityComparisonExpression(int role, hash< DataProviderInfo > info, string key, auto value)
Returns an equality comparison expression.
Definition: ServiceNowTableDataProvider.qc.dox.h:331
updateSingleRecord(string id, hash< auto > set)
updates a single record
string uri_path
URI path prefix.
Definition: ServiceNowTableDataProvider.qc.dox.h:226
constructor(ServiceNowRestClient rest, string name, hash< auto > access, hash< auto > meta)
Creates the object from the arguments.
const Expressions
Supported expressions.
Definition: ServiceNowTableDataProvider.qc.dox.h:86
string name
Current object name.
Definition: ServiceNowTableDataProvider.qc.dox.h:53
hash< ServiceNowRestRecordInfo > record_info()
Record info for the table.
private DataProvider::AbstractDataProviderRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
Definition: ServiceNowTableDataProvider.qc.dox.h:253
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
int deleteRecordsImpl(*hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Deletes zero or more records.
string getName()
Returns the data provider name.
ServiceNowRestClient::ServiceNowRestClient rest
The REST client object for API calls.
Definition: ServiceNowTableDataProvider.qc.dox.h:50
private int updateRecordsImpl(hash< auto > set, hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
Definition: ServiceNowTableDataProvider.qc.dox.h:285
string getDesc()
Returns the data provider description.
const QUERY_OP_ENDSWITH
ends with operator
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:50
const QUERY_OP_STARTSWITH
starts with operator
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:55
const QUERY_OP_IN
the Query "IN" operator for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:100
const QUERY_OP_GE
the Query greater than or equals operator (>=) for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:75
const QUERY_OP_NE
the Query not equals operator (!= or <>) for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:80
const QUERY_OP_GT
the Query greater than operator (>) for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:70
const QUERY_OP_LT
the Query less than (<) operator for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:60
const QUERY_OP_LIKE
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:40
const QUERY_OP_LE
the Query less than or equals (<=) operator for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:65
const QUERY_OP_EQ
the Query equals operator (=) for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:85
const QUERY_OP_ISNOTEMPTY
the Query "is not empty string" operator (ISNOTEMPTY) for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:95
const QUERY_OP_NOTIN
the Query "NOTIN" operator for use in queries
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:105
const QUERY_OP_NOTLIKE
not like operator
Definition: ServiceNowRestDataProviderDefs.qc.dox.h:45
Qore ServiceNowRestDataProvider module definition.
Definition: ServiceNowRestDataProvider.qc.dox.h:26
hashdecl ServiceNowRestRecordInfo
contains ServiceNow object record information
Definition: ServiceNowTableDataProvider.qc.dox.h:28