1

Is it possible to create Smart Rules either using the provided REST interface or c8y.core angular-module on a custom Cumulocity application. I am trying to create a Cumulocity application using the smart app toolkit in which the user should be able to configure thresholds for alarms and define whether an sms/e-mail notification should be activated for this alarm. These things can be done in the cockpit-applications smart rules-section.

severi
  • 97
  • 1
  • 6

2 Answers2

1

You can create and manage CEL rules from your own applications using this REST API: https://cumulocity.com/guides/reference/real-time-statements or this JavaScript API: http://resources.cumulocity.com/documentation/jssdk/latest/#/core/c8y.core.service:c8yCepModule.

There is currently no open API for Smart Rules, but you can get all functionality by using the above APIs (e.g., use SendSms or SendMail channels).

André
  • 668
  • 6
  • 11
1

The way SmartRules work is that they have a backed CEL with placeholders. The UI then creates a configuration managed object and replaces the placeholders in the CEL with the ID of this object. Afterwards the CEL gets deployed.

You can use a similar logic to realize something like a SmartRule.

TyrManuZ
  • 2,039
  • 1
  • 14
  • 23