Skip to content

Template repository to create Camunda Platform 8 Inbound Connectors using Connector SDK

License

Notifications You must be signed in to change notification settings

camunda/connector-template-inbound

Repository files navigation

A Connector template for new C8 inbound connector

To use this template update the following resources to match the name of your connector:

About creating Connectors

Check out the Connectors SDK

Connector Template

Camunda Inbound Connector Template

Emulates a simple inbound connector function that start process X times per minutes(to be specified in the element template)

Build

You can package the Connector by running the following command:

mvn clean package

This will create the following artifacts:

  • A thin JAR without dependencies.
  • A fat JAR containing all dependencies, potentially shaded to avoid classpath conflicts. This will not include the SDK artifacts since those are in scope provided and will be brought along by the respective Connector Runtime executing the Connector.
  • All element templates

Shading dependencies

You can use the maven-shade-plugin defined in the Maven configuration to relocate common dependencies that are used in other Connectors and the Connector Runtime. This helps to avoid classpath conflicts when the Connector is executed.

Use the relocations configuration in the Maven Shade plugin to define the dependencies that should be shaded. The Maven Shade documentation provides more details on relocations.

API

Input

Name Description Example
Sender Message sender alice
Message per minute Number of message created per minute 6

Output

{
  "event":{
    "sender":"test",
    "code":4,
    "message":"56b020ef-e51a-4a4b-b9a4-8df521a2e78f"
  }
}

Test locally

Run unit tests

mvn clean verify

Test with local runtime

To ensure the seamless functionality of your custom Camunda connector, please follow the steps below:

Prerequisites:

  1. Camunda Modeler, which is available in two variants:

  2. Docker, which is required to run the Camunda platform.

Setting Up the Environment:

  1. Clone the Camunda Platform repository from GitHub:
git clone https://github.com/camunda/camunda-platform.git

Navigate to the cloned directory and open docker-compose-core.yaml with your preferred text editor.

Locate the connector image section and comment it out using the # symbol, as you will be executing your connector locally.

Initiate the Camunda suite with the following Docker command:

docker compose -f docker-compose-core.yaml up

Configuring Camunda Modeler

  1. Install the Camunda Modeler if not already done.
  2. Add the element-templates/template-connector-message-start-event.json to your Modeler configuration as per the Element Templates documentation.

Launching Your Connector

  1. Run io.camunda.example.LocalConnectorRuntime to start your connector.
  2. Create and initiate a process that utilizes your newly created connector within the Camunda Modeler. Connector in Camunda Modeler
  3. Verify that the process is running smoothly by accessing Camunda Operate at localhost:8081.

Follow these instructions to test and use your custom Camunda connector effectively.

Test with SaaS

Prerequisites:

None required.

Setting Up the Environment:

  1. Navigate to Camunda SaaS.
  2. Create a cluster using the latest version available.
  3. Select your cluster, then go to the API section and click Create new Client.
  4. Ensure the zeebe checkbox is selected, then click Create.
  5. Copy the configuration details displayed under the Spring Boot tab.
  6. Paste the copied configuration into your application.properties file within your project.

Launching Your Connector

  1. Start your connector by executing io.camunda.connector.inbound.LocalConnectorRuntime in your development environment.
  2. Access the Web Modeler and create a new project.
  3. Click on Create new, then select Upload files. Upload the connector template from the repository you have.
  4. In the same folder, create a new BPMN diagram.
  5. Design and start a process that incorporates your new connector.

By adhering to these steps, you can validate the integration of your custom Camunda connector with the SaaS environment.

Element Template

The element template for this sample connector is generated automatically based on the connector input class using the Element Template Generator.

The generation is embedded in the Maven build and can be triggered by running mvn clean package.

The generated element template can be found in element-templates/template-connector.json.

About

Template repository to create Camunda Platform 8 Inbound Connectors using Connector SDK

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages