Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_SEC }}
gpg-passphrase: MAVEN_CENTRAL_GPG_PASSPHRASE
- name: Deploy SNAPSHOT / Release
uses: camunda-community-hub/community-action-maven-release@v2
uses: cibseven-community-hub/community-action-maven-release@v0.0.1
with:
release-version: ${{ github.event.release.tag_name }}
nexus-usr: ${{ secrets.NEXUS_USR }}
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic"
}
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Camunda Engine OpenAPI REST Client Java and Spring Boot
# CIB seven Engine OpenAPI REST Client Java and Spring Boot

[![](https://img.shields.io/badge/Community%20Extension-An%20open%20source%20community%20maintained%20project-FF4700)](https://github.com/camunda-community-hub/community) [![](https://img.shields.io/badge/Lifecycle-Incubating-blue)](https://github.com/Camunda-Community-Hub/community/blob/main/extension-lifecycle.md#incubating-) ![Compatible with: Camunda Platform 7](https://img.shields.io/badge/Compatible%20with-Camunda%20Platform%207-26d07c)
[![](https://img.shields.io/badge/Community%20Extension-An%20open%20source%20community%20maintained%20project-FF4700)](https://github.com/cibseven-community-hub/community) [![](https://img.shields.io/badge/Lifecycle-Incubating-blue)](https://github.com/CIBseven-Community-Hub/community/blob/main/extension-lifecycle.md#incubating-) ![Compatible with: CIB seven Platform 7](https://img.shields.io/badge/Compatible%20with-CIB%20seven%20Platform%207-26d07c)

This community extension is a convenience wrapper around the generated Java client from the Camunda Platform 7.x OpenAPI spec.
This community extension is a convenience wrapper around the generated Java client from the CIB seven Platform 7.x OpenAPI spec.

## Example application

An example application using this community extension in a Spring Boot context can be found here: https://github.com/berndruecker/camunda-platform-remote-spring-boot-example
An example application using this community extension in a Spring Boot context can be found here: https://github.com/berndruecker/cibseven-platform-remote-spring-boot-example

## Using the client

The camunda endpoint in the `ApiClient` is by default `http://localhost:8080/engine-rest`, if you use a diffrent path then set it through *`setBasePath`* method of the `ApiClient`.
The CIB seven endpoint in the `ApiClient` is by default `http://localhost:8080/engine-rest`, if you use a different path then set it through *`setBasePath`* method of the `ApiClient`.

### Plain Java

In a plain Java project you can simply add this dependency (**please make sure to use the latest version as there were a couple of important bug fixes lately**):

```
<dependency>
<groupId>org.camunda.community</groupId>
<artifactId>camunda-engine-rest-client-openapi-java</artifactId>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-openapi-java</artifactId>
<version>7.23.0</version>
</dependency>
```
Expand Down Expand Up @@ -62,16 +62,17 @@ Add this dependency:

```
<dependency>
<groupId>org.camunda.community</groupId>
<artifactId>camunda-engine-rest-client-openapi-springboot</artifactId>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-openapi-springboot</artifactId>
<version>7.20.0</version>
</dependency>
```

You can configure the Camunda *endpoint* via your `application.properties` and initialize the client been like this:
You can configure the CIB seven *endpoint* via your `application.properties` and initialize the client like this:

```
camunda.bpm.client.base-url: http://localhost:8080/engine-rest
cibseven.bpm.client.base-url: http://localhost:8080/engine-rest

```

And then simply inject the API, for example:
Expand Down Expand Up @@ -99,30 +100,31 @@ public class ExampleRestEndpoint {
You can auto-deploy resources from your project, like BPMN processes. As default, all `.bpmn`, `.dmn`, and `.form` files are picked up and deployed. The pattern for resource files can be configured:

```
camunda.autoDeploy.bpmnResources: 'classpath*:**/*.bpmn'
camunda.autoDeploy.dmnResources: 'classpath*:**/*.dmn'
camunda.autoDeploy.formResources: 'classpath*:**/*.form'
##### Auto-deployment configuration
cibseven.autoDeploy.bpmnResources: 'classpath*:**/*.bpmn'
cibseven.autoDeploy.dmnResources: 'classpath*:**/*.dmn'
cibseven.autoDeploy.formResources: 'classpath*:**/*.form'
```

You can disable auto deployment (which is enabled by default):

```
camunda.autoDeploy.enabled: false
cibseven.autoDeploy.enabled: false
```

If you want to disable service start failure if it fails during deployment of the resource (which is enabled by default):
```
camunda.autoDeploy.failStartupOnError: false
cibseven.autoDeploy.failStartupOnError: false
```

### Spring Boot OpenAPI + External Task Bundle

Most often you might also want to use the OpenAPI, but also leverage the [Camunda External Task Client as Spring Boot Starter](https://github.com/camunda/camunda-bpm-platform/tree/master/spring-boot-starter/starter-client). To do so you can simply add this convenience library which bundles both:
Most often you might also want to use the OpenAPI, but also leverage the [CIB seven External Task Client as Spring Boot Starter](https://github.com/cibseven/cibseven-bpm-platform/tree/master/spring-boot-starter/starter-client). To do so you can simply add this convenience library which bundles both:

```
<dependency>
<groupId>org.camunda.community</groupId>
<artifactId>camunda-engine-rest-client-complete-springboot-starter</artifactId>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-complete-springboot-starter</artifactId>
<version>7.20.0</version>
</dependency>
```
Expand Down
25 changes: 0 additions & 25 deletions camunda-engine-rest-client-complete-springboot-starter/pom.xml

This file was deleted.

This file was deleted.

25 changes: 25 additions & 0 deletions cibseven-engine-rest-client-complete-springboot-starter/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-root</artifactId>
<version>2.1.0-SNAPSHOT</version>
</parent>

<artifactId>cibseven-engine-rest-client-complete-springboot-starter</artifactId>
<name>CIB seven Engine REST Client Complete Spring Boot Starter</name>
<dependencies>
<!-- Open API client -->
<dependency>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-openapi-springboot</artifactId>
</dependency>
<!-- External Task client -->
<dependency>
<groupId>org.cibseven.bpm.springboot</groupId>
<artifactId>cibseven-bpm-spring-boot-starter-external-task-client</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.camunda.community</groupId>
<artifactId>camunda-engine-rest-client-root</artifactId>
<version>7.23.0-SNAPSHOT</version>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-root</artifactId>
<version>2.1.0-SNAPSHOT</version>
</parent>

<artifactId>camunda-engine-rest-client-openapi-java</artifactId>
<name>Camunda Engine REST Client OpenApi Java</name>
<artifactId>cibseven-engine-rest-client-openapi-java</artifactId>
<name>CIB seven Engine REST Client OpenApi Java</name>
<dependencies>

<!-- @Nullable annotation -->
Expand Down Expand Up @@ -69,9 +69,9 @@
<artifactId>openapi-generator-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-rest-openapi</artifactId>
<version>${camunda.version}</version>
<groupId>org.cibseven.bpm</groupId>
<artifactId>cibseven-engine-rest-openapi</artifactId>
<version>${cibseven.version}</version>
</dependency>
</dependencies>
<executions>
Expand All @@ -83,10 +83,10 @@
<inputSpec>/openapi.json</inputSpec>
<generatorName>java</generatorName>
<configOptions>
<packageName>org.camunda.community.rest.client</packageName>
<apiPackage>org.camunda.community.rest.client.api</apiPackage>
<invokerPackage>org.camunda.community.rest.client.invoker</invokerPackage>
<modelPackage>org.camunda.community.rest.client.dto</modelPackage>
<packageName>org.cibseven.community.rest.client</packageName>
<apiPackage>org.cibseven.community.rest.client.api</apiPackage>
<invokerPackage>org.cibseven.community.rest.client.invoker</invokerPackage>
<modelPackage>org.cibseven.community.rest.client.dto</modelPackage>
<library>apache-httpclient</library>
<dateLibrary>java8</dateLibrary>
<testOutput>${project.build.directory}/generated-test-sources/openapi</testOutput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.camunda.community</groupId>
<artifactId>camunda-engine-rest-client-root</artifactId>
<version>7.23.0-SNAPSHOT</version>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-root</artifactId>
<version>2.1.0-SNAPSHOT</version>
</parent>

<artifactId>camunda-engine-rest-client-openapi-springboot</artifactId>
<artifactId>cibseven-engine-rest-client-openapi-springboot</artifactId>

<name>Camunda Engein REST Client OpenApi Spring Boot</name>
<name>CIB seven Engine REST Client OpenApi Spring Boot</name>
<dependencies>
<dependency>
<groupId>org.camunda.community</groupId>
<artifactId>camunda-engine-rest-client-openapi-java</artifactId>
<groupId>org.cibseven.community</groupId>
<artifactId>cibseven-engine-rest-client-openapi-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.camunda.community.rest.client.springboot;
package org.cibseven.community.rest.client.springboot;

import org.camunda.community.rest.client.api.*;
import org.camunda.community.rest.client.invoker.ApiClient;
import org.cibseven.community.rest.client.api.*;
import org.cibseven.community.rest.client.invoker.ApiClient;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class CamundaApi {
public class CibSevenApi {

private final ApiClient apiClient;

public CamundaApi(ApiClient apiClient) {
public CibSevenApi(ApiClient apiClient) {
this.apiClient = apiClient;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.camunda.community.rest.client.springboot;
package org.cibseven.community.rest.client.springboot;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties("camunda.auto-deploy")
public class CamundaAutodeploymentProperties {
@ConfigurationProperties("cibseven.auto-deploy")
public class CibSevenAutodeploymentProperties {
private String bpmnResources = "classpath*:**/*.bpmn";
private String dmnResources = "classpath*:**/*.dmn";
private String formResources = "classpath*:**/*.form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.camunda.community.rest.client.springboot;
package org.cibseven.community.rest.client.springboot;

import org.camunda.community.rest.client.api.*;
import org.camunda.community.rest.client.invoker.ApiClient;
import org.cibseven.community.rest.client.api.*;
import org.cibseven.community.rest.client.invoker.ApiClient;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class CamundaHistoryApi {
public class CibSevenHistoryApi {

private final ApiClient apiClient;

public CamundaHistoryApi(ApiClient apiClient) {
public CibSevenHistoryApi(ApiClient apiClient) {
this.apiClient = apiClient;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package org.camunda.community.rest.client.springboot;
package org.cibseven.community.rest.client.springboot;

import org.camunda.community.rest.client.invoker.ApiClient;
import org.cibseven.community.rest.client.invoker.ApiClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class CamundaOpenApiStarter {
public class CibSevenOpenApiStarter {

private final String basePath;
private final String username;
private final String password;

public CamundaOpenApiStarter(
@Value("${camunda.bpm.client.base-url:#{null}}") String basePath,
@Value("${camunda.bpm.client.basic-auth.username:#{null}}") String username,
@Value("${camunda.bpm.client.basic-auth.password:#{null}}") String password) {
public CibSevenOpenApiStarter(
@Value("${cibseven.bpm.client.base-url:#{null}}") String basePath,
@Value("${cibseven.bpm.client.basic-auth.username:#{null}}") String username,
@Value("${cibseven.bpm.client.basic-auth.password:#{null}}") String password) {
this.basePath = basePath;
this.username = username;
this.password = password;
Expand Down
Loading