An output expression is used to output the result of joining an input event and master data.
The format used for output expression is shown below.
Specify the property of the event to be output and the master data item.
If no master data fulfills the join-relational expression conditions, the output as the master item will be empty.
Operation is as follows if an output item is not specified:
Input events filtered by a search expression are output as is.
If there is no search expression, CEP engine startup fails.
All properties of input events and all items of all joined master data are output in sequence (if input events are in CSV format).
If input events are in XML format, CEP engine startup fails.
Point
If an output expression that does not have an argument (output item) after the join expression is described, the output results are the same as for an output expression in which all items of input events and master data are specified.
IF-THEN statement:
join("MASTER01", $propA == $prop11), join("MASTER02", $propB == $prop22) output();
The above output() has the same output result as the following output expression:
output($propA,$propB,$propC,"MASTER01".$prop11,"MASTER01".$prop12,"MASTER02".$prop21,"MASTER02".$prop22);
Note
Output item specification is mandatory if join processing is used for events in XML format.
Output item specification can be omitted only if a search expression or a join expression is specified.
There is no limit to the number of output items that can be specified for one output(). However, if the size obtained from the following calculation expression exceeds 65535 bytes, CEP engine startup fails:
Size calculation expression:
sizeRequiredForOutputItems + numberOfOutputItems - 1 (bytes)
Output item | Required size |
---|---|
Item reference | Item reference string length |
Master item reference | Master item reference string length + string length of join-relational expression of the target join expression + 9 |
lookup_sum() function | lookup_sum argument string length + string length of join-relational expression of the target join expression + 13 |
lookup_count() function | lookup_count argument string length + string length of join-relational expression of the target join expression + 15 |
Each of the string lengths specifies the string length in UTF-8 encoding.
Refer to "2.7.1 Output Items" for details.
Sizes (examples) in output() in the following IF-THEN statement:
join("MASTER01", $message = $word)
output($ID, "MASTER01".$word, lookup_sum("MASTER01".$weight));
The calculation result is 93 bytes.
stringLengthOf"$ID"
+ (stringLengthOf""MASTER01".$word" + stringLengthOf"$message = $word" + 9)
+ (stringLengthOf""MASTER01".$weight" + stringLengthOf"$message = $word" + 13)
+ numberOfOutputItems - 1
= 3 + (16 + 16 + 9) + (18 + 16 + 13) + 3 - 1 = 93
Attaches an alias to items that are output.
For output expressions other than the last IF-THEN statement, a property alias must be specified.
The property alias can be used as property names of input events for next processing.
A property alias must be specified if the input event is in XML format (except for the last output expression within an ON statement).
If the input event is in CSV format, the following property aliases are generated automatically:
Property | Automatically generated property alias |
---|---|
Input event item | The input event item name is specified as is. |
Master data item | The name is generated by using a period (.) to join the master ID and the item name. |
Note
A property alias cannot be specified in the last output expression within an ON statement.
Restrictions apply to the characters that can be used in a property alias. Refer to "2.2.5 Item Names and Attribute Names" for details.
The same property alias cannot be used more than once in an output expression.
If the same item is output multiple times, each must have a different property alias attached.
If the input format is XML, a property alias must be specified unless it is the last output expression within an ON statement. If not specified, CEP engine startup fails.
If the same alias is defined more than once in an output expression, automatically generated aliases included, CEP engine startup fails.
Example
If "Mst1".$item1 is specified as the output item, the property alias is as follows:
Mst1.item1
Attaches an event type alias to the event to be output.
An event type alias must be specified in the output expression of the last IF-THEN statement.
Specify the development asset ID of the event type definition to be passed to the complex event processing.
Note
If an event type alias is specified other than in the last process in an ON statement, CEP engine startup fails.
If the extraction process is the only processing in an ON statement, the event type alias must be the same as the event type specified in the ON statement.
The event type alias in the last output expression of an ON statement must be registered as an event type definition.
If the output is in CSV format, the number of properties in that event type definition must match the number of items to be output. If they do not match, CEP engine startup fails.
Point
The output expression can be omitted if the input event is in CSV format and the IF-THEN statement is not the last IF-THEN statement.
If multiple master items in a join expression fulfill the join-relational expression conditions, multiple items are output separated by commas (,) and all items are enclosed between double quotation marks ("), as shown below. If a double quotation mark is included in the master item contents, another double quotation mark is attached before that double quotation mark.
IF-THEN statement:
join("MemberInfo", $group == $GroupID)
output("MemberInfo".$MemberID, "MemberInfo".$Name);
If $group joins the "GRP01" input event to the master data, the output results are as follows:
"""MEM0001"",""MEM0003""","""John"",""Diana"""
However, if the lookup_sum() function or the lookup_count() function is specified for the output item, items are output without being enclosed between double quotation marks (").