Skip to Content
Product Information
Author's profile photo Satyendra Dhar

User defined events in the SAP WebIDE template-IoT Freestyle App

SAP Leonardo IoT offers two WebIDE templates for rapid custom IoT application development: the “IoT Application template” and “Freestyle IoT Application Template”. In these templates there exist an event lists and for Maps on the ThingCards an Event Aggregation that are linked to the IoT Standard Events.

The Standard Events are limited in the ability to customize their usage; therefore, SAP Leonardo IoT also offers User-defined Events. User-defined Events enable to add EventPropertySets with freely configurable property fields to the Event (see here). You can configure several different User-defined EventTypes to fit different application scenarios.

Accordingly, you might want to link the IoT EventList and Event Aggregation in the IoT Map’s ThingCard to a User-defined EventType. In this blog we explain you, how you can achieve this based on an existing Freestyle IoT Application. In the following you see a step-by-step guide who the application generated through IoT Web IDE template needs an adoption to work with User-defined events:

Event list with User Defined events:

  1. First replace the standard event type to user defined event type highlighted below in your manifest
  2. Open the event list control in the layout editor and change the column name and its binding to the right fields.

Thing list with the User Defined events

  1. Adopt advance list service (main service) in the manifest to load the metadata of User defined event
  2. Run the application, the ThingList will not show the things now
      • Find the call of AdvanceThingList $metatdata in the browser developer tool network tab
      • Copy the response of the $metadata.
      • Go back to WebIDE and replace the content of metadata.xml located within your project structure inside the folder local services with the copied $metadata response
  3. Open Thing List and adjust the binding and expand parameters with user defined events, shown in the images below.

.

 

Map with User defined event:

  1. Follow the step1 of Thing list user defined event to adopt the advance list service $metadata with user defined events.
  2. Adjust the map bindings and expand parameters shown in the step3 of thing list below.
  3. Now bind the map status element with the desired User defined event statuses.

 

Now you should be able to see your User-defined events in the EventList, ThingList and ioT Maps. In the thing list it is always shows the aggregated data for the events based on the severity.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sugandhan Vazhumuni
      Sugandhan Vazhumuni

      Hi Everyone,

       

      I had an issue in map.The map is not resizing properly. Some parts of the map is missing as shown in the image