Qorus Integration Engine
3.0.4.p7
|
This section describes additional classes, constants, and functions that are imported into service Program objects by the Qorus system itself that make up the Qorus Service API.
Each Qorus service has a single Qore Program object containing all its code for the step, array, validation, async end functions, as well as any objects imported into the Program object (classes, constants, and functions listed as attributes of the service when the service is defined).
Service Program objects are restricted from using elements of the Qore Language related to process and thread control; the use of these functions is either dangerous or could violate the integrity of the Qorus server process and therefore is restricted.
To enforce these restrictions, service Program objects are created with the following parse restrictions:
Please see the above links for more information on the features made unavailable when these parse options are set.
Please note that despite these restrictions, service program objects have most of the Qore language API and class library available for use.
Furthermore, the following parse defines are defined:
"Qorus"
(common to workflows, services, and jobs)"QorusServer"
(common to workflows, services, and jobs)"QorusHasUserConnections"
(common to workflows, services, and jobs)"QorusHasAlerts"
(common to workflows, services, and jobs)"QorusService"
(service-specific)"QorusHasHttpUserIndex"
(service-specific)Services may declare global variables, but because the %no-top-level parse restriction is set for the Program object; they may not be initialized at the top level of the program.
Initialize them in the init()
method instead; global variables may also be declared here if desired. Global variables may be declared anywhere in the Program object; they do not have to be declared at the top level of the service program.
This section will list all of the functions specific to service programs.
Note that service-specific API functions are found in the OMQ::UserApi::Service namespace and are prefixed by "svc_"
for consistency's sake and ease of identification.
id
(int): the unique event ID for the application session; the first event starts with 1 and increases serially with each eventtime
(date): the date and time the event was submitted with a resolution to the microsecondtimeus
(int): the microsecond value of the event (i.e. 0-999); this value is included separately because when the date and time are serialized through some protocols (such as XML-RPC), then microsecond value is lostclass
(int): the event class code of the eventclassstr
(string): the string designation corresponding to the event class code (see the keys of the OMQ::QE_RMAP_CLASS Constant Hash for possible values)event
(int): the event code for the eventeventstr
(string): the string designation corresponding to the event code (see the keys of the OMQ::QE_RMAP_EVENT Constant Hash for possible values)severity
(int): the severity level of the event; please note that all user events will have severity code 0 (OMQ::ES_Info). Values may be integers from -1 to 4 corresponding to the keys in the OMQ::ErrorSeverityMap hash.severitystr
(string): the string corresponding to the severity level; see the keys of the OMQ::ErrorSeverityOrder hash for possible values of this field.caller
(hash): a hash of caller information in case the event was trigger by or can be traced directly to an external callcompositeseverity
(int) the maximum of the system and user severity levels; in case there is no user severity level; then this field is always equal to the system severity level. Values may be integers from -1 to 4 corresponding to the keys in the OMQ::ErrorSeverityMap hash.compositeseveritystr
(string): the string corresponding to the composite severity level; see the keys of the OMQ::ErrorSeverityOrder hash for possible values of this fielduserseverity
(integer, optional): in case the event is a user event and a user severity level was supplied; this field contains the severity level of the user eventuserseveritystr
(string, optional): in case the event is a user event and a user severity level was supplied; this field contains the string corresponding to the user severity level; see the keys of the OMQ::ErrorSeverityOrder hash for possible values of this fieldinfo
(hash, optional): additional event-specific information; See Event Information Descriptions for details on each message; note that user events have user-defined information in this fieldThis section contains the definitions of the info hash of event types
name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)execid:
The workflow execution IDmode:
The mode of the workflow (OMQ::WM_Normal, OMQ::WM_Recovery, OMQ::WM_Synchronous)synchronous:
True
for synchronous workflows, False
if notoptions:
A hash of workflow options name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)execid:
The workflow execution IDmode:
The mode of the workflow (OMQ::WM_Normal, OMQ::WM_Recovery, OMQ::WM_Synchronous))synchronous:
True
for synchronous workflows, False
if not name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database) name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)workflow_instanceid:
The workflow instance ID (i.e. workflow_instance.workflow_instanceid in the database)status:
The new workflow order instance's initial status (see Workflow, Segment, and Step Status Descriptions for possible status values) name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)workflow_instanceid:
The workflow instance ID (i.e. workflow_instance.workflow_instanceid in the database)info:
The info hash for the change name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)workflow_instanceid:
The workflow instance ID (i.e. workflow_instance.workflow_instanceid in the database)info:
A hash with old
and new
keys giving the old and new status values (see Workflow, Segment, and Step Status Descriptions for possible status values) name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)workflow_instanceid:
The workflow instance ID (i.e. workflow_instance.workflow_instanceid in the database)execid:
The workflow execution IDerror:
A hash of error information containing the following keys:err:
the error string (ex: exception name)desc:
the error description (ex: exception description)info:
any additional error information providedbusiness_error:
True
for business errors, False
if notstepid:
the stepid of the error, if anyind:
the ind code of the step (array index), if anyretry:
retry number for errorerrorid:
the error_instanceid in the database name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)workflow_instanceid:
The workflow instance ID (i.e. workflow_instance.workflow_instanceid
in the database)status:
The status of the workflow as it is releasedbusiness_error:
The business error status of the workflow (True
only if the status is OMQ::StatError due to a business error) name:
The name of the workflowversion:
The version of the workflowworkflowid:
The workflow ID (metadata ID, i.e. workflows.workflowid
in the database)workflow_instanceid:
The workflow instance ID (i.e. workflow_instance.workflow_instanceid
in the database)status:
The status of the workflow as it is releasedbusiness_error:
The business error status of the workflow (True
only if the status is OMQ::StatError due to a business error)external_order_instanceid:
The external order instance ID of the workflow, if anykeys:
A hash of workflow order keys, if any type:
The type of service; either USER or SYSTEMname:
The name of the serviceversion:
The version of the serviceserviceid:
The service ID (metadata ID, i.e. services.serviceid
in the database) type:
The type of service; either USER or SYSTEMname:
The name of the serviceversion:
The version of the serviceserviceid:
The service ID (metadata ID, i.e. services.serviceid
in the database) type:
The type of service; either USER or SYSTEMname:
The name of the serviceversion:
The version of the serviceserviceid:
The service ID (metadata ID, i.e. services.serviceid
in the database)err:
The error code for the errordesc:
The error descriptioninfo:
Additional information for the error, if available name:
The name of the jobversion:
The version of the jobjobid:
The job ID (metadata ID, i.e. jobs.jobid
in the database)info:
Additional information about the job; a hash with the following keys:description:
the job's descriptionsingle_instance:
boolean flag, True
if the job can only be run on one instance at a time on the same schemarun_skipped:
boolean flag, True
if the job will be run immediately if its last trigger time was missed due to the system being downlast_executed:
date/time of last executionnext:
next trigger date/timetrigger:
a string describing the job's trigger name:
The name of the jobversion:
The version of the jobjobid:
The job ID (metadata ID, i.e. jobs.jobid
in the database) name:
The name of the jobversion:
The version of the jobjobid:
The job ID (metadata ID, i.e. jobs.jobid
in the database)job_instanceid:
The job instance ID (i.e. job_instance.job_instanceid
in the database) name:
The name of the jobversion:
The version of the jobjobid:
The job ID (metadata ID, i.e. jobs.jobid
in the database)job_instanceid:
The job instance ID (i.e. job_instance.job_instanceid
in the database)status:
the job instance's final status in the database (see Job Data Status Codes for possible values) name:
The name of the jobversion:
The version of the jobjobid:
The job ID (metadata ID, i.e. jobs.jobid
in the database)job_instanceid:
The job instance ID (i.e. job_instance.job_instanceid
in the database)error:
a hash of error information with the following keys:err:
the error codedesc:
the description of the errorinfo:
optional info about the errorbusiness_error:
boolean flag, True
if the error is a business errorerrorid:
the error instance id for the job (i.e. job_errors.job_errorid
in the database) name:
the interface group's nameenabled:
the new status of the group type:
the alert typeid:
the ID of the object causing or related to the alertalert:
the string "name" of the alertreason:
the text giving the reason for the alertname:
the name of the object causing or related to the alertversion:
the version of the object causing or related to the alert type:
the alert typeid:
the ID of the object causing or related to the alertalert:
the string "name" of the alertreason:
the text giving the reason for the alertname:
the name of the object causing or related to the alertversion:
the version of the object causing or related to the alert type:
the alert typeid:
the ID of the object causing or related to the alertalert:
the string "name" of the alertreason:
the text giving the reason for the alertname:
the name of the object causing or related to the alertversion:
the version of the object causing or related to the alertThe following gives a list of the criteria that can be used for filtering events:
"all"
: The argument with this criteria is ignored; automatically matches all events; this criteria is useful with “logical or” filtering and an “and not” list to specify all events except events matching all of the criteria in any of the “and not” criteria hashes."class"
: The class code for the event; the event’s class code must match this class code exactly for the criteria to match"classstr"
: The string designation corresponding to the event class code (see the keys of the OMQ::QE_RMAP_CLASS Constant Hash for possible values); the event’s class string must match this class string exactly for the criteria to match"event"
: The event code for the event; the event’s event code must match this event code exactly for the criteria to match"eventstr"
: The string designation corresponding to the event code (see the keys of the OMQ::QE_RMAP_EVENT Constant Hash for possible values); the event’s event string must match this event string exactly for the criteria to match"mincompositeseverity"
: The minimum composite severity code for the event. Composite severity is the maximum of the event and user severity levels. Values may be integers from -1 to 4 corresponding to the keys in the OMQ::ErrorSeverityMap hash. If the event has an equal or higher composite severity code, then this criteria matches."mincompositeseveritystr"
: The string description corresponding to the minimum composite severity code for the event. Composite severity is the maximum of the event and user severity levels. See the keys of the OMQ::ErrorSeverityOrder hash for possible values of this field. When the strings are converted to severity codes, works like the mincompositeseverity criteria."minseverity"
: The minimum severity code for the event; values may be integers from -1 to 4 corresponding to the keys in the OMQ::ErrorSeverityMap hash. If the event has an equal or higher severity code, then this criteria matches."minseveritystr"
: The string description corresponding to the minimum severity code for the event; see the keys of the OMQ::ErrorSeverityOrder hash for possible values of this field. When the strings are converted to severity codes, works like the minseverity criteria."miuserseverity"
: The minimum user severity for the event; values may be integers from -1 to 4 corresponding to the keys in the OMQ::ErrorSeverityMap hash. If the event has an equal or higher user severity code, then this criteria matches."minuserseveritystr"
: The string description corresponding to the minimum user severity code for the event; see the keys of the OMQ::ErrorSeverityOrder hash for possible values of this field. When the strings are converted to severity codes, works like the minuserseverity criteria."none"
: The argument with this criteria is ignored; automatically matches no events; this criteria is useful with “logical and” filtering” and an “or not” list to specify all events except those not matching the criteria in the “or not” list.