An open API service indexing awesome lists of open source software.

https://github.com/camunda-community-hub/camunda-platform-7-custom-batch

using the camunda batch execution for custom batch runs
https://github.com/camunda-community-hub/camunda-platform-7-custom-batch

batch camunda camunda-7

Last synced: 3 months ago
JSON representation

using the camunda batch execution for custom batch runs

Awesome Lists containing this project

README

          

# camunda-platform-7-custom-batch

[cols="a,a,a,a,a"]
,====
// camunda batches
image::https://img.shields.io/badge/Community%20Extension-An%20open%20source%20community%20maintained%20project-FF4700[link="https://github.com/camunda-community-hub/community"]
image::https://img.shields.io/badge/Camunda%20Version-7.20-orange.svg[link="https://docs.camunda.org/manual/7.20/"]
image::https://img.shields.io/badge/Lifecycle-Stable-brightgreen[link="https://github.com/Camunda-Community-Hub/community/blob/main/extension-lifecycle.md#stable-"]
image::https://img.shields.io/badge/Compatible%20with-Camunda%20Platform%207-26d07c["Compatible with: Camunda Platform 7"]
// github actions batch
image::https://github.com/camunda-community-hub/camunda-platform-7-custom-batch/actions/workflows/build.yml/badge.svg[link="https://github.com/camunda-community-hub/camunda-platform-7-custom-batch/actions/workflows/build.yml"]
// license
image::https://img.shields.io/badge/License-Apache%202.0-blue.svg[link="./LICENSE"]
// mvn central
image::https://maven-badges.herokuapp.com/maven-central/org.camunda.community.batch/camunda-platform-7-custom-batch-core/badge.svg[link="https://maven-badges.herokuapp.com/maven-central/org.camunda.community.batch/camunda-platform-7-custom-batch-core"]
,====

The goal of this camunda extension is to provide an simple way of using the camunda batch functionality.
Camunda Batch could be used to split a huge workload into small asynchronous jobs.
With this extension, we want to open the camunda batch functionality to everyone.

## Why should I use this extension

Camunda batch is really cool for offloading huge workload into small asynchronous pieces of work. E.g.:

* Unclaiming / Updating a huge list of camunda tasks
* Call APIs with batches of data
* Distribution of emails
* Technical stuff like clean-up

## Get started

The extension will be published on maven central, so if you are using maven, just add the dependency:

Maven Users:

```xml

org.camunda.community.batch
camunda-platform-7-custom-batch-core
1.20.1

```

Gradle Users:

```kotlin
compile("org.camunda.community.batch:camunda-platform-7-custom-batch-core:1.20.1")
```

First you have to define an own job handler for working on the single batch data:

```java
@Component
public class PrintStringBatchJobHandler extends CustomBatchJobHandler {
@Override
public void execute(List data, CommandContext commandContext) {
data.forEach(dataEntry -> logger.info("Work on data entry: " + dataEntry));
}

@Override
public String getType() {
return "print-string-batch-handler";
}
}
```

Next you have to notify the engine about this job handler, e.g. with spring-boot:

```java
@Bean
public ProcessEnginePlugin customBatchHandlerPlugin(PrintStringBatchJobHandler printStringBatchJobHandler) {
return CustomBatchHandlerPlugin.of(printStringBatchJobHandler);
}
```

Finally, the creation of the batch itself:

```java
CustomBatchBuilder.of(listOfStringData)
.jobHandler(printStringBatchJobHandler)
.create();
```

Or with more configuration:

```java
CustomBatchBuilder.of(listOfStringData)
.configuration(engineConfiguration)
.jobHandler(printStringBatchJobHandler)
.jobsPerSeed(10)
.jobPriority(0L)
.invocationsPerBatchJob(5)
.exclusive(true)
.create(engineConfiguration.getCommandExecutorTxRequired());
```

Note: The batch `jobPriority` is only considered when using Job Executor with the corresponding Acquisition Strategy `jobExecutorAcquireByPriority`. (see _https://docs.camunda.org/manual/latest/user-guide/process-engine/the-job-executor/#job-acquisition[camunda documentation]_)
The seed and monitor jobs receive the same priority as the batch.

## Versions

### 1.20.1

* BREAKING CHANGE: Update to use latest camunda version (7.20) + Spring Boot 3

### 1.19.4

* Update to use latest camunda version (7.19)

### 1.18.0

* Update to use latest camunda version (7.18)
* New version schema ... minor version number should always reflect the camunda number.

### 1.6.0

* Update to use latest camunda version (7.17) + spring boot (2.6.3)
* *BREAKING CHANGE:* java package path changed from `org.camunda.bpm.extension.batch` to `org.camunda.community.batch`
* *ATTENTION:* new maven coordinates!
```
org.camunda.community.batch
camunda-platform-7-custom-batch-core
```

### 1.5.2

* Update to use latest camunda version (7.15)

### 1.5.1

* Update to use latest camunda version (7.14)

### 1.5

* BREAKING CHANGES: This version is needed to be compatible with Camunda Version 7.13! (It will NOT work with with lower camunda versions)

### 1.4

* Use gson as json converter to be compatible with camunda release 7.11

### 1.3

* Batch Configuration gets now saved as json, but it's still possible to work on "old" batches because the extension is downwards compatible
* It's now possible to set exclusive flag for batch jobs (see _https://docs.camunda.org/manual/7.9/user-guide/process-engine/the-job-executor/#exclusive-jobs[Camunda Job Docs]_)

### 1.2

* Batch Job priority could be set

## Roadmap

**todo**

- Provide a data collector class
- Provide a timer job for automatically triggering of batch creation

## Resources

* link:./extension/README.adoc[User Guide]

* _https://github.com/camunda-community-hub/camunda-platform-7-custom-batch/issues[Issue Tracker]_

* _https://forum.camunda.org/c/community-extensions/custom-batch[Discussion Forum]_

* _https://docs.camunda.org/manual/latest/user-guide/process-engine/batch/[Camunda Batch Docs]_

* link:./CONTRIBUTING.md[Contributing] - check this if you want to contribute

## Maintainer

* [Patrick Schalk](_https://github.com/pschalk_) - [Holisticon AG](_http://www.holisticon.de/_)
* [Stefan Becke](_https://github.com/stefanbecke_) - [Kühne + Nagel](_https://home.kuehne-nagel.com/_)

## Contributors

* [Jan Galinski](https://github.com/jangalinski) - [Holisticon AG](_http://www.holisticon.de/_)
* [Nils Ernsting](https://github.com/nernsting) - [Holisticon AG](_http://www.holisticon.de/_)
* [Stefan Zilske](https://github.com/stefanzilske) - [Holisticon AG](_http://www.holisticon.de/_)

## Sponsor

image::./docs/sponsor_kn.jpeg[alt="Logo"]
_https://home.kuehne-nagel.com/[Kühne + Nagel]_

## License

Apache License, Version 2.0