...
This section includes the following:
Table of Contents |
---|
UDR Related Functions
udrRoute
This function routes a UDR or bytearray to all the output routes, or a named output route.
Code Block |
---|
def udrRoute(udr, route=None) |
Parameter | Description |
---|---|
| The UDR to route |
| The route on which to send the UDR |
Returns | Nothing |
Info | |||
---|---|---|---|
title | Example - udrRoute
|
udrCreate
This function creates a new UDR of the specified type, and can take keyword arguments to set its fields.
Code Block |
---|
def udrCreate(typename, **kwargs) |
Parameter | Description |
---|---|
| A defined UDR type |
| Keyword arguments to set the specified fields |
Returns | A UDR of the type specified |
Info | ||
---|---|---|
Example - udrCreate
|
udrIsPresent
This function returns TrueTrue if the UDR field is present.
Code Block |
---|
def udrIsPresent(udr, attr) |
Parameter | Description |
---|---|
| The UDR |
| The attribute name |
Returns | True if the UDR field is present. |
Info | |||
---|---|---|---|
title | Example - udrIsPresent
|
udrUnsetPresent
This function marks an optional attribute for a UDR as not present.
Code Block |
---|
def udrUnsetPresent(udr, attr) |
Parameter | Description |
---|---|
| The UDR |
| The attribute name |
Returns | Nothing |
udrConsume
Note |
---|
Note!This function applies for the Python Connector agent only. |
This function consumes a UDR routed to the Python Connector agent. The timeout is in seconds.
Note |
---|
Note!UDRs that have not been consumed are overwritten. |
Code Block |
---|
def udrConsume(timeout=None) |
Parameter | Description |
---|---|
| The timeout in seconds, which waits forever if no timeout is specified |
Returns | The UDR or bytearray routed, or None if timed out while waiting |
Debug Related Functions
debug
...
If Event is selected, the output is shown in the Workflow Monitor.
Code Block |
---|
def debug(obj) |
Parameter | Description |
---|---|
| The object to write to debug output. The object can be of any type. Note that printing a UDR type will dump all the field values, which may be a large amount of data. Similarly, the debug output for a table, map, list or bytearray type may be very large. The output is the string representation of object. |
Returns | Nothing |
isDebugEnabled
This function states if debugging has been enabled for the workflow. A debug event is only sent if isDebugEnabled
returns True
.
Code Block |
---|
def isDebugEnabled() |
Parameter | Description |
---|---|
Returns | True or False depending on if debug is enabled or not |
MIM Related Functions
mimGet
This function returns the value of a MIM resource available in the workflow.
Code Block |
---|
def mimGet(category, mimResourceName) |
Parameter | Description |
---|---|
| The name of the agent or workflow that owns the MIM resource |
| The name of the MIM resource whose value is to be returned |
Returns | The MIM value. |
Info | ||
---|---|---|
Example - mimGet
|
mimSet
This function assigns a value to a user defined MIM resource. The function may be called at any time. Note that it is the responsibility of the user to make sure the MIM value is available in accordance with the specified assigned type.
Code Block |
---|
def mimSet(name, value) |
Parameter | Description |
---|---|
| The name of the MIM resource to assign a value |
| The value to assign, which must match the published MIM type |
Returns | Nothing |
Info | ||
---|---|---|
Example - mimSet
|
Misc Functions
abort
Note | |
---|---|
title | Note!This function does not apply for the Python Connector agent. |
This function stops the workflow, and logs a user defined message to the System Log.
Code Block |
---|
def abort(message) |
Parameter | Description |
---|---|
| The message that is sent to |
the System Log when the workflow is aborted | |
Returns | Nothing |
Info | ||
---|---|---|
Example - abort
|
wfStop
This function stops a running workflow. wfStop
produces a single stop signal and does not wait for the workflow to stop. If it succeeds in stopping the workflow, the stop is registered in the System Log.
Code Block |
---|
def wfStop(wfName, immediate=True) |
Parameter | Description |
---|---|
| You must provide the name of the workflow to be stopped. |
| For a real-time workflow, the |
Returns | If the command is successful the value is |
Info | ||
---|---|---|
Example - wfStop
|
isStopped
Note | |
---|---|
title | Note!This function does not apply for the Python Connector agent. |
...
Code Block |
---|
def isStopped() |
Parameter | Description |
---|---|
Returns | True or False depending on if workflow has been stopped or not |
Info | |||
---|---|---|---|
title | Example - isStopped
|
...
Code Block |
---|
def dynamicFieldGet(category, name) |
Parameter | Description |
---|---|
| The cateogry of the dynamic field |
| The name of the dynamic field |
Returns | The value of the selected dynamic field |
Info | |||
---|---|---|---|
title | Example - dynamicFieldGet
|
Timeout Functions
Note |
---|
Note!The timeout functions only apply for the Python collection and processing agents in real-time workflows. |
setTimeout
A timeout can be set to trigger delayed actions, see the def timeout(obj)
function block in Function Blocks for Agents in Real-Time Workflows. The timeout is in seconds. Setting a timeout on an object sets or updates the current timeout in seconds on that object. A timeout is triggered once on the object, and then it has to be set again to be repeated.
Code Block |
---|
def setTimeout(obj, timeout) |
Parameter | Description |
---|---|
| The object can be of any type |
| The timeout in seconds |
Returns | Nothing |
removeTimeout
A timeout can be removed, see the def timeout(obj)
function block in Function Blocks for Agents in Real-Time Workflows. The timeout is in seconds.
Code Block |
---|
def removeTimeout(obj) |
Parameter | Description |
---|---|
obj | The same object as used |
in | |
Returns | Nothing |
Log Related Functions
logInformation
This function logs a message string to the System Log of type information.
Code Block |
---|
def logInformation(message) |
Parameter | Description |
---|---|
| A message appearing in the log |
Returns | Nothing |
logWarning
This function logs a message string to the System Log of type warning.
Code Block |
---|
logWarning(message) |
Parameter | Description |
---|---|
message | A message appearing in the log |
Returns | Nothing |
logError
This function logs a message string to the System Log of type error.
Code Block |
---|
def logError(message) |
Parameter | Description |
---|---|
| A message appaering in the log |
Returns | Nothing |
logException
This function logs the current exception to the System Log.
Code Block |
---|
def logException() |
Parameter | Description |
---|---|
Returns | Nothing |
Info | ||
---|---|---|
Example - logException
|
formatException
This function formats the current exception and returns the string.
Code Block |
---|
def formatException() |
Parameter | Description |
---|---|
Returns | The current exception formatted as a string |
Functions for Python Agents in Batch Workflows Only
The following functions only apply for the Python agents in batch workflows.
beginBatch
Note | |
---|---|
title | Note!This function only applies for Python collection agents in batch workflows. |
...
Code Block |
---|
def beginBatch() |
Parameter | Description |
---|---|
Returns | Nothing |
Info | |||
---|---|---|---|
title | Example - beginBatch
|
endbatch
Note | |
---|---|
title | Note!This function only applies for Python collection agents in batch workflows. |
This function ends the current batch.
Code Block |
---|
def endBatch() |
Parameter | Description |
---|---|
Returns | Nothing |
cancelBatch
This function emits a Cancel Batch that aborts the processing of the current batch and possibly continues with the next batch (depending on the workflow configuration).
Code Block |
---|
def cancelBatch(message, errorUDR=None) |
Parameter | Description |
---|---|
| A message, which is logged to the System Log when the batch is cancelled. |
| It is possible to send an error UDR containing any useful information. This parameter is optional. |
Returns | Nothing |
Info | ||
---|---|---|
Example - cancelBatch
|
splitBatch
Note |
---|
Note!This function only applies for Python collection agents in batch workflows. |
When invoked, this function propagates to the other agents that the input batch will be split.
Code Block |
---|
def splitBatch() |
Parameter | Description |
---|---|
Returns | Nothing |
hintEndBatch
This function sends a Hint End Batch message to the collection agent in the workflow, possibly causing a split of the current batch being processed.
Code Block |
---|
def hintEndBatch() |
Parameter | Description |
---|---|
Returns | Nothing |
getTransactionId
This function returns the current transaction id, or None
if there is currently no active transaction.
Code Block |
---|
def getTransactionId() |
Parameter | Description |
---|---|
Returns | The current transaction id or |