The extension will be published on maven central, so if you are using maven, just add the dependency:
<dependency>
<groupId>org.camunda.bpm.extension.batch.project</groupId>
<artifactId>camunda-bpm-custom-batch-core</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
First you have to define an own job handler for working on the single batch data:
@Component
public class SimpleCustomBatchJobHandler extends CustomBatchJobHandler<String> {
@Override
public void execute(List<String> data, CommandContext commandContext) {
logger.info("Work on data: {}", data.get(0));
}
@Override
public String getType() {
return "simple-batch-handler";
}
}
Next you have to notify the engine about this job handler, e.g. with spring-boot:
@Bean
public ProcessEnginePlugin customBatchHandlerPlugin(SimpleCustomBatchJobHandler simpleCustomBatchJobHandler) {
return new CustomBatchHandlerPlugin(Collections.singletonList(simpleCustomBatchJobHandler));
}
Finally, the creation of the batch itself:
CustomBatchBuilder.of(listOfStringData)
.jobHandler(simpleCustomBatchJobHandler)
.create();
-
Contributing - check this if you want to contribute
todo
-
Provide a data collector class
-
Provide a timer job for automatically triggering of batch creation.
done
-
Provide initial version