Skip to content

Commit

Permalink
3.1 upload connector (#132)
Browse files Browse the repository at this point in the history
* new page monitoring
* UpLoad Jar from Content page
* Move to 8.3 version
* Add a banner
* Produce the same element-template
* OAuth integration
* Organize import
* Improve interface to show the connection
* Remove Ping in the list on demand
* Update information any time
* Rename application and remove mustache
  • Loading branch information
pierre-yves-monnet authored Jun 5, 2024
1 parent 10dd61f commit 463c169
Show file tree
Hide file tree
Showing 83 changed files with 3,654 additions and 932 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ Docker image is then available in the package
# Build
The project is configured to publish automatically to maven central the JAR file, and to docker package a Docker image

If you want to build a local maven image, use

````yaml
mvn spring-boot:build-image
````
## Maven Central repository

See .github/workflows/mvn-release.yml
Expand Down
10 changes: 10 additions & 0 deletions doc/CherryArchitecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Cherry architecture

## bean zeebeClient

Some connector needs to access the zeebeClient object.
Using the library io.camunda.spring.spring-boot-starter-camunda onboard a bean zeebeClient.
This client is created directly from the application.yaml

But in the configuration, there is multiple way to declare the zeebeClient: via a list, or from different other way.
ZeebeContainer know the client client in use, so this class redefine the bean with a @Primary option.
30 changes: 20 additions & 10 deletions doc/DeveloperGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ A parameter can be a list of choice, and the designer will choose one in the dro

### List of BPMN Errors

![Bpmn Errors documentation](BpmnErrorsDocumentation.png?raw=true)

Give the list of BPMN Errors that the connector/worker can throw. This list will be available in the documentation.
The Element-Template will contain the FEEL expression to transform a `ConnectorException` to a BPMN Error.
Expand All @@ -143,9 +142,9 @@ The worker has only one class, and get directly the information from the context
Declare in the constructor the different input.
(see `src/main/java/io/camunda/cherry/embeddedrunner/ping/worker/PingWorker.java`)

`````java
`````
@Component
public class PingWorker extends AbstractWorker implements IntFrameworkRunner {
public class PingWorker extends AbstractWorker implements IntruntimeRunner {
public PingWorker() {
super("c-ping",
Expand Down Expand Up @@ -191,7 +190,7 @@ The recommendation is to declare a constant for each Input to ensure consistency
public class PingConnectorInput extends AbstractConnectorInput {
// see
// https://docs.camunda.io/docs/components/integration-framework/connectors/custom-built-connectors/connector-sdk/#validation
// https://docs.camunda.io/docs/components/integration-runtime/connectors/custom-built-connectors/connector-sdk/#validation
@NotEmpty
protected final static String INPUT_MESSAGE="message";
Expand All @@ -205,7 +204,7 @@ private boolean throwErrorPlease;
`````
Then the value can be used in the declaration

`````java
`````
@Component
@OutboundConnector(name = PingConnector.TYPE_PINGCONNECTOR,
inputVariables = { PingConnectorInput.INPUT_MESSAGE,
Expand All @@ -217,7 +216,7 @@ public class PingConnector extends AbstractConnector implements OutboundConnecto

In the constructor, reference the Input class and the Output class. The Cherry runtime will introspect these class to create the documentation and the Element-template

`````java
`````
public PingConnector() {
super(TYPE_PINGCONNECTOR,
Expand All @@ -227,9 +226,9 @@ public PingConnector() {
`````

Doing this ways, the Cherry framework will not find the documentation to build the documentation or the Element-template.
Doing this way, the Cherry runtime will not find the documentation to build the documentation or the Element-template.

Do do that, the Input object need to extends the `AbstractConnectorInput` class
Do do that, the Input object need to extend the `AbstractConnectorInput` class

````
public class PingConnectorInput extends AbstractConnectorInput {
Expand Down Expand Up @@ -315,7 +314,7 @@ Then, you have to specify the list of outputs in the method `getOutputParameters
**You must create a getter for each member, starting with a lower case**
For example, for the object

````java
````
private long internalTimeStampMS;
````

Expand Down Expand Up @@ -402,7 +401,7 @@ You can override different method:
}
````
The logo must be a SVG image.
The logo must be an SVG image.

## Execution
Then here you are: the execute method!
Expand Down Expand Up @@ -504,3 +503,14 @@ Start the Cherry runtime. Your connector appears in the dashboard, and the Eleme
You can download the complete collection to save for the desktop Modeler.

Or you can access the definition of one connector/worker to create a connector template in the Web Modeler. One connector template must be created one by one.

# Integrate an external connector
You have an external connector, and when you will upload it in Cherry runtime, you want to take advantages of all functions, displaying it with logo, display the list of Inputs, Outputs, BPMNError.

You want to generate the element-template by the Cherry runtime, with advance controles.

It is possible to do that without embedded any Cherry Library. You will just need to add some methods in your connector, then the runtime will be able to access it.
For example, the Cherry runtime will try to access a method `getLogo()` to read the logo.

To be sure to not miss any function, check interfaces CherryConnector, CherryInput, CherryOutput stored
under `io.camunda.connector.cherrytemplate`. Copy the package in your connector, and follow the README.MD
59 changes: 59 additions & 0 deletions doc/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# todo

Main new feature are registered via the github issue, but here are additionnal (easy to write)

# Element Template

## version
The element template accept a version number
in the element template and in the Cherry


## handle message

The XML must contain this
````
<bpmn:messageEventDefinition id="MessageEventDefinition_0eo5tes" />
````
to let the connector catch the throw event.
How to add it in the element-template?

This should be the correct information, but does not work

````
{
"type": "Hidden",
"generatedValue": {
"type": "uuid"
},
"binding": {
"type": "bpmn:Message#property",
"name": "name"
}
}
````

# Inbound connector
Cherry handle Inbound connector

# Upload connector JAR

## PVC
Documentation: via a PVC, upload the JAR and Cherry load it at the beginning.

## Manual upload
Create a load from the UI

## marketPlace
jar can be upload diretly from the marketplace

## Google Drive
A google drive access is provided in the configuration (or via the UI), and Cherry upload JAR in this google drive

## Bucket access
A Bucket access is provided in the configuration (or via the UI), and Cherry upload JAR in this bucket

## Git Repository
A Git repository is provided in the configuration (or via the UI), and Cherry upload JAR in this Gir Repo (in the release)
4 changes: 2 additions & 2 deletions element-templates/Ping connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"property": "ipAddress_optional",
"equals": "true"
},
"description": "Returm the IpAddress",
"description": "Return the IpAddress",
"binding": {
"type": "zeebe:output",
"source": "\u003d result.ipAddress"
Expand All @@ -220,7 +220,7 @@
"group": "Output"
},
{
"description": "Returm parameters",
"description": "Return parameters",
"binding": {
"type": "zeebe:input",
"name": "parameters_optional"
Expand Down
117 changes: 98 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@

<groupId>io.camunda.community</groupId>
<artifactId>zeebe-cherry-runtime</artifactId>
<version>3.0.4</version>
<version>3.1.1</version>

<properties>
<java.version>17</java.version>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>

<!--Version-->
<zeebe.version>8.2.0</zeebe.version>
<zeebe-client.version>8.2.4</zeebe-client.version>
<connector-core.version>0.9.0</connector-core.version>
<connector-validation.version>0.9.0</connector-validation.version>
<!--Version 8.3.0-->
<zeebe.version>8.3.0</zeebe.version>
<zeebe-client.version>8.3.3</zeebe-client.version>
<connector-core.version>8.3.1</connector-core.version>
<connector-validation.version>8.3.1</connector-validation.version>

<!-- Access file -->
<filestorage.version>1.1.0</filestorage.version>
<filestorage.version>1.2.0</filestorage.version>

<!-- 2.7.4 -->
<spring.boot.version>2.7.4</spring.boot.version>

<junit.jupiter.version>5.9.1</junit.jupiter.version>
<opensagres.version>2.0.3</opensagres.version>
<spring.boot.version>2.7.4</spring.boot.version>

<opensagres.version>2.0.4</opensagres.version>

</properties>


Expand All @@ -49,17 +54,28 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda</artifactId>
<version>${zeebe.version}</version>
</dependency>
<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-client-java</artifactId>
<version>${zeebe-client.version}</version>
</dependency>

<!-- https://docs.camunda.io/docs/apis-tools/spring-zeebe-sdk/getting-started/ -->
<!-- <dependency>
<groupId>io.camunda</groupId>
<artifactId>spring-boot-starter-camunda-sdk</artifactId>
<version>${zeebe.version}</version>
</dependency>
-->


<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda</artifactId>
<version>${zeebe.version}</version>
</dependency>


<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-client-java</artifactId>
<version>${zeebe-client.version}</version>
</dependency>


<!-- Accept Camunda Connector -->
Expand All @@ -68,11 +84,18 @@
<artifactId>connector-core</artifactId>
<version>${connector-core.version}</version>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-runtime-core</artifactId>
<version>${connector-core.version}</version>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-validation</artifactId>
<version>${connector-validation.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.camunda.connector/connector-validation -->


<!-- Access file -->
<dependency>
Expand Down Expand Up @@ -152,6 +175,61 @@
<scope>test</scope>
</dependency>





<!-- Convert to PDF -->
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/fr.opensagres.xdocreport.document -->
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.document</artifactId>
<version>${opensagres.version}</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.document.docx</artifactId>
<version>${opensagres.version}</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.document.odt</artifactId>
<version>${opensagres.version}</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.converter.odt.odfdom</artifactId>
<version>${opensagres.version}</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>xdocreport</artifactId>
<version>${opensagres.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.converter</artifactId>
<version>${opensagres.version}</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
<version>${opensagres.version}</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.converter.docx.xwpf</artifactId>
<version>${opensagres.version}</version>
</dependency>


</dependencies>

<build>
Expand Down Expand Up @@ -234,10 +312,11 @@
</dependencies>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<img src={logo} className="App-logo" alt="logo"/>
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/main/frontend/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import {render, screen} from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
render(<App />);
render(<App/>);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
2 changes: 1 addition & 1 deletion src/main/frontend/src/CherryApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FRAME_NAME = {
CONTENT: "Content",
PARAMETERS: "Parameters",
STORE: "Store",
OPERATIONLOG : "OperationLog"
OPERATIONLOG: "OperationLog"

}

Expand Down
Loading

0 comments on commit 463c169

Please sign in to comment.