cancel
Showing results for 
Search instead for 
Did you mean: 

Rise a notification on incoming IoT message.

Former Member
0 Kudos

Hi experts

We are currently evaluating the SAP HANA Cloud (SHC) platform for IoT integration. We are now able to send data from the IoT device to SHC and we see the received messages in a database table. It is clear for us so far.

Now we want to implement a notification (e.g. send an e-mail or an SMS) when a new defined message type or content is written to the database. Here is not clear what we have to implement and which SHC services will be involved.

Can anyone shortly explain the architecture of some application?

Thanks in advance!

QIAiot

Accepted Solutions (1)

Accepted Solutions (1)

anton_levin
Advisor
Advisor
0 Kudos

Hello Qiagen,

for example, with the Processing API you may register a HTTP processing service. See more at [1] Then either forward a complete message or just a notification that the message has arrived to the respective/configured HTTP endpoint (backend) which will trigger an E-Mail or SMS send.

Regards,

Anton

[1] SAP HANA Cloud Platform Internet of Things (IoT) Services

Former Member
0 Kudos

Hi Anton

Thanks for your hint! This seems to be a straightforward way to implement it.

What about when I need more logic in the application. Is it possible to implement a service running on the server and permanently pooling the database to trigger an action when a corresponding message is committed?

For example:

  1. IoT send => status changed: door open
  2. HCP check the DB and see the status change
  3. HCP query a DB to get a list of users to notify
  4. HCP send an e-mail notification to each user

What will be the approach in this case?

Cheers

QIAiot

anton_levin
Advisor
Advisor
0 Kudos

If I understood your requirements right, you may even skip step 2 with the HTTP processing service approach.

So, what you have is (correct me if I am wrong):

  • A device type (let's call it HOUSE_EQUIPMENT)
  • A device (DOOR)
  • A message type (DOOR_STATUS)
  • Registered [1] two processing mappings (SQL [2] and HTTP [3]) for your device type / message type pair
  • SQL processing service will persist your messages to DB (like usually is done by MMS)
  • HTTP will forward a complete message (that is why I told you can skip step 2) to your "backend". (If you just send "notify" mode then of course you 'd need to get the messages from MMS to see the last status).
  • Once your "backend" receives a forwarded message from MMS, you check for the status (it is right in the message body, no need to query the DB)
  • Depend on a status value you query the respective users (from some other table etc)
  • You send e-mail to them

[1] SAP HANA Cloud Platform Internet of Things (IoT) Services

[2] SAP HANA Cloud Platform Internet of Things (IoT) Services

[3] SAP HANA Cloud Platform Internet of Things (IoT) Services

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Qiagen,

Did you manage to achieve this? I am also working on something similar, In my case once i get the data in MMS, I want to send it to SAP Backend. could you please help me how to achieve this.

Thanks

anton_levin
Advisor
Advisor
0 Kudos

Alternatively, if you have HANA XS DB System bound to MMS, you might want to use HANA XS Triggers [1] and call your procedure before or after INSERT "event" to the DB table i.e T_IOT_<YOUR_MESSAGE_TYPE_ID>

This is not that straightforward as the solution proposed above, of course.

[1] CREATE TRIGGER - SAP HANA SQL and System Views Reference - SAP Library

You can find more "XS Trigger" related examples either on SCN or simply with google search.