Custom Module | Qntrl | Bridge | Online Help | Build your own module according to your needs in Qntrl

Custom Module

Early Access  

Custom Module is not enabled for all users. If you’d like to try it out, please email our support team for early access.

The predefined modules in a Bridge may help you reach a DB/App server/AD and accomplish your tasks. However, to meet some specific demands, Qntrl lets you create your own module (in Java) according to your requirements. Just like other Bridge modules, the custom-built module can be executed in Messages.

 Environmental Set-up 

  1. Click the settings gear iconlocated at the top-right corner of the header bar.
  2. Navigate to Advanced >> Bridge >> choose Custom Module.
  1. To set up a Custom Module implementation, it is necessary to have the Custom Module SDK installed in your development environment. The SDK requires Java (compatible with version 8) to be configured. You can obtain the SDK by clicking the Download SDK button located at the top right corner. This SDK includes a collection of libraries that facilitate the creation of custom modules.
  2. To integrate the SDK into your project, you need to add all the downloaded jars files to the reference libraries section.
  3. Once the custom module implementation is ready, compile the project and create it as a JAR file. Once created, compress the created Jar file into a zip file. This zip file is used while creating a custom module.
Refer to the Types of Custom Module section for the sample Java classes.

Note:

  • Your main class in Custom Module implementation is expected to extend the interface according to the Custom Module Type(JAR, REST API Sevice, SOAP Service).

  • If the custom module has to return a response, it should be a JSON Object.     


Create a Custom Module   

  1. In Qntrl, in the Custom Module page, click the New Custom Module button.

  2. Fill in the required details.

    1. Module Name: Provide a unique name to identify the module.

    2. Type: Select the application type used to write your custom module.

      1. JAR

      2. REST API Service

      3. SOAP Service

    3. DescriptionProvide a few details that describe the purpose of the module.

    4.  Main Class NameThe class name along with the package name in your Java package (e.g.: packageName.className).

    5. Attachments: Attach the zip file that comprises your JAR, created using the SDK interface.

  3. Click Save


How to Execute a Custom Module 

Step 1: Associate the Custom Module with the Bridge

To execute a custom module, it must first be associated with the Bridge. Upon association, the custom module JAR will be uploaded to the target Bridge. To associate the created custom module with the Bridge:
  1. Click the settings gear icon at the top-right corner of the header bar.
  2. Navigate to Advanced >> Bridge, then choose Bridge.
  3. In the Bridge list page, click on the name of the Bridge to which the Custom Module needs to be associated. 
  4. The selected Bridge details will be displayed. Under the Modules tab, click the Associate Modules button, and from the displayed list of modules select the name of the Custom Module you wish to associate with the Bridge.
  5. Click Save.

      


Step 2 : Execute the Custom Module 

To execute the custom module in the Bridge, the Message module is utilized. To accomplish this:
  1. Navigate to(settings) >> Advanced >> Bridge, then select Messages.
  2. In the Message list page that loads, click the New Message button.

  3. In the New Message window, enter the following details.

    • Name: Enter a unique name for the message.

    • Bridge: Select the Bridge you would like to execute from the dropdown list.

    • Module: The created custom module will be displayed in the dropdown list. Select the custom module to execute it through this message.

    •  Type: Select the message type:

      • Synchronous - Executes tasks in the same request and provides a response

      • Asynchronous - Executes tasks in the background.

    • Request Data: The instructions to be executed by the Bridge need to be given here in JSON format. Based on the custom module chosen, the request data format will vary.

      Note: The request data format is not predetermined and will vary according to the implementation of the custom module.

    • Response: If the type is Synchronous, the response to the request will be displayed under this tab.

  1. Once all the details are filled, click Execute.


Upon successful message execution, you can view the response (for synchronous type messages), and a server call entry in the message list of your Bridge agent.


Types of Custom Module  

1.  Jar 

Your main class in Custom Module is expected to extend the JarModule interface and override the request method.

Sample Java class 
//$Id$
package zylker;
import org.json.JSONObject;
import com.zoho.qntrl.bridge.sdk.module.jar.JarModule;
public class SupplyMonitor extends JarModule {
@Override
 public void request(JSONObject arg0) throws Exception {
 int byteCount = arg0.getInt("byteCount");
 int units = arg0.getInt("units");
JSONObject result = new JSONObject();
result.put("load", byteCount * units);
response(result);
}
}


2.  Rest API Services 

Support for REST API services in custom modules allows end users to develop their own REST API modules in their preferred format. Upon deployment, these REST API endpoints will be published on the Bridge server.

Deployment on the Bridge Server:

  1. Upon deployment on the Bridge server, REST API endpoints will be retrieved using the RestController and RequestDetails annotations.

  2. URL Construction: URLs are constructed as rest/{module_name}/{controller_path}/{request_path}.

    • Module Name: Retrieved from the main class's getModuleBasePath() function.

    • Controller Path: Path fetched from the RestController annotation.

    • Request Path: Path retrieved from the RestController annotation.

    • URL Method: Retrieved from the RequestDetails annotation.

  3. REST Module Configuration File:

    • Method and path details are added to the rest_modules.xml file, which is loaded during server start.

    • If a new version is updated in Qntrl, URLs in the configuration file are deleted and replaced with URLs fetched from the new version.

    • Upon module deletion in Qntrl, the module's details are removed from the configuration file.

 

Implementation:

REST API Service Classes  

Classes and their purposes for implementing the REST API Service are detailed below:

Configuration Class:

  • Contains the module's base path and the authenticator's class instance.

  • Implements
    com.zoho.qntrl.bridge.sdk.module.rest.RestServiceModule

  • Override Methods

    1.  getModuleBasePath()
      Should return the module's base path used to construct the REST API Url.

       getServiceAuthenticatorClassInstance()
      Should return the authenticator's class instance.

 

Authenticator Class:

  • Users must implement their authentication methodology.

  • Implements
    com.zoho.qntrl.bridge.sdk.module.rest.RestServiceAuthenticator

  • Override Methods

    • authenticate(HttpServletRequest, HttpServletResponse)

    • Request and response instances of the triggered API's are passed as arguments. If the request is authenticated and valid, the respective method implementation will be called; otherwise, it returns the error message as "User is not authorized".

Controller Class   

Users can implement their action implementations. Annotations and their purposes are detailed below:


i. RESTContoller: Marks the class as a REST API controller, which can also be mentioned as an entity. In the future, for OAuth 2, scope will be mapped in the controller.

  • Type - Class Annotation

  • Fields

    • basePath - Maps the controller with the base path; it should not have the same base path. It provides provision to retrieve the global metadata of the controller using the URL. No validation is done. If the same base path is used, it will be added to the rest module configuration file, and whichever returns first will be executed.

 

ii. RequestDetails: Identifies the method to invoke for the URL. The URL's method and path will be retrieved using it.

  • Type - Method Annotation

  • Fields

    • method - The request method name should be provided (mandatory).

    • path - The path URL should be mentioned. It's not mandatory as the base path will be provided in the controller, and for basic CRUD operations, it's enough.

 

Generating ZIP File

To generate a ZIP file:

  1. Generate the class files along with the parameter names stored with it. The parameter name will be used to fetch the value from the request's parameter or header.

  2. Create a JAR file using those class files and then ZIP the JAR file.

 

Global Info   

Users can retrieve the global information of the module and controller using the following endpoints.

  1. For Module:
    1. Endpoint: rest/{module_name}/_global_info
    2. Returns all the paths along with the method details in the module.
  2. For Controller:
    1. Endpoint: rest/{module_name}/{controller_path}/_global_info
    2. Returns all the paths along with the method details present in the particular controller.

   

3. SOAP Services  

Support for SOAP services within Custom Modules allows end users to create their own SOAP service custom modules in their desired format. Upon deployment, these SOAP service endpoints will be made available on the Bridge server.

 Deployment on the Bridge Server: 

  • Upon deployment in the Bridge server, SOAP service endpoints are retrieved  from the main class getEndpoint() method.

  • Endpoint URLs must begin with /soap.

  • SOAP Module Configuration File:

    • Configuration details of SOAP modules are stored in the  soap_modules.xml  file, which is loaded during server startup.

    • If a new version is updated in Qntrl, existing URLs related to the module in the configuration file will be deleted and replaced with the endpoints retrieved from the new version.

    • Upon module deletion in Qntrl, corresponding module details are removed from the configuration file.

Implementation:

To create a SOAP service module, you need to implement the SoapServiceModule interface in the main class. Below is an example of the main class and a SOAP endpoint.

SampleSoapServiceModule.java

import com.zoho.qntrl.bridge.sdk.module.soap.Endpoint;
import com.zoho.qntrl.bridge.sdk.module.soap.SoapServiceModule;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SampleSoapServiceModule implements SoapServiceModule {
    private static final Logger LOGGER = Logger.getLogger(SampleSoapServiceModule.class.getName());
    @Override
    public void serviceStarted(Endpoint endpoint) {
        LOGGER.log(Level.INFO, "service {0} - {1} is started", new Object[]{endpoint.getName(), endpoint.getUrlPattern()});
    }
    @Override
    public List<Endpoint> getEndpoints() {
        return Arrays.asList(
                new Endpoint("SampleSoapService", SampleSoapService.class.getName(), "/soap/sample")
        );
    }
 
    @Override
    public void serviceStopped(Endpoint endpoint) {
        LOGGER.log(Level.INFO, "service {0} - {1} is stopped", new Object[]{endpoint.getName(), endpoint.getUrlPattern()});
    }
    @Override
    public void moduleUnregistered() {
        LOGGER.log(Level.INFO, "sample soap service module got removed");
    }
}

SampleSoapService.java

import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public class SampleSoapService {
    @WebMethod(operationName = "SayHello")
    public String sayHello(String name) {
        return "Hello " + name + "..!";
    }
}


Accessing Soap Service:
After compiling these classes, create a JAR file and zip it. Upload the zip file to the custom module in Qntrl. You can then access it in the Bridge using the URL http[s]://{your_domain}/soap/sample?wsdl, where you will see the WSDL of this SOAP service.

View / Edit properties of a Custom Module   

To update a Custom Module,
  1. Navigate to(settings) >> Advanced >> Bridge, then select Custom Module.
  2. On the module list page, click the name of the module.
  3. The details of the selected Custom Module will be displayed. You can view and edit the properties of fields (Module Name, Description, Main Class Name, etc.) here. 

 

  1. In the Attachment field, you can add or remove JAR files. The added JAR file will become Active.

      Limitations:
  1.       A maximum of three zip files can be attached.
  2.       Only one JAR file will be active.
  3.       When one file gets active, other JAR files become inactive and the active JAR file will automatically get deployed.
  1. Under the Associated Bridge(s) tab, the Bridge we associated while creating the module will be displayed. If you activate a new JAR file and update the module, the JAR will be deployed to this Bridge by default.
If the newly added JAR file is not deployed to the Bridge by default, you can forcefully deploy and update by clicking on the Deploy button.
  1. After making the required modifications, click Save


Delete a Custom Module   

To remove a Custom Module from Bridge,
  1. Navigate to(settings) >> Advanced >> Bridge, then select Custom Module.

  2. Hover over the name of the module you want to delete, click the action menu, and select the Delete.

  3. Confirm the Delete action.

 

 


    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION








                                    You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                        Manage your brands on social media

                                          Zoho Desk Resources

                                          • Desk Community Learning Series


                                          • Digest


                                          • Functions


                                          • Meetups


                                          • Kbase


                                          • Resources


                                          • Glossary


                                          • Desk Marketplace


                                          • MVP Corner


                                          • Word of the Day


                                            Zoho Marketing Automation

                                              Zoho Sheet Resources

                                               

                                                  Zoho Forms Resources


                                                    Secure your business
                                                    communication with Zoho Mail


                                                    Mail on the move with
                                                    Zoho Mail mobile application

                                                      Stay on top of your schedule
                                                      at all times


                                                      Carry your calendar with you
                                                      Anytime, anywhere




                                                            Zoho Sign Resources

                                                              Sign, Paperless!

                                                              Sign and send business documents on the go!

                                                              Get Started Now




                                                                      Zoho TeamInbox Resources



                                                                              Zoho DataPrep Resources



                                                                                Zoho DataPrep Demo

                                                                                Get a personalized demo or POC

                                                                                REGISTER NOW


                                                                                  Design. Discuss. Deliver.

                                                                                  Create visually engaging stories with Zoho Show.

                                                                                  Get Started Now









                                                                                                      • Related Articles

                                                                                                      • Other actions in Bridge

                                                                                                        View / Edit Bridge properties Once you create a Bridge, you can view and edit its properties. Click the Settings gear icon at the top right of the header bar. Navigate to Advanced >> Bridge >> choose Bridge. In the Bridge list page, choose the ...
                                                                                                      • Custom Field Properties in Forms

                                                                                                         While adding custom fields to forms, users are prompted to declare the properties of fields. Let us discuss each property in detail.  Properties of fields Field title   Field title is the actual title used to identify a field across forms.    Field ...
                                                                                                      • Create Custom Fields in Forms

                                                                                                        Qntrl supports different types of custom fields. Custom fields in Qntrl follow some common properties that can be modified according to the user's requirement. Let us learn how to add different custom fields and configure its properties. Add ...
                                                                                                      • Step 1: Create Form

                                                                                                        Forms are used to capture requests from users that help you collect the data required to kickstart workflows and perform tasks in Qntrl.     There are different departments in an organization providing different solutions. For instance, the finance ...
                                                                                                      • Custom Function: Create_Job

                                                                                                        This custom function can be used to create a new card in any orchestration. It can also be configured to carry forward necessary field values from the former card to the latter.   Business Scenario Helen is the head of Procurement Management in her ...
                                                                                                        Wherever you are is as good as
                                                                                                        your workplace

                                                                                                          Resources

                                                                                                          Videos

                                                                                                          Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                          eBooks

                                                                                                          Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                          Webinars

                                                                                                          Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                          CRM Tips

                                                                                                          Make the most of Zoho CRM with these useful tips.



                                                                                                            Zoho Show Resources