Building connectors


As a developer, after you design a new custom connector or update an existing one, you can build or rebuild your connector by using the Build option. Building the connector generates the source code and associated resource files for the connector. You have the flexibility to update and add custom code to these files. 

To build the connector:

  • Test the connector in BMC Helix Connector Designer.
  • Start the connector. If the connector is not registered for your tenant in BMC Helix Integration Studio, it is first registered. Then the connector is started in the docker container on your BMC Helix Connector Designer instance.

    The following image shows the Build section in BMC Helix Connector Designer:

Custom connectors can operate and make HTTP requests by using a proxy. The BMC Helix Connector Designer code generator automatically includes proxy options to the generated code.

To build a connector

  1. To open BMC Helix Connector Designer in your browser, navigate to https://localhost:3000/ and log in.
  2. On the Connectors tab, select the connector that you want to build, and click .

  3. To generate the source code and create associated resource files, in the Build tab, click Generate
    The connector files are generated in the panama/connectors/ directory. For details of the files generated when you build the connector, see Code files generated after building the connector

    After the connector is generated successfully, the Test and Start options are enabled and the Generate option is disabled. The Generate option is enabled again if you make any changes to the connector configuration later.

  4. To restart or stop the connector, on the Connectors tab, select the required connector, and click the Start/Stop option. 

Code files generated after building the connector

When you click Build, the connector code is generated. Multiple files are generated including the base connector file and a file for each trigger or action added to the connector. The files generated for the type of connector selected are described in the following table. It also provides information about whether files are overwritten when you regenerate the connector after updating it.

Java-based connector

Javascript-based connector

Description

Overwritten?

BaseConnector.java<connectorName>_connector.jsMain connector file maintained by BMC that provides the default implementation for the connector based on the configuration.Yes
NAconnector_helper_functions.jsAdd-on functions maintained by BMC that can be used by custom code and BMC code.Yes
NAconnector_life_cycle.jsDevelopers can add their custom code for initialize/closeConnector/validateConnector functions.No
<connectorName>Conector.javaNACustom code file that the developer can update to override base connector implementation.No
<triggerName>Trigger.javaconnector_trigger_<triggerName>.js

Custom code file generated separately for each trigger defined in the connector.

Developers can add their custom code for the trigger in this file.

No
<actionName>Action.javaconnector_action_<actionName>.js

Custom code file generated separately for each action defined in the connector.

Developers can add their custom code for the action in this file.

No
<lookupName>Lookup.javaconnector_lookup_<lookupName>.js

Custom code file generated separately for each lookup defined in the connector.

Developers can add their custom code for the lookup in this file.

No
<queryName>Query.javaconnector_query_<queryName>.js

Custom code file generated separately for each query defined in the connector.

Developers can add their custom code for the query in this file.

No

The code provided in these files is structured and comments are added to identify sections in the code. They also include comments to identify the key areas in the code that are used for authentication, to which you might need to add headers or a token. As a developer, you can overwrite or add specific parameters to the authentication. When you update the connector and regenerate it, the authentication information you add to the code is not overwritten.

Sample Java connector code 

Sample JS connector code

Important

  • If you rename a Trigger, Action, or Query, a new code file with the new name is generated. The existing code file with the old name is not deleted. You must copy any custom code from the old code file to the new one.
  • If you remove a Trigger, Action, or Query, the already generated code file is not deleted. 
  • If you update a Trigger, Action, or Query, the test configuration file for the Test Driver is automatically created or updated when you click the Test button.

Where to go from here

After you build the connector, make the required changes to the connector code, test the connector, and resolve the errors, you can deploy the connector to a production instance. For more information, see Testing connectors and validating them on the development site.

Was this page helpful? Yes No Submitting... Thank you

Comments