/zeebe-dmn-worker

Zeebe worker for DMN decision evaluation

Primary LanguageJavaApache License 2.0Apache-2.0

zeebe-dmn-worker

License

A Zeebe worker to evaluate DMN decisions (i.e. business rule tasks). It uses the Camunda DMN engine including the FEEL-Scala engine to evaluate DMN decisions. The DMN files are read from a local directory.

Usage

Example BPMN with service task:

<bpmn:serviceTask id="decisionTask" name="Eval DMN decision">
  <bpmn:extensionElements>
    <zeebe:taskDefinition type="DMN" />
    <zeebe:taskHeaders>
      <zeebe:header key="decisionRef" value="dish-decision" />
    </zeebe:taskHeaders>
    <zeebe:ioMapping>
      <zeebe:output source="result" target="decisionResult" />
    </zeebe:ioMapping>
  </bpmn:extensionElements>
</bpmn:serviceTask>
  • the worker is registered for the type DMN
  • required custom headers:
    • decisionRef - the id of the decision to evaluate
  • the result of the evaluation is passed as result variable

Install

Docker

The docker image for the worker is published to GitHub Packages.

docker pull ghcr.io/camunda-community-hub/zeebe-dmn-worker:1.0.0
  • configure the connection to the Zeebe broker by setting zeebe.client.broker.contactPoint (default: localhost:26500)
  • configure the folder where the DMN files are located by setting zeebe.client.worker.dmn.repository (default: dmn-repo)

For a local setup, the repository contains a docker-compose file. It starts a Zeebe broker and the worker.

cd docker
docker-compose up

Manual

  1. Download the latest worker JAR (zeebe-dmn-worker-%{VERSION}.jar )

  2. Start the worker java -jar zeebe-dmn-worker-{VERSION}.jar

Configuration

The worker is a Spring Boot application that uses the Spring Zeebe Starter. The configuration can be changed via environment variables or an application.yaml file. See also the following resources:

By default, the DMN files are read from the folder dmn-repo next to the application (i.e. the working directory).

zeebe:
  client:
    worker:
      defaultName: camunda-dmn-worker
      defaultType: DMN
      threads: 3
    
      dmn.repository: dmn-repo

    job.timeout: 10000
    broker.contactPoint: 127.0.0.1:26500
    security.plaintext: true

Build from Source

Build with Maven

mvn clean install

Code of Conduct

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to code-of-conduct@zeebe.io.