webMethods.io Integration: create a Cumulocity IoT trigger
Tags: integration, iot, trigger, tutorial
Published: 2022-11-22 13:23:18

---
title: webMethods.io Integration: create a Cumulocity IoT trigger
published: true
date: 2022-10-06 15:02:24 UTC
tags: integration, iot, trigger, tutorial
canonical_url: https://tech.forums.softwareag.com/t/webmethods-io-integration-create-a-cumulocity-iot-trigger/264465
---
## Summary
This article describes the step-by-step process to create a Cumulocity IoT trigger in [webMethods.io](http://webmethods.io/) Integration.

## Prerequisites
* The user needs Cumulocity IoT credentials having admin permissions for "Application management".
* Working [webMethods.io ](http://webmethods.io/)Integration cloud tenant.
* The target Cumulocity IoT tenant must support the Notification 2.0 Enhancements (see [Cumulocity IoT Notification 2.0 Enhancements](https://tech.forums.softwareag.com/t/introducing-some-cumulocity-iot-notification-2-0-enhancements/264448) for more information on this Cumulocity IoT feature)

## Steps to follow  
### Creation of a new workflow with a Cumulocity IoT trigger

1. Login to [webMethods.io ](http://webmethods.io/)Integration tenant.
2. Create a new project or choose an existing project if required.
3. Click on the Workflows and the Integrations tabs and add a new Workflow.
![Workflow creation 1](https://aws1.discourse-cdn.com/techcommunity/original/3X/a/0/a0da2e15a8bd52f982d347e0b8a34981d38883fb.png)
![Workflow creation 2](https://aws1.discourse-cdn.com/techcommunity/original/3X/f/a/fa7b00fcd9a336c1442bc58254470ccb98cf8c16.png)
4. All workflows are named "Untitled workflow" by default and can be renamed within the editor
![Workflow name 1](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/b/2b6c4a938ff4be6d8f6b6c897de9c6497b014645.png) ![Workflow name 2](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/c/5cc4efdf4944e1e87d3ffe2278a5dc40543ec386.png)
5. Open the workflow's trigger settings, select the Cumulocity IoT trigger in the list and click on [Next]
![Trigger set-up 1](https://aws1.discourse-cdn.com/techcommunity/original/3X/a/b/ab8041adbd190bafa2c1189a92bdc608b8755789.png)
![Trigger set-up 2](https://aws1.discourse-cdn.com/techcommunity/original/3X/1/2/12effd8515529557f59548e88a53e85446f9fa29.png)
6. Provide a name for the trigger and select the type of Cumulocity IoT notification to be set
The trigger can be activated upon Cumulocity ioT Alarms, Events, Measurements or Inventory changes (changes to managed objects in Cumulocity IoT)
![Trigger name and type](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/a/ea292fed4e39dd616100b7aba4c696927ea6d354.png)
7. Create a new Account for the connection to Cumulocity IoT - see below - or select an existing one.
![Selection of Cumulocity IoT account](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/1/71d11db7aeddf4fbe97efe4ab1fe6669b298a5c2.png)
8. Configure the trigger by choosing the groups or devices to subscribe to.
See below for a detailed description of the parameters for Alarms, Events, Measurements and Inventory.
9. Optionally the incoming notifications can be filtered by type.
![Filtering by type](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/e/ee8256d8ce7a7de7dcaf74a9cebb6984665e26ea.png)
:information_source: All notifications sent by Cumulocity IoT contain a "`type`" property.
-> If any filter value is provided, Cumulocity IoT will only send notifications having this exact type.
-> If this field is left empty, no filter is applied and Cumulocity IoT will send all the notifications for the selected device or group.
:bulb: You can refer to the tooltip for examples of filter values.
10. A click on `[Save]` saves the trigger and moves on to the test window.
![Trigger test](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/b/bbf60a007214a1ddec3f714d6a8fdd20cb206861.png)
:information_source:  At this point the trigger is fully configured and listening to matching notifications from Cumulocity IoT for test purposes. 
In order to test the trigger, an action must first be performed in Cumulocity IoT and then a click on `[Test]` will display the incoming notification message.
![Test successful: message received from Cumulocity IoT](https://aws1.discourse-cdn.com/techcommunity/original/3X/6/a/6a44c4d657957715085c53f5ccc43f533faf7eb7.png)
:warning: If no notification has been received, the following window indicating possible reasons is shown.
The trigger configuration can then either be corrected or another test be performed.
![Test failed](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/7/e7b6f07161101631c3507f40dfc1759dc0c228a8.png)
A click on `[Skip]` does not consider any incoming notification from Cumulocity IoT and displays a predefined message. The Cumulocity IoT trigger provides realistic default messages for alarms, events, measurements and inventory changes.
![Predefined Alarm message](https://aws1.discourse-cdn.com/techcommunity/original/3X/a/9/a927ea64fcf8aec93305f9c9a442994d29acae92.png)
11. Optionally rules may be applied to filter the incoming Cumulocity IoT messages.
With the application of filter rules, the trigger is only activated for matching incoming messages. This can be used for instance to activate an Alarm trigger only on alarm messages with a given severity level.
![Access filter rules](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/d/bd4abad609de7f0fcdcf41e6b14654f2cb56c82b.png)
![Example filter on alarm severity](https://aws1.discourse-cdn.com/techcommunity/original/3X/3/b/3b186c14142ff1f84657a9928e60cdb71f56835b.png)


### Creation of the connection to Cumulocity IoT
For [webMethods.io](http://webmethods.io/) to access Cumulocity IoT resources, an Account has to be created with the Cumulocity IoT credentials.
Note that the Cumulocity IoT Accounts in [webMethods.io](http://webmethods.io/) Integration are shared between Cumulocity IoT triggers and connectors.

![New Cumulocity IoT account](https://aws1.discourse-cdn.com/techcommunity/original/3X/6/0/6039306a707f6e23d17a51bf787653510ff43018.png)

For Cumulocity IoT Accounts, only the properties below are taken into account. All other properties are ignored and their default value can be left unchanged.
* **Account Name**: This is the name that will be displayed in the list of Cumulocity IoT connections in both trigger and connector settings.
* **Server URL**: This is the URL of the target Cumulocity IoT instance. 
 :information_source: Only the root path is to be provided (like `https://mytenant.cumulocity.com` for instance) with no "`/`" at the end.
* **Username** / **Password**: Credentials of the Cumulocity account to be used.
 Note that these credentials require admin permissions for "Application management".
* **Cumulocity Application Name**: This is the name of an internal Cumulocity IoT micro application that will be created / reused for data access. Unless there is any specific usage requirement, the default name "`wmio-connector-app`" can be used.

> :information_source: Cumulocity Application Name and the account credentials:
> the Cumulocity IoT triggers and connectors in [webMethods.io](http://webmethods.io/) Integration do not access Cumulocity IoT with the provided account credentials at run time.
> Instead of this, upon creation of a new Cumulocity IoT Account:
> 1. the credentials are used to create / reuse the microservice application in Cumulocity IoT with the provided Application Name - hence the required admin permissions for "Application management".
> 2. The microservice application is granted the required rights for the subscription to Cumulocity IoT notifications.
> 3. A "Service User" for the microservice application is kept [u]internally in [webMethods.io](http://webmethods.io/) and is not visible by anyone[/u].
> This Service User is then used by [webMethods.io](http://webmethods.io/) to access Cumulocity IoT during the execution of the workflows.
>  In turn, this means that the user credentials used to create the account can be modified or deleted without any impact on the execution of the workflows

After the successful creation of the Cumulocitiy IoT Account, the new Account is available for selection in the trigger settings.
![Selection of Cumulocity IoT account](https://aws1.discourse-cdn.com/techcommunity/original/3X/9/0/903a8472115c100ad1193d3b1aa2af45659e6093.png)


### Parameters for Cumulocity IoT Alarms
The Cumulocity IoT trigger allows to subscribe to alarms for various objects:
* `All Devices`: any alarm occurring on the target Cumulociity IoT instance with activate the trigger
* `Specific Device`: only alarms applying to the given device or managed object will activate the trigger
* `Specific Group`: alarms applying to any device belonging to the provided group will activate the trigger

![Selection of object type](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/3/e3bf668c787769b886a730aa716122b8bac7d91f.png)

1. When selecting `All Devices`, no further parameter is needed.
The trigger will be activated for any alarm occurring in Cumulocity IoT.
2. When selecting `Specific Device`, the identifier of a managed object must be provided.
It is possible to either select one of the devices from the dropdown list or to manually enter its identifier.
If an identifier is entered manually, *any identifier of an existing managed object is allowed, no matter if it's a device or not*. Any alarm attached to the provided managed object will activate the trigger.
![Device selection](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/2/e20c67846eceafad49724e5ffca25c5cfa9a87f9.png)
3. When selecting `Specific Group`, the identifier of a group must be provided.
It is possible to either select one of the groups from the dropdown list or to manually enter its identifier.
Even if an identifier is entered manually, the corresponding group must exist in Cumulocity IoT
![Group selection](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/2/720f73b0330c035ddad62530db849e033ce0f367.png)


### Parameters for Cumulocity IoT Events
The Cumulocity IoT trigger allows to subscribe to events for various objects:
* `Specific Device`: only events applying to the given device or managed object will activate the trigger
* `Specific Group`: events applying to any device belonging to the provided group will activate the trigger

![Selection of object type](https://aws1.discourse-cdn.com/techcommunity/original/3X/0/a/0ab7abf42ae8e85964524d44cc3700bd06480ff8.png)

1. When selecting `Specific Device`, the identifier of a managed object must be provided.
It is possible to either select one of the devices from the dropdown list or to manually enter its identifier.
If an identifier is entered manually, *any identifier of an existing managed object is allowed, no matter if it's a device or not*. Any event attached to the provided managed object will activate the trigger.
![Device selection](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/b/2b78b934bfb59483f12044dbf4f0fb521008e253.png)
2. When selecting `Specific Group`, the identifier of a group must be provided.
It is possible to either select one of the groups from the dropdown list or to manually enter its identifier.
Even if an identifier is entered manually, the corresponding group must exist in Cumulocity IoT
![Group selection](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/d/bdedd1ba941d63999e442edc5f29571441754138.png)


### Parameters for Cumulocity IoT Measurements
The Cumulocity IoT trigger allows to subscribe to measurements for specific devices or managed objects.

The identifier of a managed object must be provided either by selecting one of the devices from the dropdown list or to manually enter its identifier.
If an identifier is entered manually, *any identifier of an existing managed object is allowed, no matter if it's a device or not*. Any measurement attached to the provided managed object will activate the trigger.
![Device selection](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/8/78b57cda7ad244faf64e2b2af2f72dd14cd8b1f2.png)


### Parameters for Cumulocity IoT Inventory Changes
The Cumulocity IoT trigger allows to subscribe to inventory changes for various objects:
* `All Devices`: any inventory change occurring on the target Cumulociity IoT instance with activate the trigger
* `Specific Device`: only changes to the given device or managed object will activate the trigger
* `Specific Group`: changes to any device belonging to the provided group will activate the trigger

![Selection of object type](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/0/70b24ff355d217202d379ef03f2e75d1e938bf73.png)

1. When selecting `All Devices`, no further parameter is needed.
The trigger will be activated for any change to the inventory of managed objects occurring in Cumulocity IoT.
2. When selecting `Specific Device`, the identifier of a managed object must be provided.
It is possible to either select one of the devices from the dropdown list or to manually enter its identifier.
If an identifier is entered manually, *any identifier of an existing managed object is allowed, no matter if it's a device or not*. Any change to the provided managed object will activate the trigger.
![Device selection](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/2/524fc96c23c5043401d61c44f477011f15f200f5.png)
3. When selecting `Specific Group`, the identifier of a group must be provided.
It is possible to either select one of the groups from the dropdown list or to manually enter its identifier.
Even if an identifier is entered manually, the corresponding group must exist in Cumulocity IoT
![Group selection](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/2/720f73b0330c035ddad62530db849e033ce0f367.png)

[Read full topic](https://tech.forums.softwareag.com/t/webmethods-io-integration-create-a-cumulocity-iot-trigger/264465)