Qorus Integration Engine®
4.0.3.p2_git
|
This section covers APIs and API concepts common to all Qorus user code, workflows, services, and jobs for the Qore proggramming language.
For the Java common and workflow APIs, please see:
The following Qore modules are imported into all user objects:
Name | Description |
json | provides APIs for JSON data serialization and deserialization support |
Mime | provides MIME definitions and functionality |
Mapper | provides a data-mapping API |
SoapClient | provides a SOAP client API |
SqlUtil | provides high-level APIs for programmatic DML (SQL data manipulation), DDL (creating, querying, manipulating database definitions), and DBA operations |
TableMapper | provides high-level APIs for mapping data to and from database tables |
Util | provides utility APIs |
uuid | provides an API for generating UUIDs |
xml | provides APIs for parsing, validating, and generating XML documents |
yaml | provides APIs for Qore's YAML-based data serialization and deserialization support |
The following classes are imported into all user objects:
Qore Class | Java Class | Description |
AbstractFsRemoteReceive | AbstractFsRemoteReceive | provides an API for streaming data from a remote filesystem through a remote Qorus instance |
AbstractParallelStream | n/a | provides an abstract base class for streaming data to or from a remote database through a remote Qorus instance and also provides static helper methods |
DbRemote | DbRemote | provides an API wrapper for all system.sqlutil service methods |
DbRemoteReceive | DbRemoteReceive | provides an API for streaming data from a remote database through a remote Qorus instance |
DbRemoteSend | DbRemoteSend | provides an API for streaming data to a remote database through a remote Qorus instance |
FsRemote | FsRemote | provides an API wrapper for all system.fs service methods |
FsRemoteSend | FsRemoteSend | provides an API for streaming data to a remote filesystem through a remote Qorus instance |
QorusInboundTableMapper | InboundTableMapper | provides an API for mapping data to a DB table |
QorusInboundTableMapperIterator | n/a | provides an iterator-based API for mapping data to a DB table |
QorusRawSqlStatementOutboundMapper | RawSqlStatementOutboundMapper | provides an API for mapping from SQL statement using direct SQL statements passed in |
QorusRemoteServiceHelper | n/a | provides an API for calling service methods in remote Qorus instances |
QorusSqlStatementOutboundMapper | SqlStatementOutboundMapper | provides an API for mapping from SQL statement using SqlUtil |
QorusSystemAPIHelper | n/a | provides an API for calling RPC API methods in remote Qorus instances |
OMQ::QorusSystemRestHelper | QorusSystemRestHelper | provides an API for using the REST API in remote Qorus instances |
Qore Method | Java Method | Qore Function | Description |
JobApi::log() | JobApi.log() | log() | outputs information in the relevant log file |
Qore Method | Java Method | Qore Function | Description |
UserApi::getDatasourceDedicated() | n/a | get_datasource_dedicated() | returns a dedicated Qore::SQL::Datasource object |
UserApi::getDatasourcePool() | UserApi.getDatasourcePool() | get_datasource_pool() | returns a shared Qore::SQL::DatasourcePool object |
UserApi::getRemoteRestConnection() | UserApi.getRemoteRestConnection() | get_remote_rest_connection() | returns a QorusSystemRestHelper to a remote Qorus instance |
UserApi::getRemoteRpcConnection() | n/a | get_remote_rpc_connection() | returns a QorusSystemAPIHelper to a remote Qorus instance |
UserApi::getUserConnection() | UserApi.getUserConnection() | get_user_connection() | returns the given user connection object |
The following classes provide Work with Data Streaming to iterate with remote Qorus instances
Qore Class | Java Class | Description |
AbstractFsRemoteReceive | AbstractFsRemoteReceive | provides an API for streaming data from a remote filesystem through a remote Qorus instance |
AbstractParallelStream | n/a | provides an abstract base class for streaming data to or from a remote database through a remote Qorus instance and also provides static helper methods |
DbRemote | DbRemote | provides an API wrapper for all system.sqlutil service methods |
DbRemoteReceive | DbRemoteReceive | provides an API for streaming data from a remote database through a remote Qorus instance |
DbRemoteSend | DbRemoteSend | provides an API for streaming data to a remote database through a remote Qorus instance |
FsRemote | FsRemote | provides an API wrapper for all system.fs service methods |
FsRemoteSend | FsRemoteSend | provides an API for streaming data to a remote filesystem through a remote Qorus instance |
Qore Method | Java Method | Qore Function | Description |
UserApi::clearSqlTableCache() | UserApi.clearSqlTableCache() | clear_sql_table_cache() | clears a cached table from the SQL cache |
UserApi::getSqlTable() | UserApi.getSqlTable() | get_sql_table() | retrieves an AbstractTable object from the SQL cache for DML operations |
UserApi::getSqlCacheInfo() | UserApi.getSqlCacheInfo() | get_sql_cache_info() | returns information about the SQL cache |
The following functions provide APIs to work with Qorus Value Maps
Qore Method | Java Method | Qore Function | Description |
UserApi::getValueMap() | UserApi.getValueMap() | get_value_map() | retrieves a value mapping from a value map |
UserApi::getValueMaps() | UserApi.getValueMaps() | get_value_maps() | retrieves a list of all known value sets |
Qore Method | Java Method | Qore Function | Description |
UserApi::raiseTransientAlert() | UserApi.raiseTransientAlert() | raise_transient_alert() | raises a transient alert |
Qore Method | Java Method | Qore Function | Description |
UserApi::auditCheckEventString() | UserApi.auditCheckEventString() | audit_check_event_string() | checks if the given audit event (given as a string) is enabled |
UserApi::auditCheckEvent() | UserApi.auditCheckEvent() | audit_check_event() | checks if the given audit event (given as an integer code) is enabled |
UserApi::auditGetMask() | UserApi.auditGetMask() | audit_get_mask() | returns the audit event mask |
UserApi::auditUserEvent() | UserApi.auditUserEvent() | audit_user_event() | creates a user audit event (with audit event code OMQ::AE_USER_EVENT) against the workflow, service, or job instance |
Qore Method | Java Method | Qore Function | Description |
UserApi::getOption() | see interface API classes | get_option() | returns the value of one or more system or interface options |
UserApi::getQorusOptions() | UserApi.getQorusOptions() | get_qorus_options() | returns the value of system options |
UserApi::getQorusOptionsArgs() | UserApi.getQorusOptionsArgs() | get_qorus_options_args() | returns the value of system options |
UserApi::getQorusOptionInfo() | UserApi.getQorusOptionInfo() | get_qorus_option_info() | returns information about system options |
UserApi::getQorusOptionInfoArgs() | UserApi.getQorusOptionInfoArgs() | get_qorus_option_info_args() | returns information about system options |
UserApi::setOption() | see interface API classes | set_option() | sets option values on a workflow, service, or job |
Qore Method | Java Method | Qore Function | Description |
UserApi::propGet() | UserApi.propGet() | prop_get() | returns the value of the given system property key in the given domain or NOTHING if the system property does not exist |
UserApi::propUpdate() | UserApi.propUpdate() | prop_update() | changes (inserts, updates, or deletes) the value of one or more system properties |
Qore Method | Java Method | Qore Function | Description |
UserApi::flushSlaEvents() | UserApi.flushSlaEvents() | flush_sla_events() | flushes all pending SLA events to the DB |
UserApi::postSlaEventError() | UserApi.postSlaEventError() | post_sla_event_error() | posts an unsuccessful SLA and performance tracking event |
UserApi::postSlaEventSuccess() | UserApi.postSlaEventSuccess() | post_sla_event_success() | posts a successful SLA and performance tracking event |
Qore Method | Java Method | Description |
UserApi::expandOneVariable() | UserApi.expandOneVariable() | expands one variable in a templated string |
UserApi::expandTemplatedValue() | UserApi.expandTemplatedValue() | expands all variables in a templated string |
UserApi::bbParseExactlyOneVariable() | UserApi.bbParseExactlyOneVariable() | parses one template variable and returns a hash with its parts |
UserApi::getInputData() | UserApi.getInputData() | returns input data |
UserApi::updateOutputData() | UserApi.updateOutputData() | updates output data |
Qorus services can be called from anywhere in Qorus user code (from a workflow, from another service, or in a job). To call a service from Qore, use the ::omqservice object imported into every workflow, service, and job program object as follows:
For example, to get information about a workflow order from its order key:
To call a service method from Java, use the UserApi.callRestApi() method as in the following example:
Template substitution strings in building block APIs have one of the following formats:
$
type:
value$
type:{
value}
Values may be enclosed in square brackets to separate value characters from other characters that might otherwise be considered part of the value string.
Value characters for values are alphanumeric characters, plus underscore ("_"
), and the dot ("."
) character to reference hash members. Value strings enclosed in curly brackets ('{}'
) can be any character except a close curly bracket ('}'
).
"."
) characters may be escaped with a backslack character ("\\"
) before the dot to ensure that the dot is used as a part of the string and not a field separator; ex: "field\.with\.dots"
Valid types and values are given in the following table.
Template Substitution String Values
Context | Type | Value | Data Type | Read/Write | Example | Description |
all | config | any | any | R | $config:item_name | the value of the given configuration item |
all | config | * | *hash | R | $config:* | the value of all configuration items as a hash keyed by item name |
all | local | type | string | R | $local:type | the interface type: "workflow" , "service" , or "job" |
all | local | name | string | R | $local:name | the interface name |
all | local | version | string | R | $local:version | the interface version |
all | local | id | int | R | $local:id | the interface ID |
all | local | * | *hash | R | $local:* | the entire local context hash |
all | rest | REST URI path | any | R | $rest:{remote/user/my-connection/url_hash/path} | the result of a GET request to the given system API URI path in the latest REST API |
all | timestamp | date_formatting "date format" | string | R | $timestamp:{YYYY-MM-DD HH:mm:SS.xx Z} | a timestamp formatted according to the value as the format argument (see Date Formatting Codes for more information on the timestamp format argument) |
job | info | any | any | RW | $info:key | the value of the given key in the job's info hash |
job | info | * | *hash | R | $info:* | the entire job info hash |
job | local | job_instanceid | int | R | $local:job_instanceid | the job instance ID |
job | state | any | any | RW | $state:key | the value of the given key in the job's state hash |
job | state | * | *hash | R | $state:* | the entire job state hash |
service | local | servicetype | string | R | $local:servicetype | the service type: "user" or "system" |
service | state | any | any | RW | $state:key | the value of the given key in the service's state hash |
service | state | * | *hash | R | $state:* | the entire service state hash |
workflow | dynamic | any | any | RW | $dynamic:order.ID | the given value from the workflow order's dynamic data hash; dot notation accepted |
workflow | dynamic | * | *hash | R | $dynamic:* | the entire dynamic data hash |
workflow | feedback | any | any | W | $feedback:key | provides the name of the key that the given output data value will be saved to in the parent order; only valid for child orders in a subworkflow hierarchy; each feedback key value is subject to recursive template substitution with UserApi::expandTemplatedString() |
workflow | keys | any | any | RW | $keys:order_id | the value of the given workflow order key; each orde key value is subject to recursive template substitution with UserApi::expandTemplatedString() |
workflow | local | execid | int | R | $local:execid | the workflow execution instance ID |
workflow | local | stepname | string | R | $local:stepname | the step name |
workflow | local | stepversion | string | R | $local:stepversion | the step version |
workflow | local | stepid | int | R | $local:stepid | the step ID |
workflow | local | ind | int | R | $local:ind | the step index value |
workflow | local | workflow_instanceid | int | R | $local:workflow_instanceid | the workflow instance ID |
workflow | sensitive | skey. svalue. ... | any | RW | $sensitive:taxid.xxxx.address | the given value from the workflow order's sensitive data hash; dot notation accepted; the first two components of the value are the sensitive data key and the sensitive data value |
workflow | sensitive-alias | alias. ... | any | RW | $sensitive-alias :{cust-1.address} | the given value from the workflow order's sensitive data hash with the given alias; dot notation accepted; the first component of the value is the sensitive data alias value |
workflow | static | any | any | R | $static:order.ID | the given value from the workflow order's static data hash; dot notation accepted |
workflow | static | * | *hash | R | $static:* | the entire static data hash |
workflow | step | any | any | RW | $step:{order-data.address} | the given value from the current step's step data hash; dot notation accepted |
workflow | step | * | *hash | R | $step:* | the entire step data hash |
"$static:{step.order.address}"
; strings with characters outside the acceptable range (
[a-zA-Z_0-9]) must be enclosed with curly brackets; ex: "$static:{account-1.customer-name}"
W
above can also be used with UserApi::updateOutputData()