This section describes how to flush aggregation sessions in real-time and batch workflows.
The following functions for Aggregation flush described here are:
Table of Contents | ||
---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
To flush Real-time workflow sessions, run an agent command from the Command Tab of the Aggregation agent in the Workflow Monitor or use the Command Line Tool mzsh. There is a choice of applying the command on all sessions or only on those with a timeout set. There is also an option of attaching information in a string to be available within the command function block in the Aggregation agent.
Note | ||
---|---|---|
| ||
You cannot flush sessions that are stored in Couchbase. |
Note | ||
---|---|---|
| ||
The command function block works in the same way as the timeout function block, that is, code has to be written to route the session result and to remove the session. |
Info | ||
---|---|---|
| ||
A simple APL example of
|
Using Workflow Monitor
To access the Command tab, you will have to access the Agent Status dialog from the Workflow Monitor. Select the Aggregation agent from the Workflow Monitor and click on the icon that appears above the agent.
Aggregation agent in Workflow Monitor - Agent Status Button
Aggregation agent in Workflow Monitor - Command tab
Parameter | Description |
---|---|
| Trigger a flush for sessions that have already timeout. |
| Trigger a flush for all sessions, regardless if they have already timeout or not. |
| This is an optional string used only when there is a command function block defined within the Aggregation agent. If specified, the string will trigger the |
Using MZSH Syntax
Syntax to run the command function block from mzsh:
Code Block |
---|
$ mzsh wfcommand <Workflow Name> <Agent Name> <"true"|"false"> <instruction> |
Info | ||
---|---|---|
| ||
A simple mzsh example to trigger a flush for all sessions with the instruction "extra":
|
Parameter | Description |
---|---|
| The name of the workflow that contains the Aggregation agent |
| The name of the Aggregation agent in the workflow |
| Specifies what sessions to apply the |
| This is an optional string. If specified, the string will be available within the |
Batch Aggregation APL Flush Function
This section describes the APL function aggregationHintFlushSessions
, which is used to timeout all stored sessions that have a timeout value in a batch Aggregation agent. The function is included in the package Batch Aggregation APL Flush Function.
The APL function aggregationHintFlushSessions
may be called from Analysis APL code or Aggregation APL code in batch workflows.
The function is used to indicate that the timeout
function block in the APL code for the specified Aggregation agent shall be called for all the sessions in the storage that have a timeout value. The timeout
block execution will be performed after the drain
function block has been executed in the specified Aggregation agent. The call to the function will not be remembered between batches.
Note | ||
---|---|---|
| ||
Only sessions that have a timeout value will timeout even if the function |
When executed, the function will throw an exception if it is called from an illegal location or if the agent named aggregationAgentName
is not an Aggregation agent in the workflow.
Function Definition:
Code Block |
---|
void aggregationHintFlushSessions(string aggregationAgentName ) |
Parameter | Description |
---|---|
| The name of an Aggregation agent in the batch workflow |
Info | ||
---|---|---|
| ||
For example, consider a batch workflow containing one Aggregation agent named "Agg" which has the Aggregation agent property If Timeout is Missing set to Default. Also, consider that the
Finally, consider that there are 10 sessions, with timeout values in the distant future, in the storage when the end of the |
Note | ||
---|---|---|
| ||
A workflow using |