Data Manipulation

In esp_client, the eval command allows the debugging interface to change data within the Event Stream Processor. The contents of global and stream local variables (including event-Cache) can be changed using this functionality.

Data manipulation functionality works only when the Event Stream Processor is in trace mode and paused.

The eval command changes data by evaluating a SPLASH statement (or block) in the stream. Only the variables are visible, not the streams or stream iterators. Any SPLASH statements are permissible, including branching and loops, but writing an infinite loop indefinitely stops the Event Stream Processor. Temporary variables are also permissible inside the SPLASH block.

In most situations the key of the eventCache is determined by the current input record. There is no input record, so the key is not set and any operations on eventCaches have no effect. This requires the key to be set manually using the operator keyCache(ec-variable, record). Ensure that you set this operator before performing any operations on eventCache. You may change the key more than once, even in a loop, allowing you to perform operations on multiple keys.

You may only modify the stream's local variables (those defined in the local DECLARE block) and global variables with the eval command. Variables defined inside the SPLASH blocks of a stream exist only when the appropriate methods are run. These variables cannot be modified.

If it is possible to evaluate a unit of code, then it is not an expression but a SPLASH statement. A SPLASH statement must either be a simple statement terminated by ";" or a block enclosed in braces "{}". Multiple statements must always be enclosed in a block. If braces are used to quote the block argument, the outside quotes do not function as the block delimiters: they are just esp_client quotation marks.

The following are examples of correct and incorrect blocking:

Correct Blocking

eval `stream` `a := 1;`

eval {a := 1;}

eval `stream` `{ typeof(input) r := [ a=9; | b= 's1'; c=1.; d=intDate(0);];
		keyCache(s0, r); insertCache(s0, r); }`

eval {stream} {{ typeof(input) r := [ a=9; | b= 's1'; c=1.; d=intDate(0);];
		keyCache(s0, r); insertCache(s0, r); }}

Incorrect Blocking

eval `stream` `a := 1`

eval {a := 1}

eval `stream` `typeof(input) r := [ a=9; | b= 's1'; c=1.; d=intDate(0);];
		keyCache(s0, r); insertCache(s0, r);`

eval {stream} { typeof(input) r := [ a=9; | b= 's1'; c=1.; d=intDate(0);];
		keyCache(s0, r); insertCache(s0, r); }