Qorus Integration Engine® Enterprise Edition 6.0.15_prod
Loading...
Searching...
No Matches
OMQ::UserApi::Workflow::WorkflowApi Class Reference

primary workflow API class More...

Inheritance diagram for OMQ::UserApi::Workflow::WorkflowApi:
[legend]
Collaboration diagram for OMQ::UserApi::Workflow::WorkflowApi:
[legend]

Static Public Member Methods

static string generateUniqueKey ()
 returns a unique async key for the order for use with QorusAsyncStepBase::submitAsyncKey() More...
 
static stepError (string err, auto info)
 Raises an error against the current step without affecting the flow of processing. More...
 
static stepError (string err, auto info, date retry_delay)
 Raises an error against the current step without affecting the flow of processing. More...
 
static stepError (string err, auto info, int retry_delay)
 Raises an error against the current step without affecting the flow of processing. More...
 
static stepWarning (string err, auto info)
 Raises a warning against the step. More...
 
static stepWarning (string err, string fmt)
 Raises a warning against the step. More...
 
static setRetryDelay (date delay)
 Sets the value of the retry delay for a step error or an asynchronous step. More...
 
static setRetryDelay (int secs)
 Sets the value of the retry delay for a step error or an asynchronous step. More...
 
static *hash< auto > getErrorInfo (string err)
 Returns the hash data associated with the error code passed as an argument. More...
 
static updateDynamicData (hash< auto > hash)
 Updates the values of one or more keys in the workflow order data instance’s dynamic data hash. More...
 
static deleteDynamicDataKey (softlist< auto > list)
 Deletes one or more keys from the workflow order data instance’s dynamic data hash. More...
 
static auto getDynamicData ()
 Retrieves the values of one or more keys from the workflow order data instance’s dynamic data hash. More...
 
static auto getDynamicDataArgs (*softlist< auto > keylist)
 Retrieves the values of one or more keys from the workflow order data instance’s dynamic data hash. More...
 
static auto getStaticData ()
 Retrieves the values of one or more keys from the workflow order data instance’s static data hash. More...
 
static auto getStaticDataArgs (*softlist< auto > keylist)
 Retrieves the values of one or more keys from the workflow order data instance’s static data hash. More...
 
static updateTempData (hash< auto > hash)
 Updates the values of one or more keys in the workflow order data instance’s temporary data hash. More...
 
static auto getTempData ()
 Retrieves the values of one or more keys from the workflow order data instance’s temporary data hash. More...
 
static auto getTempDataArgs (*softlist< auto > keylist)
 Retrieves the values of one or more keys from the workflow order data instance’s temporary data hash. More...
 
static deleteTempDataKey (softlist< auto > list)
 Deletes one or more keys from the workflow order data instance’s temporary data hash. More...
 
static updateSensitiveData (string skey, string svalue, hash< auto > hash, *softlist aliases, *hash< auto > meta)
 Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data key and value. More...
 
static updateSensitiveDataFromAlias (string alias, hash< auto > hash, *hash< auto > meta)
 Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data alias. More...
 
static auto getSensitiveMetadata (string skey, string svalue)
 Returns the sensitive metadata hash for the given sensitive data key and value if present, otherwise returns an empty hash. More...
 
static hash getSensitiveMetadataFromAlias (string alias)
 returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of the sensitive metadata hash for the given sensitive data alias corresponding to a sensitive data key and value More...
 
static auto getSensitiveData (string skey, string svalue)
 Returns the sensitive data for the given sensitive data key and value. More...
 
static auto getSensitiveDataArgs (string skey, string svalue, *list< auto > keylist)
 Returns the sensitive data for the given sensitive data key and value. More...
 
static hash< auto > getSensitiveDataFromAlias (string alias)
 returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of one or more keys in the workflow sensitive data hash for the given sensitive data alias corresponding to a sensitive data key and value More...
 
static hash< auto > getSensitiveDataFromAliasArgs (string alias, *list< auto > keylist)
 returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of one or more keys in the workflow sensitive data hash for the given sensitive data alias corresponding to a sensitive data key and value More...
 
static hash< auto > getSensitiveDataAliases ()
 returns a hash of all sensitive data aliases for the current order or an empty hash if there are none More...
 
static bool deleteSensitiveData (string skey, string svalue)
 Deletes the sensitive data hash for the given sensitive data key and value; changes have already been committed to the database when this method returns. More...
 
static bool deleteSensitiveDataKey (string skey, string svalue, softlist< auto > list)
 Deletes one or more keys from the workflow order data instance’s sensitive data hash for the given sensitive data key and value; changes have already been committed to the database when this method returns. More...
 
static hash getSensitiveDataKeyValues ()
 Returns a hash of sensitive data keys and values saved against the order; the sensitive data hashes themselves are not returned, just the information used to index sensitive data against the order. More...
 
static updateInstanceData (hash< auto > hash)
 Updates the values of one or more keys in the workflow execution instance’s instance data hash. More...
 
static deleteInstanceDataKey (softlist< auto > list)
 Deletes a single key or a list of keys from the workflow execution instance’s instance data hash. More...
 
static auto getInstanceData ()
 Retrieves the values of one or more keys from the workflow execution instance’s instance data hash. More...
 
static auto getInstanceDataArgs (*list< auto > keylist)
 Retrieves the values of one or more keys from the workflow execution instance’s instance data hash. More...
 
static auto getWorkflowInstanceData (string field)
 Retrieves the value of a single key (system-defined property) from the workflow execution instance object itself. More...
 
static hash< auto > getWorkflowInstanceData ()
 Retrieves the values of multiple keys (system-defined properties) from the workflow execution instance object itself. More...
 
static hash< auto > getWorkflowInstanceDataArgs (*list< auto > keylist)
 Retrieves the values of one or more keys (system-defined properties) from the workflow execution instance object itself as a hash. More...
 
static setOrderKeys (hash< auto > h, bool truncate=False)
 This method sets user-defined order keys against an order, so that the workflow order data instance can be quickly searched and retrieved using the key value. More...
 
static setOrderKey (string key, softlist< softstring > value, bool truncate=False)
 This method sets the values for a sinle user-defined order key against an order, so that the workflow order data instance can be quickly searched and retrieved using the key value. More...
 
static appendOrderKeys (hash< auto > h, bool truncate=False)
 This method appends user-defined order key values to a workflow order key, so that the workflow order data instance can be quickly searched and retrieved using the key value. More...
 
static appendOrderKeys (string key, softlist< softstring > value, bool truncate=False)
 This method appends user-defined order key values to a workflow order key, so that the workflow order data instance can be quickly searched and retrieved using the key value. More...
 
static auto getOrderKeys ()
 This method retrieves the user-defined order key information saved against the workflow order data instance. More...
 
static auto getOrderKeysArgs (*softlist< auto > keylist)
 This method retrieves the user-defined order key information saved against the workflow order data instance. More...
 
static bool stepExecuted (string stepname)
 This method returns True if the step passed has been executed and has status OMQ::StatComplete ("C") More...
 
static *string getStepStatus (string stepname)
 Returns the current status of the given step for the current workflow order instance. More...
 
static *hash< auto > getStepInfo ()
 This method will return a hash of step information for the current step. More...
 
static hash< auto > getWorkflowMetadata ()
 returns workflow metadata for the currently running workflow as a hash More...
 
static setBlocked ()
 set the current workflow order status to OMQ::StatBlocked, can only be called from the attach function More...
 
static list getOrderNotes (*int count)
 Get Order Instance Notes. More...
 
static addOrderNote (string notestr)
 Add new note as described in Order Instance Notes. More...
 
static setCustomStatus (string stat)
 Sets a user-defined custom status for the current step. More...
 
static rescheduleOrder (date scheduled)
 reschedules the current workflow order instance for later processing More...
 
static reprioritizeOrder (int prio)
 changes the order priority for the current workflow order instance More...
 
static leaveParentFeedback (string key, auto value)
 leaves feedback for a parent workflow More...
 
static auto getChildFeedback (string key)
 gets feedback from a child workflow order with the given key More...
 
static *hash< auto > getChildFeedback ()
 gets all feedback from all child workflow orders as a hash More...
 
static setOption (hash< auto > hash)
 Changes option values on a workflow. More...
 
static setOption (string option, auto value)
 Changes a single option value on a workflow. More...
 
static auto getOption ()
 Returns the value of the named workflow option(s) More...
 
static auto getOptionArgs (*softlist< string > args)
 Returns the value of the named workflow option or options. More...
 
static *softint parentWfiid ()
 Returns the parent workflow order data instance ID from a subworkflow or NOTHING if the current workflow order is not a subworkflow and therefore has no parent. More...
 
static *softint getWfiid ()
 returns the current workflow_instanceid as an integer; returns NOTHING if not called in a workflow order context (ex: onetimeinit function, etc) More...
 
static int sleep (softint arg)
 puts the current thread to sleep for a certain number of seconds More...
 
static int usleep (softint arg)
 puts the current thread to sleep for a certain number of microseconds More...
 
static int usleep (date arg)
 puts the current thread to sleep for a certain number of microseconds More...
 
static auto getConfigItemValue (string item, *hash< auto > local_context, bool expand_complex_values=True)
 returns the value of the given step configuration item More...
 
static hash< auto > getConfigItemHash (*hash< auto > local_context)
 returns a hash of all configuration items for the current step More...
 
- Static Public Member Methods inherited from OMQ::UserApi::UserApi
static *hash< auto > getUserServiceInfo (string name)
 returns information about the given user service (if it's currently loaded) More...
 
static SqlUtil::AbstractTable getSqlTable (string datasource, string table_name, bool register_dependency=True)
 get a cached table object (suitable for DML) if present, otherwise it creates one from scratch More...
 
static SqlUtil::AbstractTable getSqlTable (AbstractDatasource datasource, string table_name, bool register_dependency=True)
 get a cached table object (suitable for DML) if present, otherwise it creates one from scratch More...
 
static hash< auto > getSqlCacheInfo ()
 get information about cached object More...
 
static clearSqlTableCache (string datasource, *string table_name)
 clears all objects for given datasource from the cache (for example, if database objects have been updated in the dataserver) More...
 
static clearSqlTableCache (AbstractDatasource datasource, *string table_name)
 clears cached objects for given datasource (for example, if database objects have been updated in the dataserver) More...
 
static auto getValueMap (string mapname, string key)
 Gets a lookup value from the value map by a key; the value map must be registered to the current interface. More...
 
static list< auto > getValueMaps ()
 Gets all value maps valid for the current interface. More...
 
static bool postSlaEventSuccess (string sla, number value)
 posts a successful SLA event for SLA monitoring and performance tracking More...
 
static bool postSlaEventError (string sla, number value, string err, string desc)
 posts an unsuccessful SLA event for SLA monitoring and performance tracking More...
 
static flushSlaEvents ()
 flushes all pending SLA events to disk and returns after the data has been committed More...
 
static *hash< auto > getSystemServiceInfo (string name)
 returns information about the given system service (if it's currently loaded) More...
 
static *hash< auto > getServiceInfo (string type, string name)
 returns information about the given service (if it's currently loaded) More...
 
static list getRunningWorkflowList (*string name, *string ver)
 returns a list of hashes giving information about the currently-running workflow execution instances More...
 
static hash getRunningWorkflowInfo (softint id)
 returns a hash of the workflow execution instance info if the ID is valid or an empty hash if not More...
 
static softint createOrder (string name, *string version, hash< auto > params, string status=StatReady)
 creates a workflow order data instance in the database More...
 
static softint createRemoteOrder (string remote, string name, *string version, hash< auto > params, string status=StatReady, bool register_dependency=True)
 creates a workflow order data instance in a remote Qorus instance More...
 
static hash< auto > execSynchronousWorkflow (string name, *string version, hash< auto > sdata, *hash< auto > opts, *hash< auto > ddata, softint priority=DefaultOrderPriority, *hash< auto > orderkeys, *softstring external_order_instanceid, *softint parent_workflow_instanceid)
 executes a workflow order synchronously and returns the final status and order ID in a hash More...
 
static int postUserEvent (string severity, auto info)
 posts an application event of class OMQ::QE_CLASS_USER More...
 
static hash runtimeProperties ()
 returns Qorus runtime properties as a hash More...
 
static auto callNetworkApiArgsWithAuthentication (string user, string pass, string call, softlist< auto > args)
 calls a system RPC API with authentication information (username and password) More...
 
static auto callNetworkApiArgs (string call, *softlist< auto > args)
 calls a system RPC API with the argument list to the API method as a top-level argument to this method; the API is called with system permissions (no restrictions) More...
 
static auto callNetworkApi (string call)
 calls a system RPC API and returns the result; the API is called with system permissions (no restrictions) More...
 
static auto callRestApi (string method, string path, *hash< auto > body_args)
 calls a system REST API method and returns the result; the API is called with system permissions (no restrictions) More...
 
static auto callRestApiWithAuthentication (string user, string pass, string method, string path, *hash< auto > body_args)
 calls a system REST API method with authentication information (username and password) and returns the result More...
 
static hash< auto > getSystemInfo ()
 returns a hash of system info More...
 
static int getSessionId ()
 returns the current Qorus application session ID More...
 
static startCapturingObjectsFromJava ()
 Starts capturing Qore objects created from Java APIs in the current interface's object cache. More...
 
static stopCapturingObjectsFromJava ()
 Stops capturing Qore objects created from Java APIs in the current interface's object cache. More...
 
static startCapturingObjectsFromPython ()
 Starts capturing Qore objects created from Python APIs in the current interface's object cache. More...
 
static stopCapturingObjectsFromPython ()
 Stops capturing Qore objects created from Python APIs in the current interface's object cache. More...
 
static saveObjectInObjectCache (object obj)
 Saves the object in the object cache. More...
 
static bool clearObjectFromObjectCache (object obj)
 Removes the object from the object cache. More...
 
static *date checkObjectCache (object obj)
 Returns the date/time the object was cached or NOTHING if the object is not in the cache. More...
 
static int getObjectCacheSize ()
 Returns the number of objects in the cache. More...
 
static int clearObjectCache ()
 Clears the entire the object cache. More...
 
static int clearObjectCache (date cutoff)
 Clears the entire the object cache for all objects cached before the given date/time. More...
 
static list< hash< CallStackInfo > > getThreadCallStack ()
 Allows the current thread's call stack to be retrieved in Qorus. More...
 
static logFatal (softstring msg)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logError (softstring msg)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logWarn (softstring msg)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logInfo (softstring msg)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logDebug (softstring msg)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logTrace (softstring msg)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logArgsFatal (softstring msg, *softlist< auto > args)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logWithLevel (int level, string msg)
 Writes to the current interface log file with the given log level. More...
 
static logWithLevelArgs (int level, string msg, *softlist< auto > args)
 Writes to the current interface log file with the given log level. More...
 
static logArgsError (softstring msg, *softlist< auto > args)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logArgsWarn (softstring msg, *softlist< auto > args)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logArgsInfo (softstring msg, *softlist< auto > args)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logArgsDebug (softstring msg, *softlist< auto > args)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static logArgsTrace (softstring msg, *softlist< auto > args)
 Writes the information passed to the workflow, service, job, or system log file depending on the calling context if the interface logger level is equal or lower. More...
 
static *int auditUserEvent (string user_event, *string info1, *string info2)
 creates a user audit event (with audit code AE_USER_EVENT) against the workflow, service, or job instance More...
 
static bool auditCheckEventString (string opt)
 checks if the given audit event (given as a string) is enabled More...
 
static bool auditCheckEvent (softint opt)
 checks if the given audit event (given as an integer code) is enabled More...
 
static int auditGetMask ()
 returns the audit event mask More...
 
static bool isKubernetes ()
 returns True when Qorus is running under Kubernetes More...
 
static int usleep (date arg)
 puts the current thread to sleep for a certain number of microseconds More...
 
static int sleep (softint arg)
 puts the current thread to sleep for a certain number of seconds More...
 
static int usleep (softint arg)
 puts the current thread to sleep for a certain number of microseconds More...
 
static hash< auto > getQorusOptions ()
 returns the value of the given system option or options More...
 
static hash< auto > getQorusOptionInfo ()
 returns a hash giving information about system options More...
 
static hash< auto > getQorusOptionInfoArgs (*list< auto > args)
 returns a hash giving information about system options More...
 
static auto getQorusOptionsArgs (softlist< auto > args)
 returns the value of the given system option or options More...
 
static hash< auto > getActiveJobs ()
 Returns information on all active jobs visible to the calling user. More...
 
static object getUserConnection (string name, bool connect=True, bool register_dependency=True, *hash< auto > rtopts)
 Returns an object corresponding to a defined user connection. More...
 
static hash< auto > getUserConnectionTags (string name)
 Returns any tags set on the given user connection. More...
 
static Qore::SQL::Datasource getDatasourceDedicated (string name, bool register_dependency=True)
 returns a new, dedicated Datasource object, suitable for transaction management for long-running transactions More...
 
static AbstractDatasource getDatasourcePool (string name, bool register_dependency=True)
 returns a DatasourcePool object for the given datasource name More...
 
static hash< auto > getDatasourceInfo (string name)
 returns a hash of information for the given datasource, if known, otherwise throws an exception More...
 
static QorusSystemAPIHelper getRemoteRpcConnection (string name, bool connect=True, bool register_dependency=True)
 Returns a new QorusSystemAPIHelper object corresponding to a defined Qorus remote connection. More...
 
static QorusSystemRestHelper getRemoteRestConnection (string name, bool connect=True, bool register_dependency=True)
 Returns a new QorusSystemRestHelper object corresponding to a defined Qorus remote connection. More...
 
static raiseTransientAlert (string alert, string reason, *hash< auto > info)
 raises a transient system alert from a workflow, service, or job More...
 
static string qorusGetLocalUrl (*string username, *string password)
 returns a string giving the local system URL More...
 
static setOption (hash< auto > hash)
 Changes option values on a workflow, service, or job. More...
 
static auto getOption ()
 Returns the value of the named workflow, service, or job option or options. More...
 
static auto getOptionArgs (*softlist< string > args)
 Returns the value of the named workflow, service, or job option or options. More...
 
static hash< auto > blockOrder (softint wfiid)
 block the given workflow order data instance More...
 
static hash< auto > unblockOrder (softint wfiid, *hash< auto > tempdata, *hash< auto > orderkeys)
 unblocks the given workflow order data instance More...
 
static hash< auto > cancelOrder (softint wfiid)
 cancel the given workflow order data instance More...
 
static hash< auto > uncancelOrder (softint wfiid, *hash< auto > tempdata)
 uncancels the given workflow order data instance More...
 
static updateDynamicOrderData (softint wfiid, hash< auto > new_data)
 updates the given workflow order instance's dynamic data hash atomically More...
 
static updateDynamicOrderDataPath (softint wfiid, string path, auto value)
 updates the given workflow order instance's dynamic data hash atomically More...
 
static *hash< auto > getUserContextInfo ()
 returns a hash for the current user context More...
 
static *string getContextUserName ()
 returns the current username for any external user-initiated call or NOTHING if executing in a system context More...
 
static auto getConfigItemValue (string cfg_item, *hash< auto > local_context, bool expand_complex_values=True)
 returns config item value in the current user context More...
 
static auto getInterfaceConfigItemValue (string cfg_item, *hash< auto > local_context, bool expand_complex_values=True)
 returns config item value in the current interface context More...
 
static hash< auto > getConfigItemHash (*hash< auto > local_context)
 returns a hash of all configuration items for the current interface More...
 
static hash< auto > getInterfaceConfigItemHash (*hash< auto > local_context)
 Returns a hash of all configuration items for the current context as a combination of local and global configuration items. More...
 
static auto getGlobalConfigItemValue (string item, *hash< auto > local_context, bool expand_complex_values=True)
 returns the value of the given configuration item on global level; throws an exception if there is no value on global level for the configuration item More...
 
static auto getGlobalConfigItemValueWithDefault (string item, auto default_value, *hash< auto > local_context, bool expand_complex_values=True)
 returns the value of the given configuration item on global level; throws an exception if there is no value on global level for the configuration item More...
 
static AbstractDataProvider getDataProvider (hash< auto > h, *hash< auto > ctx)
 Returns a data provider corresponding to the hash description. More...
 
static AbstractDataProvider getDataProvider (string path)
 returns the data provider given by a path string More...
 
static AbstractDataProvider getDataProvider (string type, string name, *string path, *hash< auto > opts, *hash< auto > ctxt, *bool handle_template_args)
 returns the data provider given by a path string More...
 
static AbstractDataProviderType getQorusType (string type_path)
 Returns a data provider type from a direct type path. More...
 
static AbstractDataProviderType getTypeFromPath (string path)
 returns a data provider type identified by a path string More...
 
static Mapper::Mapper getMapper (string name, *hash< auto > rtopts)
 returns the given mapper if registered for the current interface More...
 
static Qore::AbstractIterator getMapperIterator (string name, Qore::AbstractIterator input, *hash< auto > rtopts)
 returns an iterator for the named mapper using the iterator argument for input More...
 
static bool postSyncEvent (string eventtype, string eventkey)
 posts a workflow synchronization event given the event type name and the unique event key More...
 
static hash< auto > propGet ()
 returns a hash of all system properties in all domains More...
 
static *hash< auto > propGet (string domain)
 returns a hash of all key-value pairs in the given domain or NOTHING if the system property domain does not exist More...
 
static auto propGet (string domain, string key)
 returns the value of the given system property key in the given domain or NOTHING if the system property does not exist More...
 
static string propUpdate (string domain, softstring key, auto value)
 changes (inserts, updates, or deletes) the value of a single system property More...
 
static hash< auto > propUpdate (hash< auto > h)
 changes (inserts, updates, or deletes) the value of one or more system properties according to a hash argument More...
 
static softint getNextSequenceValue (AbstractDatasource ds, string name)
 returns the next sequence value for the given datasource and sequence More...
 
static softint getNextSequenceValue (string ds, string name)
 returns the next sequence value for the given datasource and sequence More...
 
static string serializeQorusData (auto d)
 returns a string giving the default serialization of the given data structure for storage in Qorus More...
 
static string serializeQorusDataWithNothing (auto d)
 returns a string giving the default serialization of the given data structure for storage in Qorus More...
 
static auto deserializeQorusData (string data)
 parses serialized data in either XML-RPC or YAML format and returns the corresponding qore data More...
 
static auto deserializeQorusData (null data)
 deserializing a NULL value from the DB returns no value
 
static *string restartTransaction (string driver, hash< auto > ex)
 returns a string error message if any exception in the chain passed was caused by a recoverable DB error, otherwise returns NOTHING More...
 
static bool isInternalSystemDebuggingEnabled ()
 returns True if internal system debugging is enabled More...
 
static auto getHashDotValue (*hash< auto > var_data, string var_name, *reference< bool > missing_input)
 returns the value of the given key from the given hash, respects dot notation in the key name More...
 
static auto expandOneVariable (string str, string var_context, auto template_arg, *hash< auto > local_context, *bool brackets, bool expand_complex_values=True, *reference< bool > missing_input)
 expands one variable in a templated string More...
 
static bool isSingleTemplatedString (auto value)
 checks if the given value is a templated string with only one expandable variable More...
 
static auto expandTemplatedValue (auto value, *hash< auto > local_context, bool expand_complex_values=True, *reference< bool > missing_input, *string template_context)
 expands all variables in a templated string More...
 
static softlist< auto > expandComplexValue (list< auto > val, *hash< auto > local_context, *string template_context)
 expands all variables in a list with templated values More...
 
static hash< auto > expandComplexValue (hash< auto > val, *hash< auto > local_context, *string template_context)
 expands all variables in a hash with templated values More...
 
static hash< BbVariable > bbParseExactlyOneVariable (string str)
 parses one template variable and returns a hash with its parts More...
 
static auto getInputData (string field_name, *hash< auto > local_context, *hash< auto > input_data_cfg)
 returns specified input data field's value More...
 
static hash< auto > getInputData (*hash< auto > input_data_cfg, *hash< auto > local_context)
 returns all input data More...
 
static *hash< auto > updateHashDotValue (*hash< auto > var_data, string var_name, auto value)
 updates the given hash with a key in dot notation with the given value More...
 
static updateOutputData (string field_name, auto output_data, *hash< auto > output_data_cfg)
 updates specified output data field's value More...
 
static updateOutputData (hash< auto > all_output_data, hash< auto > output_data_cfg=UserApi::getConfigItemValue(BB_OUTPUT_DATA_CFG_KEY, NOTHING, False))
 updates all output data More...
 
static writeOutputData (*hash< auto > output_data)
 Writes output data using a concise format. More...
 
static string getTextFileFromLocation (string location)
 returns string data for the given file location More...
 
static binary getBinaryFileFromLocation (string location)
 returns binary data for the given file location More...
 
static Qore::StreamReader getStreamReaderFromLocation (string location)
 Returns a string stream for the file's data at the given location. More...
 
static Qore::InputStream getBinaryStreamFromLocation (string location)
 Returns an input stream for file data at the given location. More...
 
static writeFileToLocation (string location, data contents)
 Writes data to a file at the given location. More...
 
static FileLocationHandler::OutputStreamWrapper getOutputStreamForLocation (string location)
 Returns an output stream for writing data to the given location. More...
 
static auto executeFsm (string fsm_name, auto arg)
 Executes the given Finite State Machine and returns the final output. More...
 
static registerFsmAsObserver (string fsm_name, DataProvider::Observable observable, string event_id)
 Registers the given Finite State Machine with the given object as an Observer. More...
 
static string generateTokenForUser (string username, timeout expiry=DefaultTokenExpirationPeriod)
 Generates an access token for the given user with the given expiration time. More...
 
static string generateTokenForUser (string username, int expiry_seconds)
 Generates an access token for the given user with the given expiration time. More...
 
static bool invalidateToken (string token)
 Invalidates the given token. More...
 
static refreshToken (string token, *int expiry_seconds)
 Refreshes the given token. More...
 
static refreshToken (string token, timeout expiry_seconds)
 Refreshes the given token. More...
 
static *hash< TokenInfogetTokenInfo (string token, *bool refresh_token)
 Returns information for the given token. More...
 
static *hash< QorusUserInfogetCurrentUserInfo ()
 Returns information for the current user. More...
 
static hash< QorusUserInfogetUserInfo (string username)
 Returns information for the given user. More...
 
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 skips binding a workflow to a subworkflow step. More...
 
static public submitAsyncKey (string key)
 Binds the given key to the asynchronous step. More...
 
static public skipAsyncStep ()
 This method will skip the execution of an asynchronous step. More...
 
static public bindEvent (string eventkey)
 binds a workflow synchronization event based on the event key to a workflow synchronization event step (type OMQ::ExecEvent) More...
 
static public bindEventUnposted (string eventkey)
 binds a workflow synchronization event based on the event key to a workflow synchronization event step (type OMQ::ExecEvent) only if the event has not yet been posted; if the event has already been posted, then an ALREADY-POSTED exception is raised More...
 
static public skipEvent ()
 skips a workflow synchronization event step More...
 
static leaveParentFeedback (string key, auto value)
 leaves feedback for a parent workflow More...
 
static auto getChildFeedback (string key)
 gets feedback from a child workflow order with the given key More...
 
static bool isWorkflowContext ()
 Returns True if the code is executing in an immediate workflow context, False if not. More...
 
static bool isServiceContext ()
 Returns True if the code is executing in an immediate service context, False if not. More...
 
static bool isJobContext ()
 Returns True if the code is executing in an immediate job context, False if not. More...
 

Additional Inherited Members

- Static Private Member Methods inherited from OMQ::UserApi::UserApi
static QorusProgram DynamicLogic (False, CommonParseOptions|PO_NO_INHERIT_USER_CLASSES|PO_NO_INHERIT_USER_FUNC_VARIANTS|PO_NO_INHERIT_GLOBAL_VARS|PO_NO_INHERIT_USER_CONSTANTS|PO_NO_INHERIT_USER_HASHDECLS|PO_NEW_STYLE|PO_STRICT_ARGS|PO_REQUIRE_TYPES, QorusServerDefines)
 Program for dynamic logic.
 
- Private Attributes inherited from OMQ::UserApi::UserApi
const DataProviderRootValues
 data provider root path values
 
const DataTypeRootValues
 data type root path values
 
const DataProviderPathTypeValues
 data type path provider type values
 

Detailed Description

primary workflow API class

Note
In Python available as wfapi

Member Function Documentation

◆ addOrderNote()

static OMQ::UserApi::Workflow::WorkflowApi::addOrderNote ( string  notestr)
static

Add new note as described in Order Instance Notes.

Parameters
notestra string with note
See also

◆ appendOrderKeys() [1/2]

static OMQ::UserApi::Workflow::WorkflowApi::appendOrderKeys ( hash< auto >  h,
bool  truncate = False 
)
static

This method appends user-defined order key values to a workflow order key, so that the workflow order data instance can be quickly searched and retrieved using the key value.

The hash provided appends orders keys to the workflow order; existing order keys matching keys given in the hash provided as an argument to this method are updated and any new keys are added.

The data is committed to the database before the method returns.

Parameters
hkey-value pairs to append to workflow order keys; the keys in this hash must match those defined for the workflow
truncateallow key values to be truncated without an error
Exceptions
APPEND-ORDER-KEYS-ERRORempty hash passed to appendOrderKeys()
INVALID-WORKFLOW-KEYinvalid key for workflow
SET-ORDER-KEYS-ERRORan invalid data type (not convertible to a string) was given as a key value
Note
the use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ appendOrderKeys() [2/2]

static OMQ::UserApi::Workflow::WorkflowApi::appendOrderKeys ( string  key,
softlist< softstring >  value,
bool  truncate = False 
)
static

This method appends user-defined order key values to a workflow order key, so that the workflow order data instance can be quickly searched and retrieved using the key value.

This method appends order keys to the workflow order; existing order keys matching keys given in the arguments provided are updated and any new keys are added.

The data is committed to the database before the method returns.

Parameters
keythe workflow order key to append to; this key must match a defined workflow order key
valueone or more values to append for the given key
truncateallow key values to be truncated without an error
Exceptions
APPEND-ORDER-KEYS-ERRORempty hash passed to appendOrderKeys()
INVALID-WORKFLOW-KEYinvalid key for workflow
DUPLICATE-KEY-VALUEan order key was assigned a value more than once
Note
the use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ deleteDynamicDataKey()

static OMQ::UserApi::Workflow::WorkflowApi::deleteDynamicDataKey ( softlist< auto >  list)
static

Deletes one or more keys from the workflow order data instance’s dynamic data hash.

Dynamic data is directly linked to the order data the workflow execution instance is processing.

Changes are committed to the database before the method returns.

See also
Workflow Order Dynamic Data
Parameters
lista single key or a list of keys to delete in the workflow order's dynamic data
Note
The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ deleteInstanceDataKey()

static OMQ::UserApi::Workflow::WorkflowApi::deleteInstanceDataKey ( softlist< auto >  list)
static

Deletes a single key or a list of keys from the workflow execution instance’s instance data hash.

Parameters
lista single key or a list of strings (keys) to delete in workflow execution instance data
See also

◆ deleteSensitiveData()

static bool OMQ::UserApi::Workflow::WorkflowApi::deleteSensitiveData ( string  skey,
string  svalue 
)
static

Deletes the sensitive data hash for the given sensitive data key and value; changes have already been committed to the database when this method returns.

Example:
WorkflowApi::deleteSensitiveData("personal_id", personal_id);
Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
Returns
True if the data existed and was deleted, False if no such sensitive data key and value were present in the order
Note
the use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ deleteSensitiveDataKey()

static bool OMQ::UserApi::Workflow::WorkflowApi::deleteSensitiveDataKey ( string  skey,
string  svalue,
softlist< auto >  list 
)
static

Deletes one or more keys from the workflow order data instance’s sensitive data hash for the given sensitive data key and value; changes have already been committed to the database when this method returns.

Example:
# delete the "tax_number" and "insurance_number" keys from the sensitive data hash for the given person
WorkflowApi::deleteSensitiveDataKey("personal_id", personal_id, ("tax_number", "insurance_number"));

Changes are committed to the database before the method returns.

Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
lista single key or a list of keys to delete in the workflow order's sensitive data hash for the given sensitive key-value pair
Returns
True if the data existed and was deleted, False if no data was deleted
Note
the use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ deleteTempDataKey()

static OMQ::UserApi::Workflow::WorkflowApi::deleteTempDataKey ( softlist< auto >  list)
static

Deletes one or more keys from the workflow order data instance’s temporary data hash.

Parameters
lista single key or a a list of strings (keys) to delete in workflow temporary data
See also
Workflow Temporary Data

◆ generateUniqueKey()

static string OMQ::UserApi::Workflow::WorkflowApi::generateUniqueKey ( )
static

returns a unique async key for the order for use with QorusAsyncStepBase::submitAsyncKey()

the generated key uses the workflow_instanceid, stepid, and ind number for the step to generate a unique key. Another alterative would be to call UUID::get()

◆ getChildFeedback() [1/2]

static *hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getChildFeedback ( )
static

gets all feedback from all child workflow orders as a hash

child workflows have to set feedback values with leaveParentFeedback() for any value to be returned with this method call

Returns
a hash representing all feedback values saved by child workflow orders with leaveParentFeedback()
See also

◆ getChildFeedback() [2/2]

static auto OMQ::UserApi::Workflow::WorkflowApi::getChildFeedback ( string  key)
static

gets feedback from a child workflow order with the given key

the child workflow has to set a value with the given key first with leaveParentFeedback() for any value to be returned with this method call

Parameters
keythe feedback key name used by the child workflow
Returns
the value of the feedback saved by the child workflow order with leaveParentFeedback() under the given key
See also

◆ getConfigItemHash()

static hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getConfigItemHash ( *hash< auto >  local_context)
static

returns a hash of all configuration items for the current step

Example:
hash<auto> config = WorkflowApi::getConfigItemHash();
Parameters
local_contextthe caller can supply its "local" context for template variables (plus user context info is added - see UserApi::getUserContextInfo() method)
Returns
a hash of all configuration items for the current step; keys are config item names; values are config item values. If there are no config items for the current step, then an empty hash is returned.
Note
if there are local configuration item values and values on workflow or global level, the local values will take precedence over the workflow values and the workflow values will take precedence over the global values.
values are always substituted with UserApi::expandTemplatedValue(); make sure and escape any "$" characters with a backslash ("\") to avoid template substitution
See also
Step Configuration Items

◆ getConfigItemValue()

static auto OMQ::UserApi::Workflow::WorkflowApi::getConfigItemValue ( string  item,
*hash< auto >  local_context,
bool  expand_complex_values = True 
)
static

returns the value of the given step configuration item

Example:
auto val = WorkflowApi::getConfigItemValue(item);
Parameters
itemthe name of the step configuration item; step configuration item values take precedence over values on workflow level. Values on workflow level take precedence over values on global level. If there is no value on the previous levels then the default value is returned.
local_contextthe caller can supply its "local" context for template variables (plus user context info is added - see the UserApi::getUserContextInfo() method)
expand_complex_valuesif True then lists and hashes will have their string values expanded recursively
Returns
the value of the given configuration item
Exceptions
CONFIG-ITEM-ERRORthrown if the configuration item is not valid
Note
Any global configuration item declared for any step in a workflow can be accessed in any other step in that workflow regardless of whether the step declared the global configuration item or not.
the value is always substituted with UserApi::expandTemplatedValue(); make sure and escape any "$" characters with a backslash ("\") to avoid template substitution
Since
  • Qorus 4.1.1 added the expand_complex_values parameter
See also

◆ getDynamicData()

static auto OMQ::UserApi::Workflow::WorkflowApi::getDynamicData ( )
static

Retrieves the values of one or more keys from the workflow order data instance’s dynamic data hash.

Dynamic data is directly linked to the order data the workflow execution instance is processing.

See also
Workflow Order Dynamic Data

Pass a single string argument, in which case the value of that key is returned, or a list of strings, in which case a hash is returned giving the values of all the keys requested

See also

◆ getDynamicDataArgs()

static auto OMQ::UserApi::Workflow::WorkflowApi::getDynamicDataArgs ( *softlist< auto >  keylist)
static

Retrieves the values of one or more keys from the workflow order data instance’s dynamic data hash.

Dynamic data is directly linked to the order data the workflow execution instance is processing.

See also
Workflow Order Dynamic Data
Parameters
keylistfor a single string argument, the value of that key is returned, for a list of strings, a hash is returned giving the values of all the keys requested
See also

◆ getErrorInfo()

static *hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getErrorInfo ( string  err)
static

Returns the hash data associated with the error code passed as an argument.

Parameters
errthe error name
Returns
normally returns a hash of error information or NOTHING if the error is not defined

◆ getInstanceData()

static auto OMQ::UserApi::Workflow::WorkflowApi::getInstanceData ( )
static

Retrieves the values of one or more keys from the workflow execution instance’s instance data hash.

This data is set by the user (by calling updateInstanceData()) and is not associated to the order data being processed, but rather directly with the workflow execution instance. In this sense, this data is similar to global variables in a program.

Pass a single string argument, in which case the value of that key is returned, or a list of strings, in which case a hash is returned giving the values of all the keys requested.

Returns
a single value or hash of workflow execution instance data, depending on the argument(s)
Note
not to be confused with getWorkflowInstanceData(), which returns system properties of the workflow execution instance
See also

◆ getInstanceDataArgs()

static auto OMQ::UserApi::Workflow::WorkflowApi::getInstanceDataArgs ( *list< auto >  keylist)
static

Retrieves the values of one or more keys from the workflow execution instance’s instance data hash.

This data is set by the user (by calling updateInstanceData()) and is not associated to the order data being processed, but rather directly with the workflow execution instance. In this sense, this data is similar to global variables in a program.

Pass a single string argument, in which case the value of that key is returned, or a list of strings, in which case a hash is returned giving the values of all the keys requested.

Returns
a single value or hash of workflow execution instance data, depending on the argument(s)
Note
not to be confused with getWorkflowInstanceData(), which returns system properties of the workflow execution instance
See also

◆ getOption()

static auto OMQ::UserApi::Workflow::WorkflowApi::getOption ( )
static

Returns the value of the named workflow option(s)

If the option is not set on the workflow level, and it is a valid system option, then the value of the system option will be returned.

Returns
the value requested directly if only one argument is passed, otherwise a hash of option keys and values; note that if no arguments are passed to the method all workflow-level options are returned as a hash
Note
Invalid options do not cause an errors to be raised; the associated key values in the hash returned will be NOTHING
See also

◆ getOptionArgs()

static auto OMQ::UserApi::Workflow::WorkflowApi::getOptionArgs ( *softlist< string >  args)
static

Returns the value of the named workflow option or options.

If the option is not set on the workflow, and it is a valid system option, then the value of the system option will be returned.

Parameters
argsthe list of options to return
Returns
the value requested directly if only one argument is passed, otherwise a hash of option keys and values; note that if no arguments are passed to the method all workflow-level options are returned as a hash
Note
When called from workflow code, invalid options do not cause an errors to be raised; the associated key values in the hash returned will be NOTHING
See also

◆ getOrderKeys()

static auto OMQ::UserApi::Workflow::WorkflowApi::getOrderKeys ( )
static

This method retrieves the user-defined order key information saved against the workflow order data instance.

Pass a single string argument, in which case the value of that key is returned, or a list of strings, in which case a hash is returned giving the values of all the keys requested. Pass NOTHING to the method to get a hash of all keys (if any are set).

◆ getOrderKeysArgs()

static auto OMQ::UserApi::Workflow::WorkflowApi::getOrderKeysArgs ( *softlist< auto >  keylist)
static

This method retrieves the user-defined order key information saved against the workflow order data instance.

Parameters
keylistfor a single string argument, te value of that key is returned, for a list of strings, a hash is returned giving the values of all the keys requested. Pass NOTHING to the method to get a hash of all keys (if any are set).

◆ getOrderNotes()

static list OMQ::UserApi::Workflow::WorkflowApi::getOrderNotes ( *int  count)
static

Get Order Instance Notes.

Parameters
countan optional integer to limit the list size
Returns
list of hashes of Order Instance Notes
See also

◆ getSensitiveData()

static auto OMQ::UserApi::Workflow::WorkflowApi::getSensitiveData ( string  skey,
string  svalue 
)
static

Returns the sensitive data for the given sensitive data key and value.

Example:
string tax_number = WorkflowApi::getSensitiveData("personal_id", personal_id, "tax_number");
Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
...any sensitive data keys for the given key and value
Returns
the sensitive data according to the sensitive data key and value; if no such sensitive key and value exist for the order, then NOTHING is returned; if no key arguments are present, then the entire hash is returned (if any), otherwise only the given key values are returned; if mutiple keys are given, then a hash is returned, if a single key is given, then only that key value is returned
Note
returns sensitive data; take care not to log any of the data returned by this method
See also

◆ getSensitiveDataAliases()

static hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getSensitiveDataAliases ( )
static

returns a hash of all sensitive data aliases for the current order or an empty hash if there are none

Example:
hash<auto> ah = WorkflowApi::getSensitiveDataAliases();
Returns
a hash of all sensitive data aliases for the current order or an empty hash if there are none, otherwise keys are alias names and values are hashes with the following keys:
  • skey: (string) the sensitive data key type
  • svalue: (string) the sensitive data value (considered sensitive itself)
Note
returns sensitive data; sensitive data values (svalue) should not be logged
See also

◆ getSensitiveDataArgs()

static auto OMQ::UserApi::Workflow::WorkflowApi::getSensitiveDataArgs ( string  skey,
string  svalue,
*list< auto >  keylist 
)
static

Returns the sensitive data for the given sensitive data key and value.

Example:
string tax_number = WorkflowApi::getSensitiveDataArgs("personal_id", personal_id, "tax_number");
Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
keylistany sensitive data keys for the given key and value
Returns
the sensitive data according to the sensitive data key and value; if no such sensitive key and value exist for the order, then NOTHING is returned; if keylist is empty, then the entire hash is returned (if any), otherwise only the given key values are returned; if mutiple keys are given, then a hash is returned, if a single key is given, then only that key value is returned
Note
returns sensitive data; take care not to log any of the data returned by this method
See also

◆ getSensitiveDataFromAlias()

static hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getSensitiveDataFromAlias ( string  alias)
static

returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of one or more keys in the workflow sensitive data hash for the given sensitive data alias corresponding to a sensitive data key and value

Example:
# get the tax number for the person
string tax_number = WorkflowApi::getSensitiveDataFromAlias("0", "tax_number").value;
Parameters
aliasthe alias to lookup; if the alias is unknown, an INVALID-ALIAS exception is raised
...zero or more string key fields to return
Returns
a hash of information corresponding to the arguments; the hash returned has the following keys:
  • skey: (string) the sensitive data key type
  • svalue: (string) the sensitive data value
  • value: the value of the entire hash (if no arguments were requested), or a hash of the requested keys (if more than one key was requested), or the given value (if set, if one value is requested)
Exceptions
INVALID-ALIASthe given alias is unknown
Note
returns sensitive data; take care not to log any of the data returned by this method
See also

◆ getSensitiveDataFromAliasArgs()

static hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getSensitiveDataFromAliasArgs ( string  alias,
*list< auto >  keylist 
)
static

returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of one or more keys in the workflow sensitive data hash for the given sensitive data alias corresponding to a sensitive data key and value

Example:
# get the tax number for the person
string tax_number = WorkflowApi::getSensitiveDataFromAlias("0", "tax_number").value;
Parameters
aliasthe alias to lookup; if the alias is unknown, an INVALID-ALIAS exception is raised
keylistzero or more string key fields to return
Returns
a hash of information corresponding to the arguments; the hash returned has the following keys:
  • skey: (string) the sensitive data key type
  • svalue: (string) the sensitive data value
  • value: the value of the entire hash (if no arguments were requested), or a hash of the requested keys (if more than one key was requested), or the given value (if set, if one value is requested)
Exceptions
INVALID-ALIASthe given alias is unknown
Note
returns sensitive data; take care not to log any of the data returned by this method
See also

◆ getSensitiveDataKeyValues()

static hash OMQ::UserApi::Workflow::WorkflowApi::getSensitiveDataKeyValues ( )
static

Returns a hash of sensitive data keys and values saved against the order; the sensitive data hashes themselves are not returned, just the information used to index sensitive data against the order.

Example:
*hash<auto> h = WorkflowApi::getSensitiveDataKeyValues();
Returns
a hash of sensitive data keys and values saved against the order; the sensitive data hashes themselves are not returned, just the information used to index sensitive data against the order; if no sensitive data is stored against the order, an empty hash is returned
Note
returns sensitive data; sensitive data values should not be logged
See also

◆ getSensitiveMetadata()

static auto OMQ::UserApi::Workflow::WorkflowApi::getSensitiveMetadata ( string  skey,
string  svalue 
)
static

Returns the sensitive metadata hash for the given sensitive data key and value if present, otherwise returns an empty hash.

Example:
hash<auto> metadata = WorkflowApi::getSensitiveMetadata("personal_id", personal_id);
Parameters
skeythe type of sensitive key provided in svalue
svaluethe value of the sensitive data key identified by skey
Returns
the sensitive metadata hash stored according to the sensitive data key and value; if no such sensitive key and value exist for the order, or no metadata is present for the given sensitive key and value, then an empty hash is returned
Note
returns sensitive data; take care not to log any of the data returned by this method
See also

◆ getSensitiveMetadataFromAlias()

static hash OMQ::UserApi::Workflow::WorkflowApi::getSensitiveMetadataFromAlias ( string  alias)
static

returns a hash with the corresponding sensitive data key and sensitive data value as well as the value of the sensitive metadata hash for the given sensitive data alias corresponding to a sensitive data key and value

Example:
# get sensitive metadata
hash<auto> metadata = WorkflowApi::getSensitiveMetadataFromAlias("0").value;
Parameters
aliasthe alias to lookup; if the alias is unknown, an INVALID-ALIAS exception is raised
Returns
a hash of information corresponding to the arguments; the hash returned has the following keys:
  • skey: (string) the sensitive data key type
  • svalue: (string) the sensitive data value (considered sensitive itself)
  • value: (hash) the value of the sensitive metadata hash, if any
Exceptions
INVALID-ALIASthe given alias is unknown
Note
returns sensitive data; take care not to log any of the sensitive data returned by this method
See also

◆ getStaticData()

static auto OMQ::UserApi::Workflow::WorkflowApi::getStaticData ( )
static

Retrieves the values of one or more keys from the workflow order data instance’s static data hash.

Pass a single string argument, in which case the value of that key is returned, or a list of strings, in which case a hash is returned giving the values of all the keys requested

Workflow order static data corresponds to the deserialized contents of the database field ORDER_INSTANCE.STATICDATA for the current workflow order data instance.

See also
Workflow Order Static Data
Returns
data from the workflow order data instance’s static data hash according to the arguments passed
See also

◆ getStaticDataArgs()

static auto OMQ::UserApi::Workflow::WorkflowApi::getStaticDataArgs ( *softlist< auto >  keylist)
static

Retrieves the values of one or more keys from the workflow order data instance’s static data hash.

Pass a single string argument, in which case the value of that key is returned, or a list of strings, in which case a hash is returned giving the values of all the keys requested

Workflow order static data corresponds to the deserialized contents of the database field ORDER_INSTANCE.STATICDATA for the current workflow order data instance.

See also
Workflow Order Static Data
Returns
data from the workflow order data instance’s static data hash according to the arguments passed
See also

◆ getStepInfo()

static *hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getStepInfo ( )
static

This method will return a hash of step information for the current step.

Returns
if not called from a step; returns NOTHING, otherwise returns a hash with the following members:

◆ getStepStatus()

static *string OMQ::UserApi::Workflow::WorkflowApi::getStepStatus ( string  stepname)
static

Returns the current status of the given step for the current workflow order instance.

If the step name does not exist then an exception is thrown

Returns
the current status of the given step for the current workflow order instance

◆ getTempData()

static auto OMQ::UserApi::Workflow::WorkflowApi::getTempData ( )
static

Retrieves the values of one or more keys from the workflow order data instance’s temporary data hash.

See also
Workflow Temporary Data

◆ getTempDataArgs()

static auto OMQ::UserApi::Workflow::WorkflowApi::getTempDataArgs ( *softlist< auto >  keylist)
static

Retrieves the values of one or more keys from the workflow order data instance’s temporary data hash.

See also
Workflow Temporary Data

◆ getWfiid()

static *softint OMQ::UserApi::Workflow::WorkflowApi::getWfiid ( )
static

returns the current workflow_instanceid as an integer; returns NOTHING if not called in a workflow order context (ex: onetimeinit function, etc)

Returns
the current workflow_instanceid as an integer; returns NOTHING if not called in a workflow order context (ex: onetimeinit function, etc)
See also

◆ getWorkflowInstanceData() [1/2]

static hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getWorkflowInstanceData ( )
static

Retrieves the values of multiple keys (system-defined properties) from the workflow execution instance object itself.

Pass a list of string keys, in which case a hash is returned giving the values of all the keys requested; see Running Workflow Execution Instance Properties for valid keys; if no arguments are passed, then a hash of all possible keys is returned

Returns
a hash of key-value pairs giving the value of the given keys in the current workflow execution instance
Exceptions
GET-WORKFLOW-INSTANCE-DATA-ERRORinvalid arguments to method
Note
not to be confused with getInstanceData()
See also

◆ getWorkflowInstanceData() [2/2]

static auto OMQ::UserApi::Workflow::WorkflowApi::getWorkflowInstanceData ( string  field)
static

Retrieves the value of a single key (system-defined property) from the workflow execution instance object itself.

Parameters
fieldthe workflow execution instance key; see Running Workflow Execution Instance Properties for valid keys
Returns
the value of the key in the current workflow execution instance
Note
not to be confused with getInstanceData()
See also

◆ getWorkflowInstanceDataArgs()

static hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getWorkflowInstanceDataArgs ( *list< auto >  keylist)
static

Retrieves the values of one or more keys (system-defined properties) from the workflow execution instance object itself as a hash.

Parameters
keylista list of string keys; see Running Workflow Execution Instance Properties for valid keys; if no arguments are passed, then a hash of all possible keys is returned
Returns
a hash of key-value pairs giving the value of the given keys in the current workflow execution instance
Exceptions
GET-WORKFLOW-INSTANCE-DATA-ERRORinvalid arguments to method
Note
not to be confused with getInstanceData()
See also

◆ getWorkflowMetadata()

static hash< auto > OMQ::UserApi::Workflow::WorkflowApi::getWorkflowMetadata ( )
static

returns workflow metadata for the currently running workflow as a hash

Returns
a hash of workflow metadata; see Workflow Metadata for the hash description

◆ leaveParentFeedback()

static OMQ::UserApi::Workflow::WorkflowApi::leaveParentFeedback ( string  key,
auto  value 
)
static

leaves feedback for a parent workflow

When this call returns, the feedback data has already been committed to the database.

Parameters
keythe key name for the feedback in the parent workflow
valuethe value of the key
Exceptions
FEEDBACK-ERRORthe current workflow is not a subworkflow; value is NOTHING or an error occurred accessing the parent workflow order
SESSION-ERRORthe parent workflow order is being processed by another Qorus session
STATUS-ERRORthe parent workflow order is already COMPLETE or CANCELED and cannot be updated

The parent workflow should then call getChildFeedback() to get the feedback data left by the child workflow.

Note
The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ parentWfiid()

static *softint OMQ::UserApi::Workflow::WorkflowApi::parentWfiid ( )
static

Returns the parent workflow order data instance ID from a subworkflow or NOTHING if the current workflow order is not a subworkflow and therefore has no parent.

Returns
the parent workflow order data instance ID of a subworkflow or NOTHING if the current workflow order is not a subworkflow
See also

◆ reprioritizeOrder()

static OMQ::UserApi::Workflow::WorkflowApi::reprioritizeOrder ( int  prio)
static

changes the order priority for the current workflow order instance

Parameters
priomust be an integer >= 0 and <= 999
Note
The order priority can be changed externally by calling the system API method omq.system.reprioritize-order()

◆ rescheduleOrder()

static OMQ::UserApi::Workflow::WorkflowApi::rescheduleOrder ( date  scheduled)
static

reschedules the current workflow order instance for later processing

Can only be called in the attach function; calling anywhere else will cause an exception to be raised. Can only be called when the workflow order has status OMQ::StatReady or OMQ::StatScheduled; otherwise an exception will be raised.

Parameters
scheduledIf the date is ealier than the current time; then this call is ignored
Exceptions
RESCHEDULE-ERRORmethod not called from the attach function; order data does not have OMQ::StatReady or OMQ::StatScheduled status
Note
The scheduled date can be changed or cleared by calling the system API method omq.system.reschedule-order()

◆ setBlocked()

static OMQ::UserApi::Workflow::WorkflowApi::setBlocked ( )
static

set the current workflow order status to OMQ::StatBlocked, can only be called from the attach function

Processing of the workflow order will stop after this call; in order to be further processed the workflow order must be unblocked

Exceptions
BLOCK-ERRORmethod not called from attach function
Note
This method can only be called in the attach function of the workflow; if called from any other code, an exception will result.

◆ setCustomStatus()

static OMQ::UserApi::Workflow::WorkflowApi::setCustomStatus ( string  stat)
static

Sets a user-defined custom status for the current step.

The custom status is also propagatef to the segment and workflow order data instances. The status is reset when the step is updated subsequently. The value of the custom status is only used for display purposes; it does not affect Qorus’ internal behavior at all.

Parameters
statthe custom user-defined status to set for the step
Exceptions
CUSTOM-STATUS-ERRORthis exception is thrown if this method is called outside of step code
Note
The custom status must be a single character

◆ setOption() [1/2]

static OMQ::UserApi::Workflow::WorkflowApi::setOption ( hash< auto >  hash)
static

Changes option values on a workflow.

If the workflow has defined workflow options, and at least one invalid option is passed to the method, an exception will be raised; however all other valid options in the hash will be set before the exception is raised

Parameters
hasha hash of option-value pairs
Exceptions
WORKFLOW-OPTION-ERRORinvalid option name
See also

◆ setOption() [2/2]

static OMQ::UserApi::Workflow::WorkflowApi::setOption ( string  option,
auto  value 
)
static

Changes a single option value on a workflow.

If the workflow has defined workflow options and an invalid option is passed to the method, an exception will be raised.

Parameters
optionthe option to set
valuethe value to set for the option
Exceptions
WORKFLOW-OPTION-ERRORinvalid option name
See also

◆ setOrderKey()

static OMQ::UserApi::Workflow::WorkflowApi::setOrderKey ( string  key,
softlist< softstring >  value,
bool  truncate = False 
)
static

This method sets the values for a sinle user-defined order key against an order, so that the workflow order data instance can be quickly searched and retrieved using the key value.

The value provided replaces any order key value on the workflow order

The data is committed to the database before the method returns.

Parameters
keythe workflow key to set; must be a valid workflow key
valueone or more values for the workflow key
truncateallow key values to be truncated without an error
Exceptions
INVALID-WORKFLOW-KEYinvalid key for workflow
DUPLICATE-KEY-VALUEan order key was assigned a value more than once
Note
the use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ setOrderKeys()

static OMQ::UserApi::Workflow::WorkflowApi::setOrderKeys ( hash< auto >  h,
bool  truncate = False 
)
static

This method sets user-defined order keys against an order, so that the workflow order data instance can be quickly searched and retrieved using the key value.

The hash provided replaces orders keys on the workflow order; existing order keys matching keys given in the hash provided as an argument to this method are replaced and any new keys in the hash are added.

The data is committed to the database before the method returns.

Parameters
hkey-value pairs to set for order keys; the keys in this hash must match those defined for the workflow
truncateallow key values to be truncated without an error
Exceptions
SET-ORDER-KEYS-ERRORempty hash passed to setOrderKeys()
INVALID-WORKFLOW-KEYinvalid key for workflow
DUPLICATE-KEY-VALUEan order key was assigned a value more than once
Note
the use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ setRetryDelay() [1/2]

static OMQ::UserApi::Workflow::WorkflowApi::setRetryDelay ( date  delay)
static

Sets the value of the retry delay for a step error or an asynchronous step.

Only takes effect when called from an asynchronous step that will receive an OMQ::StatAsyncWaiting ("A") status or when called from a normal step after an error has been raised that will cause the step to get a OMQ::StatRetry ("R") status. Note that if this method is called before an error is raised, the retry delay setting will be lost.

Otherwise, to affect the retry of a normal step when an error has been raised that will give the step a status of OMQ::StatRetry ("R"), you can also use the stepError() method with the optional third argument giving the retry delay instead of calling this method after the call to stepError().

Parameters
delaythe amount of time to wait until a retry is made; overrides any value in the error definition

◆ setRetryDelay() [2/2]

static OMQ::UserApi::Workflow::WorkflowApi::setRetryDelay ( int  secs)
static

Sets the value of the retry delay for a step error or an asynchronous step.

Only takes effect when called from an asynchronous step that will receive an OMQ::StatAsyncWaiting ("A") status or when called from a normal step after an error has been raised that will cause the step to get a OMQ::StatRetry ("R") status. Note that if this method is called before an error is raised, the retry delay setting will be lost.

Otherwise, to affect the retry of a normal step when an error has been raised that will give the step a status of OMQ::StatRetry ("R"), you can also use the stepError() method with the optional third argument giving the retry delay instead of calling this method after the call to stepError().

Parameters
secsthe amount of time in seconds to wait until a retry is made; overrides any value in the error definition

◆ sleep()

static int OMQ::UserApi::Workflow::WorkflowApi::sleep ( softint  arg)
static

puts the current thread to sleep for a certain number of seconds

If the workflow is stopping, this method returns immediately with a return value of -1; otherwise the current thread is put to sleep for the full time period requested. If this method (or usleep()) is called again after -1 is returned, then a "STOP-ERROR" exception is thrown.

Parameters
argthe number of seconds to sleep
Returns
0 if current thread was put to sleep for the full time period; -1 if the sleep was interrupted because the current object is being stopped
Exceptions
STOP-ERRORthe current object is stopping and this method already returned -1 as a warning
See also

◆ stepError() [1/3]

static OMQ::UserApi::Workflow::WorkflowApi::stepError ( string  err,
auto  info 
)
static

Raises an error against the current step without affecting the flow of processing.

This method will affect the final status of the step, segment, and workflow, if the severity of the error is OMQ::ES_Major or OMQ::ES_Fatal. If the error raised is not defined, severity OMQ::ES_Major is assumed.

Parameters
errthe string error code
infoadditional information for the error; should normally be a string in order to be logged in the database; if not a string then it will be converted to a string for saving in error history
Note
workflow errors can also be raised by throwing an exception

◆ stepError() [2/3]

static OMQ::UserApi::Workflow::WorkflowApi::stepError ( string  err,
auto  info,
date  retry_delay 
)
static

Raises an error against the current step without affecting the flow of processing.

This method will affect the final status of the step, segment, and workflow, if the severity of the error is OMQ::ES_Major or OMQ::ES_Fatal. If the error raised is not defined, severity OMQ::ES_Major is assumed.

Parameters
errthe string error code
infoadditional information for the error; should normally be a string in order to be logged in the database; if not a string then it will be converted to a string for saving in error history
retry_delaythe amount of time to wait until a retry is made; overrides any value in the error definition; this may be either a relative date/time value (in which case the value is added to the current time to arrive at an absolute date/time value), or an absolute date/time value, giving the earliest date/time that the error will be retried
Note
workflow errors can also be raised by throwing an exception

◆ stepError() [3/3]

static OMQ::UserApi::Workflow::WorkflowApi::stepError ( string  err,
auto  info,
int  retry_delay 
)
static

Raises an error against the current step without affecting the flow of processing.

This method will affect the final status of the step, segment, and workflow, if the severity of the error is OMQ::ES_Major or OMQ::ES_Fatal. If the error raised is not defined, severity OMQ::ES_Major is assumed.

Parameters
errthe string error code
infoadditional information for the error; should normally be a string in order to be logged in the database; if not a string then it will be converted to a string for saving in error history
retry_delaythe amount of time in seconds to wait until a retry is made; overrides any value in the error definition
Note
workflow errors can also be raised by throwing an exception

◆ stepExecuted()

static bool OMQ::UserApi::Workflow::WorkflowApi::stepExecuted ( string  stepname)
static

This method returns True if the step passed has been executed and has status OMQ::StatComplete ("C")

If the step name does not exist then an exception is thrown

Returns
True if the step passed has been executed and has status OMQ::StatComplete ("C")

◆ stepWarning() [1/2]

static OMQ::UserApi::Workflow::WorkflowApi::stepWarning ( string  err,
auto  info 
)
static

Raises a warning against the step.

The information is logged, but does not affect the step’s status.

Parameters
errthe string error code
infoadditional information for the error; should normally be a string in order to be logged in the database; if not a string then it will be converted to a string for saving in error history

◆ stepWarning() [2/2]

static OMQ::UserApi::Workflow::WorkflowApi::stepWarning ( string  err,
string  fmt 
)
static

Raises a warning against the step.

The information is logged, but does not affect the step’s status.

Parameters
errthe string error code
fmta format string to format additional arguments

◆ updateDynamicData()

static OMQ::UserApi::Workflow::WorkflowApi::updateDynamicData ( hash< auto >  hash)
static

Updates the values of one or more keys in the workflow order data instance’s dynamic data hash.

Dynamic data is directly linked to the order data the workflow execution instance is processing.

Changes are committed to the database before the method returns.

See also
Workflow Order Dynamic Data
Parameters
hashthe key-value pairs to update in dynamic data
Note
  • This call does not replace the dynamic data hash; any keys in the hash parameter are added to the dynamic data hash
  • The use of this method causes SQL I/O to be performed in the system schema; to maximize performance, calls to this and other similar methods should be minimized if possible
See also

◆ updateInstanceData()

static OMQ::UserApi::Workflow::WorkflowApi::updateInstanceData ( hash< auto >  hash)
static

Updates the values of one or more keys in the workflow execution instance’s instance data hash.

Parameters
hashthe key-value pairs to update in workflow execution instance data
See also

◆ updateSensitiveData()

static OMQ::UserApi::Workflow::WorkflowApi::updateSensitiveData ( string  skey,
string  svalue,
hash< auto >  hash,
*softlist  aliases,
*hash< auto >  meta 
)
static

Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data key and value.

Example:
WorkflowApi::updateSensitiveData("personal_id", h.person.personal_id, h, h.("tax_number",));
Parameters
skeythe type of value provided in svalue; must not be longer than 100 bytes long or a SENSITIVE-DATA-ERROR exception is raised
svaluethe value of the sensitive data key identified by skey; if this string is empty or longer than 100 bytes, a SENSITIVE-DATA-ERROR exception is raised
hashthe data to create or update against skey; existing keys will be replaced; new keys will be added; if the new hash does not refer to existing keys, then those existing keys remain untouched
aliasesother values for the sensitive data
metaoptional sensitve data metadata with the following recommended keys:
  • 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
Exceptions
SENSITIVE-DATA-ERRORno sensitive key value was provided; sensitive key value too long (100 bytes maximum length in the encoding used by the system schema)
Note
  • do not use sensitive data for the sensitive key names itself (skey); key names are logged to provide an audit trail of changes to sensitive data
  • metadata keys listed above for the meta argument are recommended for consistency's sake but are not checked; a hash with any keys can be stored with this API
See also

◆ updateSensitiveDataFromAlias()

static OMQ::UserApi::Workflow::WorkflowApi::updateSensitiveDataFromAlias ( string  alias,
hash< auto >  hash,
*hash< auto >  meta 
)
static

Updates or creates the values of one or more keys in the workflow order's sensitive data hash for the given sensitive data alias.

Example:
WorkflowApi::updateSensitiveDataFromAlias("0", h);
Parameters
aliasthe alias to use for updating the data; if the alias is unknown, an INVALID-ALIAS exception is raised
hashthe data to create or update against skey; existing keys will be replaced; new keys will be added; if the new hash does not refer to existing keys, then those existing keys remain untouched
metaoptional sensitve data metadata with the following recommended keys:
  • 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
Exceptions
INVALID-ALIASthe alias given is unknown
Note
  • metadata keys listed above for the meta argument are recommended for consistency's sake but are not checked; a hash with any keys can be stored with this API
See also

◆ updateTempData()

static OMQ::UserApi::Workflow::WorkflowApi::updateTempData ( hash< auto >  hash)
static

Updates the values of one or more keys in the workflow order data instance’s temporary data hash.

Parameters
hashthe key-value pairs to update in workflow temporary data
See also
Workflow Temporary Data
Note
This call does not replace the temporary data hash; any keys in the hash parameter are added to the temporary data hash
See also

◆ usleep() [1/2]

static int OMQ::UserApi::Workflow::WorkflowApi::usleep ( date  arg)
static

puts the current thread to sleep for a certain number of microseconds

If the workflow is stopping, this method returns immediately with a return value of -1; otherwise the current thread is put to sleep for the full time period requested. If this method (or sleep()) is called again after -1 is returned, then a "STOP-ERROR" exception is thrown.

Parameters
argthe amount of time in microseconds to sleep (1 microsecond = 1/1000000 of a second)
Returns
0 if current thread was put to sleep for the full time period; -1 if the sleep was interrupted because the current object is being stopped
Exceptions
STOP-ERRORthe current object is stopping and this method already returned -1 as a warning
See also

◆ usleep() [2/2]

static int OMQ::UserApi::Workflow::WorkflowApi::usleep ( softint  arg)
static

puts the current thread to sleep for a certain number of microseconds

If the workflow is stopping, this method returns immediately with a return value of -1; otherwise the current thread is put to sleep for the full time period requested. If this method (or sleep()) is called again after -1 is returned, then a "STOP-ERROR" exception is thrown.

Parameters
argthe number of microseconds to sleep (1 microsecond = 1/1000000 of a second)
Returns
0 if current thread was put to sleep for the full time period; -1 if the sleep was interrupted because the current object is being stopped
Exceptions
STOP-ERRORthe current object is stopping and this method already returned -1 as a warning
See also

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