This module adds Drools DRL support to Camunda BPMS
- Execution of DRL files from BPMN
- Maven is required for building this module
- Open your project's pom
- Add the reference to the artezio mvn repository:
<repository> <id>artezio</id> <url>https://nexus.artezio.net/repository/maven-releases</url> </repository>
- Add the dependency:
<dependency> <groupId>com.artezio.bpm.camunda</groupId> <artifactId>bpms-drools</artifactId> <version>${bpm-drools.version}</version> </dependency>
- Add DRL files to your Process Application archive (e.g.
src/main/resources/rule1.drl,src/main/resources/rule2.drl) - In BPMN diagram create a Delegate Expression Service task and point it to
com.artezio.bpm.integration.drools.DroolsDelegateclass (${droolsDelegate}delegate expression when using CDI) - Input. Provide the following input params:
rules- List of input rule filenames within the deployment, e.g.rule1.drl,rule2.drlfacts- List of facts that will be inserted into Drools Working memory
- Output. The following local variables are created in the task after evaluating all rules and are available for output mapping:
facts- List of objects in the final state of Working memory after firing all rulesinserted- List of objects that were inserted into Working memory during rules evaluationupdated- List of objects that were updated in Working memory during rules evaluationdeleted- List of objects that were deleted from Working memory during rules evaluation
- To map local task variable to global process variable you could for example create task output parameter of type
textand specify#{inserted}as value. The variable is then populated withListof inserted objects, despite being marked astext - Deploy the Process Application archive and run the process. DRL files will be executed when the Service task is run