Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Archana
Product and Topic Expert
Product and Topic Expert
Business policies are an important asset to any organisation. Over years, business rules have been the key to digitising these policies and benefiting the organisations by giving them the ability to adapt to changing market requirements. Organisations are now looking to add much more context in defining rules with addition of location information. It is a powerful combination which unfolds many new business opportunities especially in the asset-driven industries like transportation, petroleum etc. With location-based rules, businesses can quickly resolve issues or find defects or provide quick maintenance service or provide better real-time marketing schemes within the given geographical boundaries.



Large percentage of companies have some type of customer location data always available with them. With these geospatial data these companies can improve their business efficiency and decision making. Retail stores send related survey questionnaire to collect their consumer pulse or provide them real-time offers by sensing where they are etc. Transportation or Logistics sector can find the breakdown location of their vehicles and determine the best path to deliver the consignment on time which is critical to their success. Petroleum or energy segments can use geographical location to determine which oil well is not functioning or where to dig for new oil resources etc. to improve overall functioning as well as reduce costs which could have incurred losses due to non-functioning of the units. All this, when combined with Internet of Things make it even more lucrative where the sensors, devices and things sends millions of data every second which when filtered using geospatial rules can instantly bring tremendous insights into the situation in any geographical realms.

SAP Cloud Platform Business Rules now gives you the capabilities to define your business policies using geospatial data. It is a superlative feature that helps to combine location information with business information and gives you an unmatched competitive edge.

Let us now see how business rules can be enriched with geographical data. Before we start, here are some new things that you need to know:

  • Geospatial rules support geocoordinates

  • Geocoordinates ate supported only in 2-dimensions

  • Geocoordinates are represented using open standard format GeoJSON

  • New data type “Geometry” has been introduced

  • Geometry data type can be used as any other type

  • New functions ISWITHIN( ) and ISNOTWITHIN( ) are introduced to determine whether a given location is within the given geographic region or not.


» Important Note: This feature is supported only for cloud-based rules (which means rules deployed to SAP Cloud Platform)

GeoJSON concept used in business rules



  • GeoJSON is an open standard for representing geographical coordinates.

  • Supported GeoJSON formats are Point and Polygon.

    • Point is single location with a pair of longitude and latitude position

    • Polygon is a closed area with set of 5 longitude and latitude position





 

Author Business Rules with Geospatial Type




  • Model data object of type Geometry








  • Model business rules using new functions



    • Syntax of the functions are:

      • ISWITHIN(coordinates of the point, coordinates of the polygon)

        • It will return true if the point lies within polygon



      • ISNOTWITHIN(coordinates of the point, coordinates of the polygon)

        • It will return true if the point does not lie within polygon








Learn more about them from function library



Note: In the example above, I have used http://geojson.io/ to map the coordinates of a region. You can use any other available application to find the coordinates.


Hint: as business rules tool does not have in-built maps, you can create value helps for the different regions and then use them while modelling rules.






  • Invoke business rules with geospatial information



    • There are no special APIs. You have to use the same execution APIs. Only change will be the input data that you supply while invoking the rule service.

      • Input of Geometry type data object has to be passed as:






{"type":"Point","coordinates":[10.37109375,50.401515322]}


Use this powerful ability of SAP Cloud Platform Business Rules to define location-based rules and get critical intuitive information to take timely action or enhance business policies in real-time to gain edge over competitors.

 
1 Comment