Skip to content

GEN EXPRESS

Description

The GEN EXPRESS processor is designed to execute general expressions, typically written in Groovy script, on data points. This processor is versatile and can be used to perform a wide range of operations on data, including arithmetic calculations, data manipulation, and more. It supports all data types, including BLOBs, making it highly adaptable for various data processing needs.


Config Location

To configure the GEN EXPRESS processor, you need to define it within the consDPProcessors section of your data point configuration within the schema. This involves specifying the processor name and entity.


Supported Data Types

  • String
  • Double
  • Decimal
  • Integer
  • Json
  • BLOB
  • Boolean

The GEN EXPRESS processor is designed to work with all data types, including BLOBs and Boolean, providing flexibility in how data can be processed and manipulated.


Config Requirements

Config ({}) options are required for the GEN EXPRESS processor. If no configuration is provided or if the configuration is improperly set up, a block violation will be thrown. For more information on Apiro violations and their appearance in the Apiro UI or logs, refer to the violations section.


Example Config

Below is an example of how to configure the GEN EXPRESS processor in XML format to add 50 to the current value of the "QUANTITY" data point:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<dataPoint name="QUANTITY" dataType="INTEGER">
    <consDPProcessors>
        <consDPProcessor name="PLUS_50" entity="GEN_EXPRESS">
            <config>
                <![CDATA[
                    #GRV{
                        CTX['.'] = CTX['.'] + 50
                    }
                ]]>
            </config>
        </consDPProcessor>
    </consDPProcessors>
</dataPoint>

Example Result

Upon successful configuration and execution, the GEN EXPRESS processor will execute the specified Groovy script on the "QUANTITY" data point, adding 50 to its current value.


Config Parameters

name acceptable values comment
NA. A Groovy script that defines the operation to be performed on the data point. The script can include arithmetic operations, data manipulation, and more.

Common Mistakes

  • Ensure that the processor name and entity are correctly defined in the configuration to ensure that the processor is correctly identified and applied during the data processing pipeline.
  • Verify that the Groovy script within the <config> tag is correctly written and performs the intended operation on the data point.
  • Remember that the configuration for the GEN EXPRESS processor is required. If no configuration, or improper configuration is provided then a block violation will be thrown.