SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Editing Adapter Configuration Files

Edit a set of adapter configuration files in order to make the custom adapter available to both the HANA Streaming Analytics server at run time and in HANA Studio at design time.

Overview

🎓 intermediate 15 min. SAP HANA Streaming AnalyticsIntermediateInternet Of ThingsSAP HANAExpress Edition

You will learn

  • Locate which files to edit locally on HANA Studio and on the Streaming Server
  • How to edit the modulesdefine and custommodulesdefine .xml files
  • How to edit the parametersdefine.xml file
  • To transfer the files edited on the Streaming Server to the client where the HANA Studio is running
Robert Waywell R Robert Waywell January 15, 2025
Created by February 26, 2018
Contributors

Prerequisites

Steps

Next Steps

Time to Complete

15 Min


Intro

IMPORTANT! Since you’re running a multidb SAP HANA environment, $STREAMING_CUSTOM_ADAPTERS_HOME will refer to

 /hana/shared/<SID>/streaming/cluster/<tenant db>/adapters
assuming you have used the default location of /hana as the root directory for the installation.

For this step, we will be adding our custom modules to the modulesdefine.xml file and custommodulesdefine.xml file, and adding parameter definitions from the .cnxml file to parametersdefine.xsd. The modulesdefine.xml file is located in the $STREAMING_HOME/adapters/framework/config directory, the custommodulesdefine.xml file is located in the $STREAMING_CUSTOM_ADAPTERS_HOME/config directory, and the parametersdefine.xsd is located in the $STREAMING_CUSTOM_ADAPTERS_HOME/config directory. We are not creating these files from scratch. The purpose of the modulesdefine.xml file is to define our custom modules (Transporter and Formatter) so HANA Streaming Analytics knows what they do and where they reside.

The parametersdefine.xsd file simply defines what elements are valid in an adapter_config.xml file (adapter configuration file). Since we have used a custom element – MqttInputTransporterParameters – in our adapter_config.xml file, we must define it in parametersdefine.xsd.

Step 1 Edit modulesdefine.xml and custommodulesdefine.xml

The full source code for the modulesdefine.xml and custommodulesdefine.xml files are provided in the Appendix Section

  1. Open modulesdefine.xml in a text editor.

  2. We will add our Transporter module to the TransporterDefnList

    • Create a <TransporterDefn> element.

      XML
        <TransporterDefn>
    • Create a &lt;Name&gt; element. Specify the name of our custom Transporter class.

      XML
        <Name>MqttTransporter</Name>
    • Create a &lt;Class&gt; element.

      XML
        <Class>com.sap.MqttTransporter</Class>
    • Create an &lt;OutputData&gt; element.

      XML
        <OutputData>String</OutputData>
    • Close off the &lt;TransporterDefn&gt; element.

      XML
      </TransporterDefn>
  3. We will add our formatter module to the formatterDefnList

    • Create a &lt;FormatterDefn&gt; element.

      XML
        <FormatterDefn>
    • Create a &lt;Name&gt; element. Specify the name of our custom Transporter class.

      XML
        <Name>MqttFormatter</Name>
    • Create a &lt;Class&gt; element.

      XML
        <Class>com.sap.MqttFormatter</Class>
    • Create an &lt;InputData&gt; element.

      XML
        <InputData>String</InputData>
    • Create an &lt;OutputData&gt; element.

      XML
        <OutputData>Esp</OutputData>
    • Close off the &lt;FormatterDefn&gt; element.

      XML
        </FormatterDefn>
  4. Repeat steps 1 to 3 for custommodulesdefine.xml.

For the question below, select the correct answer, and click Validate.

Step 2 Edit parametersdefine.xsd
+
Step 3 Appendix
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Edit modulesdefine.xml and custommodulesdefine.xml 2. Edit parametersdefine.xsd 3. Appendix

Learn more →