Overview

Advanced Rules (powered by Apama)

Using Advanced Rules (powered by Apama), you can add your own logic to your IoT solution for immediate processing of incoming data from devices or other data sources. These user-defined operations can, for example, alert applications of new incoming data, create new operations based on the received data (such as sending an alarm when a threshold for a sensor is exceeded), or trigger operations on devices.

The operation logic is based on Apama Event Processing Language (Apama EPL).

Important: Support for streaming analytics using CEL (Esper) is deprecated. All new Cloud of Things subscriptions use the Apama CEP engine. While using the Esper CEP engine is currently still available, this will no longer be provided for new subscriptions and will not be invested into in the future.

For details on migration, see Migrating from CEL (Esper) to Apama.

Typical real-time analytics use cases include:

The following sections describe the basics for understanding how Apama EPL works and how you can create your own analytics or other server-side business logic and automation.

Home screen

You access the Advanced Rules application using the application switcher.

Advanced Rules home screen

The home screen of the Advanced Rules application lets you navigate to the different pages of the application. These are Analytics Builder and EPL Apps. You can access these pages using the corresponding Open button on the home screen or by using the navigator on the left.

If you need more space for a page, you can hide the navigator. Click the small arrow at the very left of the top bar to toggle the display of the navigator.

The home screen also provides information on smart rules. You create and maintain them with the Cockpit application. See Cockpit > Smart rules in the User guide for detailed information.

The home screen and navigator only show entries for the items that you are allowed to use, depending on the version of the Apama-ctrl microservice to which your tenant is subscribed. See also Microservice runtime and applications and Customizing the home screen of the Advanced Rules application.

Analytics Builder

Analytics Builder is a web application which is available from the application switcher. It allows you to build analytic models that transform or analyze streaming data in order to generate new data or output events. The models are capable of processing data in real time.

You build the models in a graphical environment by combining pre-built blocks into models. The blocks in a model package up small bits of logic, and have a number of inputs, outputs and parameters. Each block implements a specific piece of functionality, such as receiving data from a sensor, performing a calculation, detecting a condition, or generating an output signal. You define the configuration of the blocks and connect the blocks using wires. You can edit the models, simulate deployment with historic data, or run them against live systems.

See the documentation for Analytics Builder for detailed information.

EPL Apps

The EPL Apps page of the Advanced Rules application allows you to develop EPL apps (that is, single *.mon files) directly within Cloud of Things, written in Apama EPL. You can also import existing *.mon files as EPL apps into Cloud of Things. When you activate an EPL app from the Advanced Rules application, you deploy it to Cloud of Things.

A quick way to get started is to explore the code of the EPL samples that can be accessed from the EPL editor. See Developing apps with the Advanced Rules application for information on how to create an EPL app and access the samples. For a start, use one of the simpler samples with temperature measurements, such as “Create an alarm if a measurement exceeds a threshold value”. You can immediately see results using this sample. Add your own EPL code to the sample and try out your changes.

You use the Apama API for interacting with Cloud of Things. For detailed information, see the com.apama.cumulocity package in the API Reference for EPL (ApamaDoc), which is part of the Apama documentation.

Microservice runtime and applications

Analytic models, EPL apps and smart rules are executed in an Apama-ctrl microservice. This has a per-tenant isolation scope, that is, each subscribed tenant has its own instance of an Apama container with dedicated resources (that is, memory and CPU usage). The container is isolated from other tenants, hence high CPU load or memory issues on other containers are tracked and resourced independently.

To do this you need the following
Build analytic models Apama-ctrl microservice and Advanced Rules application
Develop EPL apps Apama-ctrl microservice and Advanced Rules application
Use smart rules Apama-ctrl microservice and Smartrule microservice (included in Cloud of Things’s Standard tenant)

See also the following sections in the User guide:

If your tenant is subscribed to the Apama-ctrl-starter microservice, then the following applies:

If your tenant is subscribed to the Apama-ctrl-smartrules or Apama-ctrl-smartrulesmt microservice, the Analytics Builder and EPL Apps pages are not available in the Advanced Rules application.

Contact product support to discuss adding more capabilities.