stroom-expression

Library of functions as used in Stroom dashboards

License

License

GroupId

GroupId

uk.gov.gchq.stroom.expression
ArtifactId

ArtifactId

stroom-expression
Last Version

Last Version

1.5.15
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

stroom-expression
Library of functions as used in Stroom dashboards
Project URL

Project URL

https://github.com/gchq/stroom-expression
Source Code Management

Source Code Management

https://github.com/gchq/stroom-expression

Download stroom-expression

Dependencies

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25

Project Modules

There are no modules declared in this project.

stroom-expression

Build Status

This library provides Stroom with the functions for manipulating data on Stroom Dashboards.

See the full documentation for all functions here.

Internally an expression function will create a generator to produce values for a cell based on the expression definition. Each generator is supplied with an array of values for the row it belongs to (multiple sets of array values if a row is an aggregated grouping of multiple rows).

The arguments to functions can either be other functions, literal values, or they can refer to fields on the input data using the ${} syntax.

A FieldIndexMap is used to map named fields to the index of the appropriate value within the supplied row value array.

Example:

FieldIndexMap fim = FieldIndexMap.forFields("name", "age", "occupation")
Generator g = parseExpression("concat(${name}, ${age})")

g.addData("JDoe", 45, "Butcher")

g.eval
> JDoe45

Example showing multiple values supplied to generator due to some external grouping:

FieldIndexMap fim = FieldIndexMap.forFields("name", "age", "occupation")
Generator g = parseExpression("count()")

g.addData("JDoe", 45, "Butcher")
g.addData("JBloggs", 23, "Butcher")
g.addData("JSmith", 34, "Butcher")
g.addData("JSmith", 24, "Butcher")

g.eval
> 4

Example showing multiple values supplied to generator due to some external grouping:

FieldIndexMap fim = FieldIndexMap.forFields("name", "age", "occupation")
Generator g = parseExpression("countUnique(${name})")

g.addData("JDoe", 45, "Butcher")
g.addData("JBloggs", 23, "Butcher")
g.addData("JSmith", 34, "Butcher")
g.addData("JSmith", 24, "Butcher")

g.eval
> 3
uk.gov.gchq.stroom.expression

GCHQ

Versions

Version
1.5.15
v1.5.14
v1.5.13
v0.0.1-test-deployment