DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Data Engineering
  3. Big Data
  4. A Guide to Rules Engines for IoT: Condition-Action Engines

A Guide to Rules Engines for IoT: Condition-Action Engines

What is a Condition-Action engine? And what does that look like when applied to IoT?

Veselin Pizurica user avatar by
Veselin Pizurica
·
May. 23, 19 · Presentation
Like (6)
Save
Tweet
Share
20.25K Views

Join the DZone community and get the full member experience.

Join For Free




What Are Condition-Action Engines?

Condition-Action-based (CA) rules engines belong to the group of Forward Chaining engines; however, there are some relevant differences, especially in the context of the IoT domain. As opposed to forward chaining engines, Condition-Action rules engines don’t allow multiple conditions, which makes them, on one hand, very limited in their logic expression capabilities and, on the other hand, much more scalable. Condition-Action rules engines (if this, then that) are sometimes extended with the ELSE statement (if this, then that — else, that).

One of the most popular examples of this type of rules engine for the IoT domain is the ifttt.com service.

Can You Build Complex Logic With Condition-Action Engines?

No, unlike forward chaining engines, CA engines cannot model any complex logic (such as combining multiple non-binary outcomes, majority voting, or conditional executions). They are meant to be used only for very simple use cases.

Can Condition-Action Engines Model the Time Dimension?

One way these engines work around the time dimension problem is that they often rely on external triggers for determining which rule to execute. That is to say, the IF condition of a rule becomes the WHEN condition (e.g. when weather is bad, send an alarm; when I come home, turn on the lights). This is often referred to as a trigger in these tools, and even though we may argue that this is not something that is part of the rules engine per se (because it needs to be coded somewhere else), it is still obvious how the time dimension could to be introduced into the rules engine.

Are Condition-Action Engines Explainable?

Just like forward chaining engines, CA engines like IFTTT provide us with an easy way of designing rules for simple problems. There is nothing easier to grasp than if-this-then-that rules!

Are Condition-Action Engines Adaptable?

Yes, Condition-Action engines are both flexible and extensible. Adding third-party API services, for example, is rather simple, as the API extensions require minimal abstractions (the 'if' and 'act' part). However, due to the nature of CA engines, there are limitations with regard to the usage of API services within rules.

Most of the times, CA engines use API services as triggered actions, not as inputs, as there is a single conditional input slot available, which in IoT use cases, is usually taken by the device data. A typical example would be, for instance, to call an external API service (SMS, email, support ticket, etc.) if a device temperature registers above 25.

When CA engines model the data of an API service as an input (what the ifttt.com CA engine, for example, calls a trigger, e.g. “if it is going to rain”), then we cannot combine this API service input with device data, as the single input slot is taken, and we can only use the device in this case as the actuator (e.g. “turn on lights”).

Are Condition-Action Engines Easy to Operate?

Applying the same rule across many devices, for example, is possible as long as thresholds and all the other conditions do not change. Templating, versioning, and searchability are rather easy to achieve with such rules engines but bulk upgrades are more difficult, as conditions and thresholds are often global variables and hard to change per instance of the running rule.

Are Condition-Action Engines Scalable?

CA rules are stateless and very simple, so it is very easy to scale these rules engines. However, they do not get the maximum score for this category, as scalability is truly achieved by only one rules engine category, namely the stream processing engines.

This is an excerpt from our latest Benchmark Report on Rules Engines used in the IoT domain. You can have a look at a summary of the results or download the full report over here.

Engine IoT

Published at DZone with permission of Veselin Pizurica, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ClickHouse: A Blazingly Fast DBMS With Full SQL Join Support
  • Introduction to NoSQL Database
  • How To Perform Local Website Testing Using Selenium And Java
  • Beyond Coding: The 5 Must-Have Skills to Have If You Want to Become a Senior Programmer

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: