Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(custom-connector): step by step guide on how to create a custom connector based on the rest connector #5202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change

# Create a New Connector Based on the REST Connector

## Step 1: Create a BPMN in the Web Modeler

1. Open the Camunda Platform Web Modeler and log in to your account.
2. Create a new project or open an existing one.
3. Add a new BPMN diagram to your project:
- Click `New Diagram`.
- Name your diagram and click `Create`.
Comment on lines +9 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Click `New Diagram`.
- Name your diagram and click `Create`.
- Click `New Diagram`.
- Name your diagram and click `Create`.


## Step 2: Add the REST Connector to the BPMN

1. In the BPMN editor, add a new task element to your diagram.
2. Change the task type to `Connector`:
- Click on the task element.
- Select the wrench icon to change the element type and choose `REST Outbound Connector` from the Connectors section.
Comment on lines +16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Click on the task element.
- Select the wrench icon to change the element type and choose `REST Outbound Connector` from the Connectors section.
- Click on the task element.
- Select the wrench icon to change the element type and choose `REST Outbound Connector` from the Connectors section.

3. Configure the REST Connector:
- In the properties panel, fill out the required fields such as Authentication URL, HTTP method, and any headers or payload needed for the API request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- In the properties panel, fill out the required fields such as Authentication URL, HTTP method, and any headers or payload needed for the API request.
- In the properties panel, fill out the required fields such as Authentication URL, HTTP method, and any headers or payload needed for the API request.


## Step 3: Save the REST Connector as a New Connector Template

1. With the REST Connector task selected, open the element template editor:
- Click the `Save as Template` button.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Click the `Save as Template` button.
- Click the `Save as Template` button.

2. Enter the template details:
- **Name**: Provide a name that clearly indicates the functionality of the template.
- **Description**: Describe the main features and benefits of the template.
- **Icon**: Optionally, upload a custom icon with supported formats: SVG, PNG, and JPEG.
Comment on lines +26 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- **Name**: Provide a name that clearly indicates the functionality of the template.
- **Description**: Describe the main features and benefits of the template.
- **Icon**: Optionally, upload a custom icon with supported formats: SVG, PNG, and JPEG.
- **Name**: Provide a name that clearly indicates the functionality of the template.
- **Description**: Describe the main features and benefits of the template.
- **Icon**: Optionally, upload a custom icon with supported formats: SVG, PNG, and JPEG.

3. Click `Create Template` to save the new connector template.

## Step 4: Customize the New Connector Using the Element Template Editor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[all.glossary] Inconsistent spelling detected. Use Element template instead of Element Template. Review the WCoE glossary - https://confluence.camunda.com/x/b5RZBw .


1. Open the template editor for further customization:
- Select the newly created template from the template list.
- Click `Edit Template` to open the template editor.
Comment on lines +34 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Select the newly created template from the template list.
- Click `Edit Template` to open the template editor.
- Select the newly created template from the template list.
- Click `Edit Template` to open the template editor.

2. Customize the template:
- Add or remove fields as required.
- Adjust default values and input parameters.
- Update the description and other metadata as necessary.
Comment on lines +37 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Add or remove fields as required.
- Adjust default values and input parameters.
- Update the description and other metadata as necessary.
- Add or remove fields as required.
- Adjust default values and input parameters.
- Update the description and other metadata as necessary.

3. Save your changes to finalize the customization.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change

## Example Overview

In this guide, you'll learn how to create a custom connector that fetches data from the Star Wars API (SWAPI). By following the steps outlined below, you'll be able to incorporate this connector into your BPMN workflows seamlessly.

### Step-by-Step Instructions

1. **Create a `Rest Outbound Connector` Task**
- Begin by creating a `Rest outbound connector` task in your workflow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Begin by creating a `Rest outbound connector` task in your workflow.
- Begin by creating a `Rest outbound connector` task in your workflow.

- Define the URL using a FEEL (Friendly Enough Expression Language) expression, utilizing the `resource` and `index` variables.
![img.png](img/custom-rest-connector.png)

2. **Click on `Save as`**
- Save your current progress by selecting `Save as`. This will enable you to create a template from your configured connector.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Save your current progress by selecting `Save as`. This will enable you to create a template from your configured connector.
- Save your current progress by selecting `Save as`. This will enable you to create a template from your configured connector.

![img_1.png](img/custom-save-as.png)

3. **Fill Out Template Information**
- Provide essential details such as the `Template Name` and `Template Description`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Provide essential details such as the `Template Name` and `Template Description`.
- Provide essential details such as the `Template Name` and `Template Description`.

- These fields are crucial for identifying and understanding the purpose of the template.
![img_2.png](img/custom-save-as-template.png)

4. **Open the New Connector Template in the Editor**
- Access the newly created template in the editor to make further customizations and configurations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Access the newly created template in the editor to make further customizations and configurations.
- Access the newly created template in the editor to make further customizations and configurations.


5. **Hide Unwanted Properties**
- For properties that are not required in your connector, set their `type` to `Hidden`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- For properties that are not required in your connector, set their `type` to `Hidden`.
- For properties that are not required in your connector, set their `type` to `Hidden`.

- Example: Since authentication is not necessary, set it to `Hidden`.
![img.png](img/custom-hide-authentication.png)
Comment on lines +68 to +69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Example: Since authentication is not necessary, set it to `Hidden`.
![img.png](img/custom-hide-authentication.png)
- Example: Since authentication is not necessary, set it to `Hidden`.
![img.png](img/custom-hide-authentication.png)

- Similarly, hide other fields such as `url`, `method`, `headers`, and `queryParameters`. If the `hidden` type does not apply, ensure that you remove the `feel` property.
![img.png](img/custom-hide-properties.png)

6. **Create a Custom Group for the Star Wars API**
- Introduce a customized group named `swapi` for organizing your Star Wars-related properties.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Introduce a customized group named `swapi` for organizing your Star Wars-related properties.
- Introduce a customized group named `swapi` for organizing your Star Wars-related properties.

![img.png](img/custom-create-new-group.png)

7. **Define the Properties in the SWAPI Group**
- Map the properties within the new group to the variables defined earlier (`resource` and `index`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Map the properties within the new group to the variables defined earlier (`resource` and `index`).
- Map the properties within the new group to the variables defined earlier (`resource` and `index`).

- Set `resource` as a `Dropdown`.
- Set `index` as a `String`.
![img.png](img/custom-add-new-properties.png)
Comment on lines +79 to +81
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Set `resource` as a `Dropdown`.
- Set `index` as a `String`.
![img.png](img/custom-add-new-properties.png)
- Set `resource` as a `Dropdown`.
- Set `index` as a `String`.
![img.png](img/custom-add-new-properties.png)


8. **Add an Icon**
- Enhance your connector's visual appeal by adding an appropriate icon.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Enhance your connector's visual appeal by adding an appropriate icon.
- Enhance your connector's visual appeal by adding an appropriate icon.

![img.png](img/custom-add-icon.png)

9. **Publish the Connector**
- Once all configurations are complete, click on `Publish` to make your connector available for use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- Once all configurations are complete, click on `Publish` to make your connector available for use.
- Once all configurations are complete, click on `Publish` to make your connector available for use.

![img.png](img/custom-publish-connector.png)

10. **Access Your New SWAPI Connector**
- The newly published SWAPI connector is now ready for use in your BPMN workflows.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
- The newly published SWAPI connector is now ready for use in your BPMN workflows.
- The newly published SWAPI connector is now ready for use in your BPMN workflows.

![img.png](img/custom-swapi-connector.png)

## Conclusion

By following these detailed steps, you have successfully created a reusable connector template based on the REST connector. This template streamlines interactions with the specified REST API and ensures consistency and standardization across different BPMN workflows. Enjoy integrating the power of the Star Wars API into your business processes!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[prettier] reported by reviewdog 🐶

Suggested change
By following these detailed steps, you have successfully created a reusable connector template based on the REST connector. This template streamlines interactions with the specified REST API and ensures consistency and standardization across different BPMN workflows. Enjoy integrating the power of the Star Wars API into your business processes!
By following these detailed steps, you have successfully created a reusable connector template based on the REST connector. This template streamlines interactions with the specified REST API and ensures consistency and standardization across different BPMN workflows. Enjoy integrating the power of the Star Wars API into your business processes!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading