Qorus Integration Engine®  4.0.3.p2_git
OMQ::UserApi::Workflow::QorusSubworkflowStepBase Class Reference

The Qore base interface class for subworkflow steps. More...

Inheritance diagram for OMQ::UserApi::Workflow::QorusSubworkflowStepBase:
OMQ::UserApi::Workflow::QorusStepBase OMQ::UserApi::Workflow::QorusSubworkflowArrayStep OMQ::UserApi::Workflow::QorusSubworkflowStep

Static Public Member Methods

static public hash< auto > bindSubworkflow (hash< auto > wf, hash< auto > order)
 This method binds a workflow to a subworkflow step. More...
 
static public hash< auto > skipSubworkflow ()
 This method will skip the execution of a subworkflow step. More...
 

Detailed Description

The Qore base interface class for subworkflow steps.

Note
Qorus step constructors do not take any arguments; see Class-Based Step Constructors and Static Initialization for information about constructors and static class initialization.
See also
Subworkflow Step

Member Function Documentation

◆ bindSubworkflow()

static public hash<auto> OMQ::UserApi::Workflow::QorusSubworkflowStepBase::bindSubworkflow ( hash< auto >  wf,
hash< auto >  order 
)
static

This method binds a workflow to a subworkflow step.

If this method is called twice or if called after skipSubworkflow(), then an exception is raised

To ensure that a given workflow order is only created once for a given unique key value, make sure your workflow defines order keys, and use one of the following options to guarantee uniqueness of the order:

  • global_unique_key
  • workflow_specific_unique_key
  • workflow_unique_key
Parameters
wfThis hash identifies the workflow type to be bound to the subworkflow step having the following keys:
  • name: (required) the workflow name for the new order
  • version: (optional) the version of the workflow for the new order
    Other keys will be ignored. If the version key is not present, an order for the latest version of the workflow will be created
orderA hash defining the order data to be processed. Valid keys for this hash are:
  • dynamicdata: (optional hash) the initial dynamic data for the order
  • external_order_instanceid: (optional/required string) the external order instance ID for the workflow data; one of staticdata or external_order_instanceid must be provided
  • global_unique_key: (optional hash) a hash giving one or more unique order keys for the order (across all workflows regardless of workflowid, name, or version); if this key already exists for any order in the system, then the order creation will fail with a DUPLICATE-ORDER-KEY error; the hash key must be a valid order key, and the value is the unique key value; this value will also be created as an order key
  • orderkeys: (optional hash; also order-keys is accepted for backwards-compatibility) a hash of order keys for the order
  • priority: the order priority (optional int, default OMQ::DefaultOrderPriority) from 0 - 999; priority 0 is the highest; 999 is the lowest
  • scheduled: (optional date) the earliest date and time the order can be processed; if this date is given as a future date/time value and a OMQ::StatReady status is given, then the initial status of the workflow order data instance will be automatically changed to OMQ::StatScheduled instead of OMQ::StatReady
  • sensitive_data: (optional hash) a hash of sensitive data information for the workflow; this key can only be used when submitting the data over a secure (encrypted) connection; the keys are sensitive data key types, values are hashes keyed by sensitive data values, and the hash values have the following keys:
    • aliases: (optional list of strings) zero or more string aliases for the sensitive data
    • data: (required hash) the sensitive data hash itself
    • meta: (optional hash) a hash of metadata for the sensitive data with the following recommended keys (recommended keys are not enforced by the API itself):
      • PURPOSE: free-form information about the purpose of the sensitive data
      • CATEGORIES: free-form information about the categories of sensitive data
      • RECIPIENTS: free-form information about the recipients or recipient catories of sensitive data
      • STORAGE: free-form information about the storage time or rules for sensitive data
  • staticdata: (optional/required hash) the initial static data for the order; one of staticdata or external_order_instanceid must be provided
  • tempdata: (optional hash) the initial temporary data for the order
  • workflow_specific_unique_key: (optional string) a hash giving one or more unique order keys for the particular workflowid (which matches a unique name and workflow version); if this key already exists for an order with the target workflowid, then the order creation will fail with a DUPLICATE-ORDER-KEY error; the hash key must be a valid order key, and the value is the unique key value; this value will also be created as an order key
  • workflow_unique_key: (optional string) a hash giving one or more unique order keys for the particular workflow by name only (across all workflows with the same name regardless of version); if this key already exists for a workflow order with the same name, then the order creation will fail with a DUPLICATE-ORDER-KEY error; the hash key must be a valid order key, and the value is the unique key value; this value will also be created as an order key
Returns
a hash with a single key: workflow_instanceid, the value of which is the workflow order data instance ID of the subworkflow
Exceptions
SUBWORKFLOW-ERRORinvalid call (multiple call, etc), invalid arguments (unknown workflow, etc)
WORKFLOW-KEY-ERRORinvalid workflow key given
ORDER-DATA-ERRORmissing either external_order_instanceid or staticdata, unknown workflow; invalid keys or sensitive data format
DUPLICATE-ORDER-KEYthe given unique key already exists in the defined scope, also sets arg with a workflow_instance_ids key with a list of all conflicting workflow instance IDs
Note
Subworkflow steps must call either this method or skipSubworkflow() or an error will be raised.
Since
  • Qorus 3.1.1 implemented support for the following keys in the order argument:
    • global_unique_key
    • sensitive_data
    • workflow_specific_unique_key
    • workflow_unique_key
See also

◆ skipSubworkflow()

static public hash<auto> OMQ::UserApi::Workflow::QorusSubworkflowStepBase::skipSubworkflow ( )
static

This method will skip the execution of a subworkflow step.

Calling after bindSubworkflow() has already been called, and a subworkflow order instance has been bound to the step, will result in an exception.

Calling this method twice for the same step will simply cause a message to be logged that the method was called twice.

Returns
a hash with the following keys:
  • workflow_instanceid: the current workflow_instanceid
  • skipped: constant boolean True
Exceptions
SUBWORKFLOW-ERRORinvalid call (not subworkflow step, subworkflow already bound, etc)
Note
Subworkflow steps must call either this method or bindSubworkflow() or an error will be raised.
See also

The documentation for this class was generated from the following file: