Performs a mapping of incoming attributes to out-coming attributes using map functions. Odysseus also provides a wide range of mapping functions.

Hint: StateMap can use history information. To access the last n.th version of an attribute use "__last_n." Mind the two "_" at the beginning!

Parameter

  • expressions: A list of expressions to map multiple incoming attribute values to out-coming attributes. Optional each expression can have a name (in this case use ['expression', 'expressionName'])
  • allowNullInOutput: Statemap will by default not create an output, if one of the attribute values is null. In the default case, elements will be created when all history elements are read and all other output is removed: out = STATEMAP({EXPRESSIONS = ['__last_1.id','__last_2.id','__last_3.id','id'], ALLOWNULLINOUTPUT = true}, nexmark:person) will wait until the fourth element is read. Set this parameter to true to create output for every incomming element.
  • group_by: An optional list of attributes over which the grouping should occur.

Example

Example
output = STATEMAP({
              expressions = ['auction_id * 5','sqrt(auction_id)', '__last_5.auction_id]
             }, input)

 

 
  • No labels