Agent Types and MIMs (5.0)
This section describes different types of agents, how they behave, and their requirements in different types of workflows, as well as the Meta Information Model (MIM).
There are three different types of workflows; batch, real-time, and task.
Batch - Handles data in transactions, where you start a batch, send data into the workflow as a bytearray, and then end the batch. Thereafter the batch can either be committed or it can be rolled back.
Real-time - Treats data as individual UDRs and not as a continuous stream of data. There is no transaction safety and any data that is in the workflow at the time of a system failure is lost.
Tasks - Runs tasks that are created by the user or included in the system. Single-agent workflows that do not collect or emit data.
Agents in Real-time versus Batch Workflow
Batch-collecting agents feed the workflow one batch at a time while batch-processing agents process one piece of data at a time and do not emit any transactions. The workflow logic is adapted to data execution in sequential and single-threaded mode.
Real-time collecting agents are collectors that feed the workflow record-by-record, and real-time processing agents handle several records simultaneously. The workflow logic is adapted for several threads working in parallel and statefulness on the user session. In real-time workflows, there may not be any need to forward the processed data, and a response must be sent back through the connecting agent that received the request.
The following table lists some of the differences between batch and real-time workflows.
Batch | Real-time |
---|---|
Data is ordered. | Order is not guaranteed. |
Only one collector per workflow is allowed. | Several collectors per workflow may exist. |
Only one built-in thread in the agent is utilized. | The agent can handle multiple threads. |
Stops to close transactions. | Never stops processing. |
Stops executing when there is no more data to process, except for some push collectors that may continue execution in this case. | Never stops executing. |
Data flows one way. | Data may be routed back to the collector. |
No circular routing. | Circular routing is allowed. |
Different types of MIM values. | Only global MIM values. |
Standalone Workflows
There is a special type of workflow, called a standalone workflow.
To ensure that an agent is compatible with standalone execution it must adhere to the following rules:
Only real-me agents are candidates for standalone.
Remote cNoteommunication can only occur in the agent's
initialize
anddeinitialize
methods.Only local storage can be used.
Meta Information Model
Usage Engine provides a data model that will supply information published by the agents and the workflow, to all other agents in the workflow during workflow execution. This data model is referred to as the Meta Information Model (MIM). In DTK the DRMIMEntry
class describes a specific MIM. MIMs are often used to communicate configuration of runtime information between agents as well as adding audit and ability to trace errors. To request the value of an entry, or to retrieve a list of all existing entries, the DRMIMTree
method is utilized.
Agents can define when a MIM's value is available, using four constants in the DRMIMEntry
class. These four types include:
Global
- An entity that spans over many batches. If this entry is cacheable it will be constant for the execution of a workflow.
Note!
Real-time agents can only use Global MIM type.
Batch
- An entity that can be updated during a batch. If this entry is cacheable (DRMIMEntry.isCacheable()
) the tree delegating MIMs will keep the value of this entry during the current batch.Header
- An entity available in the header of a batch. This value is, once requested, cached in the MIM tree for the given batch. Mostly this MIM is assigned its value in thebeginBatch
call.Trailer
- An entity available in the trailer of a batch. This value is, once requested, cached in the MIM tree for the given batch. This MIM can be accessed at any time after thedrain
call on the corresponding agent.