Streaming Analytics


This release upgrades the Apama-ctrl microservice to use Apama (which is the same as Apama 10.15 Fix 17).


Component Description Issue
Analytics Builder When creating a Digital Twin Manager asset via the API without specifying the icon property, the default icon is now shown for the asset. This ensures proper listing in the dialog which is shown when you select an input source or output destination; previously the asset would not be shown if the icon property was unspecified. PAB-4311


This release upgrades the Apama-ctrl microservice to use Apama (which is the same as Apama 10.15 Fix 14).


Component Description Issue
Apama-ctrl microservice When subscribed to a tenant without the core Smartrule microservice subscribed, Apama-ctrl's logging about this problem would be excessively verbose. Though this is not a recommended configuration for a tenant, Apama-ctrl's logging is now more moderate in this situation. PAB-4228
Apama runtime The Cumulocity IoT Java SDK has been upgraded to v1015.0.456 to fix an issue where subscriptions for real-time notifications were lost when switching between Cumulocity IoT core nodes. PAM-34476
Apama runtime More information has been added to Cumulocity IoT long-running query messages, as well as for distinguishing between queries and batches. PAM-34326


In this release, the Apama-ctrl microservice uses the same Apama version as in the previous release.


Component Description Issue
Analytics Builder and EPL Apps The final translations for the supported languages have been added. PAB-4049


This release upgrades the Apama-ctrl microservice to use Apama (which is the same as Apama 10.15 Fix 12).


Component Description Issue
Analytics Builder The Expression block now calculates the remainder of integer division, as already documented. Previously, this functionality was not implemented and raised a runtime error if defined. PAB-4110
Analytics Builder The usability of the multi-line text area has been improved. It now automatically expands as you type. You no longer have to press Enter to start a new line. PAB-4075
Analytics Builder A regression in throws an error on adding an Analytics Builder block in the model editor that derives its label from an input parameter (for example, an Alarm Input block that derives its label from the Alarm Type parameter). This has now been fixed. PAB-4081
Analytics Builder Block SDK Fixed an issue with the test framework of the Analytics Builder Block SDK throwing a UnicodeDecodeError exception. PAB-4084
Apama runtime The version of Woodstox-core has been upgraded from 6.3.0 to 6.5.0. PAM-34355
Apama runtime The version of Java included in the Docker images has been updated to 11.0.19 to resolve security issues. PAM-34361

Release 10.18.0

Cumulocity IoT release 10.17.0 already includes Streaming Analytics release 10.18.0.

Apama correlator version

This release of Cumulocity IoT Streaming Analytics includes the Apama version 10.15.3 correlator. EPL apps developers should also refer to What’s New In Apama 10.15.3 in the Apama documentation.

Microservice SDK and Web SDK

Streaming Analytics has been upgraded to use build version of the Microservice SDK and Web SDK.

Restructured Streaming Analytics guide

The Analytics Builder documentation, which is available as a separate webhelp until release 10.16, has been moved to the Streaming Analytics guide. The Streaming Analytics guide has been restructured to reflect this change. Analytics Builder developers can now search and reference the Analytics Builder documentation within the Cumulocity IoT documentation. This makes it easier for new users to get started and for advanced users to use a single documentation interface.

Note that the path to the Streaming Analytics guide has changed. The apama folder has been removed and the guide is now located in the new streaming-analytics folder. If you have bookmarks to the Streaming Analytics guide, you have to update them.

As of Cumulocity IoT release 10.17, the Analytics Builder documentation is no longer provided as a separate webhelp.

New multi-tenancy microservice

The new Apama-ctrl-mt-4c-16g microservice supports multi-tenancy, but has limitations in this version. Currently, it only supports EPL apps and smart rules and does not support Analytics Builder. Furthermore, EPL apps are only enabled on the Management and Enterprise tenants that own the microservice, but disabled on the subtenants. See also Microservice runtime and applications in the Streaming Analytics guide.

Improvements in alarms generated by the Apama-ctrl microservice

The following improvements are available in this release:

New EPL library

A new EPL library has been added to support programming in a functional style for quicker development, fewer for loops, and more concise and readable code. For example:

// Calculate the average of the values in the sequence = 20
Fn.reduce([10, 20, 30], Fn.mean());

// Filter strings by regular expression using the string.matches action = ["Hello Alice", "Hello Al"]
Fn.filter(["Hello Alice", "Hello Bob", "Hello Al"], Fn.callAction("matches", ["Hello Al.*"]));
// Use Functional() to chain multiple operations: filter out odd numbers, then reduce the sequence to a single value containing the sum = 70
Functional([10, -5, 20, 40]).filter(Fn.even).reduce(Fn.sum);

The library provides similar capabilities to Python’s functools module. It can be added to Apama projects with a new Functional EPL Library bundle which provides two main EPL types: com.apama.functional.Fn and com.apama.functional.Functional. These provide functional operations such as map, filter and reduce in both a functional style and a fluent style. They operate on EPL sequence and dictionary containers and on a new “generator” concept that lazily calculates infinite lists.

There is support for partial binding of action arguments:["Bob", "Alice"], Fn.partial(Fn.concat, "Hello ")).toString(); // = ["Hello Bob","Hello Alice"]

There are also some new actions to make event sending and listening more concise, including the following:

// Initialize an event (providing only the subset of fields you care about), send and extract the request id for use in listener
// (it is also possible to initialize event fields by name rather than by position)
on MyResponse(reqId=<integer> Fn.sendToChannel(MyEvent.SEND_CHANNEL,
        Fn.setFields(new MyEvent, [<any>createRequestId(), "/myrequest"])
        ).getEntry("reqId") ) as response

// Listen for events with an identifier matching each value from this sequence, and calls a completion action when all have arrived
// (similar to an EPL "and" event expression). A different callback is executed if the specified timeout expires.
                 .waitForAllCompleted("MyResponse", "id", onCompleted)
                 .onTimeout(TIMEOUTSECS, onTimeout);

For detailed information, see Using Functional Operations in EPL in the Apama documentation. See also the API Reference for EPL (ApamaDoc) for detailed information on com.apama.functional.

EPL improvement for the time zone

The at() event operator in EPL for listeners can now be provided with a time zone as an optional final argument. This can be in string form or (recommended) one of the new constants in the TimeZone namespace. For more details, see Triggering event listeners at specific times in the Apama documentation and the TimeZone namespace in the API Reference for EPL (ApamaDoc). The new constants can also be used with the TimeFormat event library.

New EPL sample

A new EPL sample named “Create an alarm if a measurement exceeds a threshold value (multi-tenant)” can now be accessed from the EPL editor of the Streaming Analytics application. It shows how to write an EPL app which can be executed in a multi-tenant microservice on the parent tenant. See also Developing apps with the Streaming Analytics application in the Streaming Analytics guide.

For more detailed information, see Working with multi-tenant deployments in the Apama documentation.

Improvements in Analytics Builder

The Cron Timer block now has a Time Zone parameter to customize which time zone this block is relative to.

The Alarm Output block no longer reactivates “Acknowledged” alarms with every modification. By default, acknowledged alarms are now only reactivated if the severity has increased. This also ensures that the alarm count is updated correctly. To always activate alarms triggered by the model, select the new Always Activate Alarm parameter in the Alarm Output block.

Synchronous output blocks are now allowed to have more than one output block which generates events with any given key (the key is made up of multiple block parameters). This applies to the following blocks: Alarm Output, Event Output, and Measurement Output. See also Analytics Builder > Wires and blocks > Keys for identifying a series of events in the Streaming Analytics guide.

In the Choose Device, Group or Asset dialog box, you can now choose whether you want to receive input data from the child devices of an asset or from the asset itself. Note that a model cannot receive input from both an asset and an asset’s child devices; the model must receive from either an asset itself or its child devices. If you have custom input blocks, they may need to be updated to support receiving from the assets themselves, instead of from their child devices. For detailed information, see Update Cumulocity IoT input blocks to receive from assets in the Analytics Builder Block SDK documentation.

For the output blocks, it is now possible to set a template parameter to a trigger device. For this purpose, the type that you can select in the Template Parameters dialog box has been renamed to Device, Group, Asset or Trigger Device. Note that in the instance editor it is invalid to use a template parameter that has been defined for an input block as a trigger device. When a model uses a trigger device as an input, a runtime error will occur indicating that the validation has failed.

In previous versions, it was not possible to select a trigger device as the value of a template parameter, and you had to select a device group instead. Starting from this version, it is possible to select a trigger device as the value of a template parameter. Selecting a trigger device or a device group has the same effect in this version. However, selecting a device group will be deprecated in a future version. So if you have template parameters that currently use a device group and that are used as the output destination of an output block, you should change them now to use the trigger device.

In previous versions, the palette of the model editor showed the names of the devices and device groups that are registered in the Cumulocity IoT inventory and you had to select the block type in the block parameter editor. As of this version, these names are no longer shown in the palette. Instead, the palette now shows the input and output blocks by type. For example, the Input category now shows an input block named Alarm Input and the Output category now shows an output block named Event Output. You drag an input or output block onto the canvas and then select the input source or output destination from the block parameter editor. It is no longer possible to change the block type in the block parameter editor.

For the input blocks, it is now possible to select a smart group as the input source. See also Editing the parameters of a block in the Streaming Analytics guide. A smart group is a special group in Cumulocity IoT which is dynamically constructed based on filtering criteria. For more information, see Using smart groups in the User guide.

For the input and output blocks, it is now possible to select an asset as the input source or output destination. See also Editing the parameters of a block in the Streaming Analytics guide. Assets represent business objects in general like buildings, machines, production units or cars. For more information, see Managing assets in the User guide.

The following blocks now support multi-line input for certain parameters, which means that your input is now automatically wrapped in the text box and that you can now also press Enter to start text on a new line:

This is also reflected in the Template Parameters dialog box, where you can now select Multi-line String as the type for the parameters listed above. See also Managing template parameters in the Streaming Analytics guide.

When you move the mouse pointer over the input or output port of a block, the description of this port is now displayed in the tooltip in addition to the port name.

The Latest Updated mode of the Combiner block, which has been added in release 10.16.0, has been renamed to Latest Input. This was done so that you can better distinguish it from the Latest Changed mode.

First-time activation of Analytics Builder

In some circumstances, Analytics Builder must be activated by the user before it is used for the first time. If you see the Activate button for Analytics Builder on the home screen of the Streaming Analytics application, clicking this will start the process. This process may take a few minutes.


Component Description Issue
Analytics Builder The Latch Values block did not start disabled when the Enable input port was connected, which meant that it generated a pulse signal on the Disabled output port on the first false Value input, which it should not. This has now been fixed. The Enabled output port of the Latch Values block generates a pulse signal when the block is enabled but was previously disabled. Likewise, the Disabled output port of the Latch Values block generates a pulse signal when the block is disabled but was previously enabled. PAB-3441