Browse Source

initial import

Grega Bremec 3 years ago
commit
c9b8a81140
38 changed files with 3924 additions and 0 deletions
  1. 5 0
      .gitignore
  2. 107 0
      pom.xml
  3. 62 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/UseRemoteKieArtifact.java
  4. 14 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/beans/GenerateCustomer.java
  5. 66 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithFacts.java
  6. 76 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithListParams.java
  7. 87 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithListSubProcess.java
  8. 66 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithParams.java
  9. 66 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithParamsOnly.java
  10. 63 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/AgendaGroupsRightOrderLog.java
  11. 65 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/AgendaGroupsWrongOrderLog.java
  12. 47 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/AssertAndQueryFacts.java
  13. 47 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/FactIntegrityMultiple.java
  14. 35 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/FactIntegritySingle.java
  15. 43 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/SimpleMatch.java
  16. 45 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseRestEasyManualClient.java
  17. 45 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseRestEasyProxyClient.java
  18. 47 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseRestServiceTask.java
  19. 42 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseSimpleJavaBeanService.java
  20. 25 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/ws_client/CustomerServiceClient.java
  21. 21 0
      src/main/java/net/p0f/samples/rhpam_fuse_integration/ws_client/CustomerServiceProxy.java
  22. 38 0
      src/main/resources/META-INF/kmodule.xml
  23. 90 0
      src/main/resources/net/p0f/samples/rules_processes/agenda/right/agenda-groups.drl
  24. 84 0
      src/main/resources/net/p0f/samples/rules_processes/agenda/wrong/no-agenda-groups.drl
  25. 28 0
      src/main/resources/net/p0f/samples/rules_processes/facts/loyalty-awards.drl
  26. 20 0
      src/main/resources/net/p0f/samples/rules_processes/integrity/integrity.drl
  27. 238 0
      src/main/resources/net/p0f/samples/rules_processes/ruleflow/RulesRulesRules.bpmn2
  28. 88 0
      src/main/resources/net/p0f/samples/rules_processes/ruleflow/ruleflow-groups.drl
  29. 238 0
      src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/RulesRulesRules.bpmn2
  30. 240 0
      src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/RulesWithListParams.bpmn2
  31. 551 0
      src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/RulesWithListSubProc.bpmn2
  32. 88 0
      src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/ruleflow-groups.drl
  33. 272 0
      src/main/resources/net/p0f/samples/rules_processes/service_tasks/BpmnRestTask.bpmn2
  34. 243 0
      src/main/resources/net/p0f/samples/rules_processes/service_tasks/JavaBeanServiceTask.bpmn2
  35. 244 0
      src/main/resources/net/p0f/samples/rules_processes/service_tasks/JavaRestClientServiceTask.bpmn2
  36. 244 0
      src/main/resources/net/p0f/samples/rules_processes/service_tasks/JavaRestProxyServiceTask.bpmn2
  37. 71 0
      src/main/resources/net/p0f/samples/rules_processes/service_tasks/rules.drl
  38. 73 0
      src/main/resources/net/p0f/samples/rules_processes/simple/simple-matching.drl

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+.project
+.classpath
+.settings
+.*.swp
+target

+ 107 - 0
pom.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<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 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<groupId>net.p0f.samples.rhpam-fuse-integration</groupId>
+	<artifactId>kie-rules-processes</artifactId>
+	<version>1.0.0</version>
+	<packaging>jar</packaging>
+
+	<properties>
+	  	<maven.compiler.source>1.8</maven.compiler.source>
+	  	<maven.compiler.target>1.8</maven.compiler.target>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+	</properties>
+
+	<dependencyManagement>
+		<dependencies>
+		
+			<dependency>
+				<groupId>org.jboss.bom</groupId>
+				<artifactId>jboss-eap-javaee7-with-tools</artifactId>
+				<version>7.1.6.GA</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+ 			<dependency>
+				<groupId>org.drools</groupId>
+				<artifactId>drools-bom</artifactId>
+				<version>7.52.0.Final-redhat-00008</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+			<dependency>
+				<groupId>org.jbpm</groupId>
+				<artifactId>jbpm-bom</artifactId>
+				<version>7.52.0.Final-redhat-00008</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.kie</groupId>
+			<artifactId>kie-api</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.kie</groupId>
+			<artifactId>kie-ci</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.drools</groupId>
+			<artifactId>drools-core</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.drools</groupId>
+			<artifactId>drools-compiler</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jbpm</groupId>
+			<artifactId>jbpm-bpmn2</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jbpm</groupId>
+			<artifactId>jbpm-workitems-core</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jbpm</groupId>
+			<artifactId>jbpm-workitems-rest</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.resteasy</groupId>
+			<artifactId>resteasy-client</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.resteasy</groupId>
+			<artifactId>resteasy-jackson2-provider</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.resteasy</groupId>
+			<artifactId>resteasy-jaxb-provider</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-core</artifactId>
+			<version>2.12.5</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-annotations</artifactId>
+			<version>2.12.5</version>
+		</dependency>
+	  	<dependency>
+		    <groupId>net.p0f.samples.rhpam-fuse-integration</groupId>
+		    <artifactId>shared-data-model</artifactId>
+		    <version>1.0.0</version>
+	  	</dependency>
+	  	<dependency>
+		    <groupId>net.p0f.samples.rhpam-fuse-integration</groupId>
+		    <artifactId>ws-customer-data</artifactId>
+		    <version>1.0.0</version>
+	  	</dependency>
+	</dependencies>
+</project>
+

+ 62 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/UseRemoteKieArtifact.java

@@ -0,0 +1,62 @@
+package net.p0f.samples.rhpam_fuse_integration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.kie.api.KieServices;
+import org.kie.api.builder.KieScanner;
+import org.kie.api.builder.ReleaseId;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+// To run this class, you will need to have created a RHPAM project called
+// pam-simple-process (or import one from a Git repository, feel free to
+// fork the one I shared), then make it available to Maven somehow (either
+// by adding internal artifact repository from RHPAM to settings.xml or by
+// building the KJAR and installing it; note that in dev mode, RHPAM will
+// install artifacts to local Maven repository of its owning user anyway).
+//
+// NOTE: both this project and the RHPAM one depend on shared-data-model.
+public class UseRemoteKieArtifact {
+	public static void main(String... args) {
+		// Create a reference to GAV item (need kie-ci dependency for this!)
+		//
+		// NOTE: with the packaging of kjar, LATEST or RELEASE pseudo-versions can't be used.
+		ReleaseId artifact = KieServices.Factory.get().newReleaseId("net.p0f.samples.rhpam-fuse-integration", "pam-simple-process", "1.0.0-SNAPSHOT");
+
+		// Create a generic container referencing that release:
+		KieContainer c = KieServices.Factory.get().newKieContainer(artifact);
+
+		// It is possible to automatically update the above periodically (10 minutes in
+		// this case):
+		KieScanner ks = KieServices.Factory.get().newKieScanner(c);
+		ks.start(600000);
+
+		// Create a new session containing artifacts from the remote repository.
+		// NOTE: ANY SUBSEQUENT KB UPDATES ARE NOT VISIBLE TO THIS SESSION!
+		KieSession s = c.newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(10);
+		c1.setMilesFlown(15000);
+
+		Award a1 = new Award();
+		a1.setCarrier(c1);
+
+		Map<String, Object> p = new HashMap<String, Object>();
+		p.put("customer", c1);
+		p.put("award", a1);
+
+		s.startProcess("pam-simple-process.SayHello", p);
+
+		s.fireAllRules();
+
+		s.dispose();
+	}
+}

+ 14 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/beans/GenerateCustomer.java

@@ -0,0 +1,14 @@
+package net.p0f.samples.rhpam_fuse_integration.beans;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+import net.p0f.samples.rhpam_fuse_integration.ws_rs.customer.CustomerServiceImpl;
+
+public class GenerateCustomer {
+	public Customer getCustomer(Integer id) {
+		// Just use CustomerServiceImpl as a "local" bean instance.
+		//
+		// NOTE: This adds a dependency to ws-customer-data, in addition to
+		// shared-data-model.
+		return new CustomerServiceImpl().getCustomer(id);
+	}
+}

+ 66 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithFacts.java

@@ -0,0 +1,66 @@
+package net.p0f.samples.rhpam_fuse_integration.processes;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class ProcessWithFacts {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+
+		// Instantiate the ruleflow KB and its default session.
+		KieSession s = c.getKieBase("ruleflow").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(10);
+		c1.setMilesFlown(15000);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setMilesFlown(75000);
+		c2.setLoyaltyAge(10);
+
+		Award a1 = null;
+		Award a2 = null;
+
+		// option 1: insert facts into working memory (INVISIBLE TO PROCESS)
+		s.insert(c1);
+		s.insert(c2);
+		s.insert(a1);
+		s.insert(a2);
+
+		// Process ID does not have to follow package naming convention.
+		//
+		// HOWEVER: While rules are loaded regardless of their location in the
+		// filesystem, and the "package" keyword decides which KBs will see them or not,
+		// process models MUST be in the correct location in the filesystem (iow, if the
+		// directory path does not equal the package of the process, including
+		// underscores in package names, the KieContainer will not load it into the KB).
+		s.startProcess("ruleflow.RulesRulesRules");
+		s.fireAllRules();
+
+		System.out.println("******** Examining Working Memory ********");
+
+		// Note that the rule engine sees the customers, awards are given, even the
+		// "Rule" language condition in the diverging gateway matches, but the last
+		// task can't see a single customer to congratulate, because it's trying to use
+		// a process variable, which is not what was modified by the rules.
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award) qrr.get("award");
+			System.out.println("Found award: " + award.toString());
+		}
+
+		s.dispose();
+	}
+}

+ 76 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithListParams.java

@@ -0,0 +1,76 @@
+package net.p0f.samples.rhpam_fuse_integration.processes;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class ProcessWithListParams {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		
+		// Instantiate the ruleflowParams KB and its default session.
+		KieSession s = c.getKieBase("ruleflowParams").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(10);
+		c1.setMilesFlown(15000);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setLoyaltyAge(10);
+		
+		Award a1 = new Award();
+		Award a2 = new Award();
+
+		// Wrapped types don't match the rule conditions.
+		List<Customer> customers = new ArrayList<>();
+		List<Award> awards = new ArrayList<>();
+		
+		customers.add(c1);
+		customers.add(c2);
+		
+		awards.add(a1);
+		awards.add(a2);
+
+		Map<String, Object> p = new HashMap<>();
+		p.put("customers", customers);
+		p.put("awards", awards);
+
+		s.startProcess("ruleflow.RulesWithListParams", p);
+		s.fireAllRules();
+
+		System.out.println("******** Examining Working Memory ********");
+
+		// This time around, no Award facts are found in working memory...
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award) qrr.get("award");
+			System.out.println("Found award: " + award.toString());
+		}
+
+		System.out.println("******** Examining Process Parameters ********");
+
+		// ...and neither do the Award objects get updated.
+		System.out.println("Customers: " + customers);
+		System.out.println("Awards: " + awards);
+
+		// An ugly way of addressing this can be seen in ProcessWithListSubProcess
+		s.dispose();
+
+	}
+}

+ 87 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithListSubProcess.java

@@ -0,0 +1,87 @@
+package net.p0f.samples.rhpam_fuse_integration.processes;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class ProcessWithListSubProcess {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+
+		// Instantiate the ruleflowParams KB and its default session.
+		KieSession s = c.getKieBase("ruleflowParams").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(10);
+		c1.setMilesFlown(15000);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setMilesFlown(45000);
+		c2.setLoyaltyAge(10);
+
+		Award a1 = new Award();
+		a1.setCarrier(c1);
+		Award a2 = new Award();
+		a2.setCarrier(c2);
+
+		// Wrapped types don't match the rule conditions, but see the process model!
+		List<Customer> customers = new ArrayList<>();
+		List<Award> awards = new ArrayList<>();
+
+		customers.add(c1);
+		customers.add(c2);
+
+		awards.add(a1);
+		awards.add(a2);
+
+		Map<String, Object> p = new HashMap<>();
+		p.put("customers", customers);
+		p.put("awards", awards);
+
+		// In this process model, we're using a hybrid approach: there are two embedded
+		// multi-instance sub-processes, each of which is responsible for iterating over
+		// one of the list parameters and registering its contents as facts.
+		// This also has an important consequence how the results are processed in the
+		// rules, and how we process the outcome (congratulations "task" is another
+		// multi-instance sub-process).
+		// As said, it is ugly and non-portable though, because of the script tasks.
+		s.startProcess("ruleflow.RulesWithListSubProc", p);
+		s.fireAllRules();
+
+		System.out.println("******** Examining Working Memory ********");
+
+		// One benefit, if anything, is that the results are available both as facts in
+		// working memory...
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award) qrr.get("award");
+			System.out.println("Found award: " + award.toString());
+		}
+
+		System.out.println("******** Examining Process Parameters ********");
+
+		// ...and thanks to pass-by-reference, they also get updated in the respective
+		// process parameter lists.
+		System.out.println("Customers: " + customers);
+		System.out.println("Awards: " + awards);
+
+		s.dispose();
+
+	}
+}

+ 66 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithParams.java

@@ -0,0 +1,66 @@
+package net.p0f.samples.rhpam_fuse_integration.processes;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class ProcessWithParams {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+
+		// Instantiate the ruleflow KB and its default session.
+		KieSession s = c.getKieBase("ruleflow").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("Jane Doe");
+		c1.setAge(35);
+		// Deliberately not setting LL
+		// c1.setLoyaltyLevel(Customer.PLATINUM);
+		c1.setMilesFlown(45000);
+		c1.setLoyaltyAge(10);
+
+		Award a1 = new Award();
+
+		// Option 2: Pass facts as parameters.
+		Map<String, Object> params = new HashMap<>();
+		params.put("customer", c1);
+		params.put("award", a1);
+
+		// Process ID does not have to follow package naming convention.
+		//
+		// HOWEVER: While rules are loaded regardless of their location in the
+		// filesystem, and the "package" keyword decides which KBs will see them or not,
+		// process models MUST be in the correct location in the filesystem (iow, if the
+		// directory path does not equal the package of the process, including
+		// underscores in package names, the KieContainer will not load it into the KB).
+		s.startProcess("ruleflow.RulesRulesRules", params);
+		s.fireAllRules();
+
+		System.out.println("******** Examining Working Memory ********");
+
+		// See below.
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award) qrr.get("award");
+			System.out.println("Found award: " + award.toString());
+		}
+
+		System.out.println("******** Examining Process Parameters ********");
+
+		// Note that with the way rules are written in this example, an existing process
+		// parameter of type Award does NOT get modified - one has to write rules
+		// differently for that, see the ruleflow_params package examples for that.
+		System.out.println("Customer: " + c1);
+		System.out.println("Award: " + a1);
+
+		s.dispose();
+	}
+}

+ 66 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/processes/ProcessWithParamsOnly.java

@@ -0,0 +1,66 @@
+package net.p0f.samples.rhpam_fuse_integration.processes;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class ProcessWithParamsOnly {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+
+		// Instantiate the ruleflowParams KB and its default session.
+		KieSession s = c.getKieBase("ruleflowParams").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("Jane Doe");
+		c1.setAge(35);
+		// Deliberately not setting LL
+		// c1.setLoyaltyLevel(Customer.PLATINUM);
+		c1.setMilesFlown(45000);
+		c1.setLoyaltyAge(10);
+
+		Award a1 = new Award();
+		a1.setCarrier(c1);
+
+		Map<String, Object> params = new HashMap<>();
+		params.put("customer", c1);
+		params.put("award", a1);
+
+		// Process ID does not have to follow package naming convention.
+		//
+		// HOWEVER: While rules are loaded regardless of their location in the
+		// filesystem, and the "package" keyword decides which KBs will see them or not,
+		// process models MUST be in the correct location in the filesystem (iow, if the
+		// directory path does not equal the package of the process, including
+		// underscores in package names, the KieContainer will not load it into the KB).
+		s.startProcess("ruleflow.RulesRulesRules", params);
+		s.fireAllRules();
+
+		System.out.println("******** Examining Working Memory ********");
+
+		// This time around, no Award facts are found in working memory...
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award) qrr.get("award");
+			System.out.println("Found award: " + award.toString());
+		}
+		// ...consequently the "Congratulations" task does not see an Award and does not
+		// activate, we should use the process variable "award" in the condition...
+
+		System.out.println("******** Examining Process Parameters ********");
+
+		// ...however, the Award parameter object does get correctly updated.
+		System.out.println("Customer: " + c1);
+		System.out.println("Award: " + a1);
+
+		s.dispose();
+	}
+}

+ 63 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/AgendaGroupsRightOrderLog.java

@@ -0,0 +1,63 @@
+package net.p0f.samples.rhpam_fuse_integration.rules;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class AgendaGroupsRightOrderLog {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		
+		// Instantiate the agenda KB and its default session.
+		KieSession s = c.getKieBase("agendaRight").newKieSession();
+
+		// Ensure agenda group activation in correct order (stack!)
+		s.getAgenda().getAgendaGroup("awards").setFocus(); 		// third
+		s.getAgenda().getAgendaGroup("promotion").setFocus(); 	// second
+		s.getAgenda().getAgendaGroup("status").setFocus(); 		// first
+
+		// Instantiate a logger and make it available to the rule engine.
+		Logger foo = Logger.getLogger(AgendaGroupsRightOrderLog.class.getName());
+		s.setGlobal("globalLogger", foo);
+
+		// Create some customers (wrong loyalty levels!)
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setMilesFlown(15000);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(5);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setMilesFlown(75000);
+		// Deliberately not setting LL
+		//c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setLoyaltyAge(10);
+
+		s.insert(c1);
+		s.insert(c2);
+
+		s.fireAllRules();
+
+		foo.log(Level.INFO, "******** Examining Working Memory ********");
+
+		// This correctly reports a 10y/PLATINUM award for Jane Doe and nothing else.
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award)qrr.get("award");
+			foo.log(Level.INFO, "Found award : " + award.toString());
+		}
+
+		s.dispose();
+	}
+}

+ 65 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/AgendaGroupsWrongOrderLog.java

@@ -0,0 +1,65 @@
+package net.p0f.samples.rhpam_fuse_integration.rules;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class AgendaGroupsWrongOrderLog {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+
+		// Instantiate the agenda KB and its default session.
+		KieSession s = c.getKieBase("agendaWrong").newKieSession();
+
+		// Instantiate a logger and make it available to the rule engine.
+		Logger foo = Logger.getLogger(AgendaGroupsWrongOrderLog.class.getName());
+		s.setGlobal("globalLogger", foo);
+
+		// Create some customers (wrong loyalty levels!)
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setMilesFlown(15000);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(5);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setMilesFlown(75000);
+		// Deliberately not setting LL
+		// c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setLoyaltyAge(10);
+
+		s.insert(c1);
+		s.insert(c2);
+
+		// Without agenda groups, activation is in wrong order. Infact, it ends up being
+		// an infinite loop of activations that can not be prevented without rule
+		// grouping. Either agenda-, ruleflow-, or activation-group must be employed to
+		// fix this. There is no other way to prevent it.
+		s.fireAllRules();
+
+		foo.log(Level.INFO, "******** Examining Working Memory ********");
+
+		// If the above was to not be an infinite loop, this would erroneously report a
+		// 5yrs/GOLD award for John Doe (although he'd be back to BRONZE as his mileage
+		// is too low, after being shortly promoted to PLATINUM), and would not report
+		// an award for Jane, although she should have her 10 PLATINUM years recognised.
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award) qrr.get("award");
+			foo.log(Level.INFO, "Found award : " + award.toString());
+		}
+
+		s.dispose();
+	}
+}

+ 47 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/AssertAndQueryFacts.java

@@ -0,0 +1,47 @@
+package net.p0f.samples.rhpam_fuse_integration.rules;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.rule.QueryResults;
+import org.kie.api.runtime.rule.QueryResultsRow;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class AssertAndQueryFacts {
+	public static void main(String... args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		
+		// Instantiate the awards KB and its default session.
+		KieSession s = c.getKieBase("awards").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(5);
+		c1.setMilesFlown(15000);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setLoyaltyAge(10);
+
+		s.insert(c1);
+		s.insert(c2);
+
+		s.fireAllRules();
+
+		System.out.println("******** Examining Working Memory ********");
+
+		QueryResults qr = s.getQueryResults("Get Awards");
+		for (QueryResultsRow qrr : qr) {
+			Award award = (Award)qrr.get("award");
+			System.out.println("Found award: " + award.toString());
+		}
+
+		s.dispose();
+	}
+}

+ 47 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/FactIntegrityMultiple.java

@@ -0,0 +1,47 @@
+package net.p0f.samples.rhpam_fuse_integration.rules;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class FactIntegrityMultiple {
+
+	public static void main(String[] args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		KieSession s = c.getKieBase("integrity").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(10);
+		c1.setMilesFlown(15000);
+
+		Award a1 = new Award("Hey, John!");
+		a1.setCarrier(c1);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setLoyaltyAge(15);
+		c2.setMilesFlown(75000);
+
+		Award a2 = new Award("Congratulations, Jane!");
+		a2.setCarrier(c2);
+
+		s.insert(c1);
+		s.insert(a1);
+		s.insert(c2);
+		s.insert(a2);
+
+		// This incorrectly prints award/customer combo multiple times for the wrong matching type.
+		s.fireAllRules();
+		
+		s.dispose();
+	}
+
+}

+ 35 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/FactIntegritySingle.java

@@ -0,0 +1,35 @@
+package net.p0f.samples.rhpam_fuse_integration.rules;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class FactIntegritySingle {
+
+	public static void main(String[] args) {
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		KieSession s = c.getKieBase("integrity").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(10);
+		c1.setMilesFlown(15000);
+
+		Award a1 = new Award("Hey, John!");
+		a1.setCarrier(c1);
+
+		s.insert(c1);
+		s.insert(a1);
+
+		// This correctly prints award/customer combo, as expected.
+		s.fireAllRules();
+		
+		s.dispose();
+	}
+
+}

+ 43 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/rules/SimpleMatch.java

@@ -0,0 +1,43 @@
+package net.p0f.samples.rhpam_fuse_integration.rules;
+
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class SimpleMatch {
+
+	public static void main(String[] args) {
+		// Ask for a ClasspathContainer (locally bundled assets)
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		
+		// Ask for a named Knowledge Base only containing the simple rules
+		// (configured in META-INF/kmodule.xml)
+		KieSession s = c.getKieBase("simple").newKieSession();
+
+		Customer c1 = new Customer();
+		c1.setName("John Doe");
+		c1.setAge(27);
+		c1.setLoyaltyLevel(Customer.GOLD);
+		c1.setLoyaltyAge(10);
+		c1.setMilesFlown(15000);
+
+		Customer c2 = new Customer();
+		c2.setName("Jane Doe");
+		c2.setAge(35);
+		c2.setLoyaltyLevel(Customer.PLATINUM);
+		c2.setLoyaltyAge(10);
+
+		// Insert the facts into working memory.
+		s.insert(c1);
+		s.insert(c2);
+		
+		// Let the rules fire.
+		s.fireAllRules();
+		
+		// Clean up (destroy() is only relevant to persistent sessions).
+		s.dispose();
+	}
+
+}

+ 45 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseRestEasyManualClient.java

@@ -0,0 +1,45 @@
+package net.p0f.samples.rhpam_fuse_integration.use_rest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.bpmn2.handler.ServiceTaskHandler;
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class UseRestEasyManualClient {
+	public static void main(String... args) {
+		// As usual - create a session from a classpath KieBase.
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		KieSession s = c.getKieBase("serviceTasks").newKieSession();
+
+		// For any kind of service tasks, a WIH needs to be registered.
+		s.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());
+
+		// The two DOM instances are just placeholders to store results into.
+		Customer c1 = new Customer();
+		Award a1 = new Award();
+		
+		// This is the "real" input parameter.
+		Integer id = Integer.valueOf(3254426);
+
+		Map<String, Object> p = new HashMap<String, Object>();
+		p.put("customer", c1);
+		p.put("award", a1);
+		p.put("customerId", id);
+
+		// This model's interface refers to the CustomerServiceClient bean.
+		//
+		// Not exactly easily configurable, short of creating a custom WorkItemHandler
+		// that supports the required parameters.
+		s.startProcess("servicetasks.JavaRestClientServiceTask", p);
+
+		s.fireAllRules();
+
+		s.dispose();
+	}
+}

+ 45 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseRestEasyProxyClient.java

@@ -0,0 +1,45 @@
+package net.p0f.samples.rhpam_fuse_integration.use_rest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.bpmn2.handler.ServiceTaskHandler;
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class UseRestEasyProxyClient {
+	public static void main(String... args) {
+		// As usual - create a session from a classpath KieBase.
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		KieSession s = c.getKieBase("serviceTasks").newKieSession();
+
+		// For any kind of service tasks, a WIH needs to be registered.
+		s.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());
+
+		// The two DOM instances are just placeholders to store results into.
+		Customer c1 = new Customer();
+		Award a1 = new Award();
+		
+		// This is the "real" input parameter.
+		Integer id = Integer.valueOf(3254426);
+
+		Map<String, Object> p = new HashMap<String, Object>();
+		p.put("customer", c1);
+		p.put("award", a1);
+		p.put("customerId", id);
+
+		// This model's interface refers to the CustomerServiceProxy bean.
+		//
+		// Not exactly easily configurable, short of creating a custom WorkItemHandler
+		// that supports the required parameters.
+		s.startProcess("servicetasks.JavaRestProxyServiceTask", p);
+
+		s.fireAllRules();
+
+		s.dispose();
+	}
+}

+ 47 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseRestServiceTask.java

@@ -0,0 +1,47 @@
+package net.p0f.samples.rhpam_fuse_integration.use_rest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.process.workitem.rest.RESTWorkItemHandler;
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class UseRestServiceTask {
+	public static void main(String... args) {
+		// As usual - create a session from a classpath KieBase.
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		KieSession s = c.getKieBase("serviceTasks").newKieSession();
+
+		// For any kind of service tasks, a WIH needs to be registered.
+		s.getWorkItemManager().registerWorkItemHandler("Rest", new RESTWorkItemHandler());
+
+		// The two DOM instances are just placeholders to store results into.
+		Customer c1 = new Customer();
+		Award a1 = new Award();
+		
+		// This is the "real" input parameter.
+		Integer id = Integer.valueOf(3254426);
+
+		Map<String, Object> p = new HashMap<String, Object>();
+		p.put("customer", c1);
+		p.put("award", a1);
+		p.put("customerId", id);
+
+		// This model's interface refers to the CustomerServiceProxy bean.
+		//
+		// Configuration is in the REST task parameters. Unfortunately a generic task
+		// (without a taskName attribute) won't link with the above WIH, so an attribute
+		// of taskName="Rest" must be added manually (and confuses the BPMN modeler
+		// which promptly removes it every time).
+		s.startProcess("servicetasks.BpmnRestTask", p);
+
+		s.fireAllRules();
+
+		s.dispose();
+	}
+}

+ 42 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/use_rest/UseSimpleJavaBeanService.java

@@ -0,0 +1,42 @@
+package net.p0f.samples.rhpam_fuse_integration.use_rest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.bpmn2.handler.ServiceTaskHandler;
+import org.kie.api.KieServices;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award;
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class UseSimpleJavaBeanService {
+	public static void main(String... args) {
+		// As usual - create a session from a classpath KieBase.
+		KieContainer c = KieServices.Factory.get().getKieClasspathContainer();
+		KieSession s = c.getKieBase("serviceTasks").newKieSession();
+
+		// For any kind of service tasks, a WIH needs to be registered.
+		s.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());
+
+		// The two DOM instances are just placeholders to store results into.
+		Customer c1 = new Customer();
+		Award a1 = new Award();
+		
+		// This is the "real" input parameter.
+		Integer id = Integer.valueOf(3254426);
+
+		Map<String, Object> p = new HashMap<String, Object>();
+		p.put("customer", c1);
+		p.put("award", a1);
+		p.put("customerId", id);
+
+		// This model's interface refers to the GenerateCustomer bean.
+		s.startProcess("servicetasks.JavaBeanServiceTask", p);
+
+		s.fireAllRules();
+
+		s.dispose();
+	}
+}

+ 25 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/ws_client/CustomerServiceClient.java

@@ -0,0 +1,25 @@
+package net.p0f.samples.rhpam_fuse_integration.ws_client;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+public class CustomerServiceClient {
+	public Customer getCustomer(Integer id) {
+		Client rc = ClientBuilder.newClient();
+
+		WebTarget wt = rc.target("http://localhost:9080/ws-customer-data/api/customers/" + id.toString());
+
+		System.out.println(wt.getUri());
+
+		Response r = wt.request(MediaType.APPLICATION_JSON).get();
+		
+		System.out.println(r.getMediaType() + ", " + r.getLength() + " bytes");
+
+		return(r.readEntity(Customer.class));
+	}
+}

+ 21 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/ws_client/CustomerServiceProxy.java

@@ -0,0 +1,21 @@
+package net.p0f.samples.rhpam_fuse_integration.ws_client;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+import net.p0f.samples.rhpam_fuse_integration.ws_rs.spec.CustomerService;
+
+public class CustomerServiceProxy {
+	public Customer getCustomer(Integer id) {
+		Client rc = ClientBuilder.newClient();
+
+		ResteasyWebTarget rwt = (ResteasyWebTarget)rc.target("http://localhost:9080/ws-customer-data/api");
+
+		CustomerService cs = rwt.proxy(CustomerService.class);
+
+		return(cs.getCustomer(id));
+	}
+}

+ 38 - 0
src/main/resources/META-INF/kmodule.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns="http://jboss.org/kie/6.0.0/kmodule">
+
+	<kbase name="default" default="true">
+		<ksession name="foo" default="true" />
+	</kbase>
+
+	<kbase name="simple" default="false" packages="net.p0f.samples.rules_processes.simple">
+		<ksession name="simpleSession" default="true" />
+	</kbase>
+
+	<kbase name="integrity" default="false" packages="net.p0f.samples.rules_processes.integrity">
+		<ksession name="integritySession" default="true" />
+	</kbase>
+
+	<kbase name="awards" default="false" packages="net.p0f.samples.rules_processes.facts">
+		<ksession name="awardSession" default="true" />
+	</kbase>
+
+	<kbase name="agendaWrong" default="false" packages="net.p0f.samples.rules_processes.agenda.wrong">
+		<ksession name="agendaWrSession" default="true" />
+	</kbase>
+	<kbase name="agendaRight" default="false" packages="net.p0f.samples.rules_processes.agenda.right">
+		<ksession name="agendaRiSession" default="true" />
+	</kbase>
+
+	<kbase name="ruleflow" default="false" packages="net.p0f.samples.rules_processes.ruleflow">
+		<ksession name="ruleflowSession" default="true" />
+	</kbase>
+	<kbase name="ruleflowParams" default="false" packages="net.p0f.samples.rules_processes.ruleflow_params">
+		<ksession name="ruleParamSession" default="true" />
+	</kbase>
+
+	<kbase name="serviceTasks" default="false" packages="net.p0f.samples.rules_processes.service_tasks">
+		<ksession name="taskSession" default="true" />
+	</kbase>
+</kmodule>

+ 90 - 0
src/main/resources/net/p0f/samples/rules_processes/agenda/right/agenda-groups.drl

@@ -0,0 +1,90 @@
+package net.p0f.samples.rules_processes.agenda.right
+
+import java.util.logging.Level
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+global java.util.logging.Logger globalLogger
+
+query "Get Awards"
+	award: Award()
+end
+
+rule "Reward 5 years of gold status"
+	agenda-group "awards"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge == 5)
+	then
+		Award a = new Award("Congrats for 5 years of GOLD!");
+		a.setCarrier($c);
+		insert(a);
+		globalLogger.log(Level.INFO, "Awarding 5 yrs of GOLD status.");
+end
+
+rule "Reward 10 years of platinum status"
+	agenda-group "awards"
+	when
+		$c: Customer(loyaltyLevel == Customer.PLATINUM, loyaltyAge == 10)
+	then
+		Award a = new Award("Congrats for 10 years of PLATINUM!");
+		a.setCarrier($c);
+		insert(a);
+		globalLogger.log(Level.INFO, "Awarding 10 yrs of PLATINUM status.");
+end
+
+rule "Promote over 5 years of gold status"
+	agenda-group "promotion"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge >= 5)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.PLATINUM);
+		}
+		globalLogger.log(Level.INFO, "Promoting " + $c.getName() + " to PLATINUM!"); 
+end
+
+
+rule "No Status"
+	agenda-group "status"
+	when
+		$c: Customer(milesFlown <= 10000, loyaltyLevel != Customer.NONE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.NONE);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Bronze Status"
+	agenda-group "status"
+	when
+		$c: Customer(milesFlown > 10000, milesFlown <= 20000, loyaltyLevel != Customer.BRONZE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.BRONZE);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Silver Status"
+	agenda-group "status"
+	when
+		$c: Customer(milesFlown > 20000, milesFlown <= 35000, loyaltyLevel != Customer.SILVER)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.SILVER);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Gold Status"
+	agenda-group "status"
+	when
+		$c: Customer(milesFlown > 35000, loyaltyLevel != Customer.GOLD)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.GOLD);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end

+ 84 - 0
src/main/resources/net/p0f/samples/rules_processes/agenda/wrong/no-agenda-groups.drl

@@ -0,0 +1,84 @@
+package net.p0f.samples.rules_processes.agenda.wrong
+
+import java.util.logging.Level
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+global java.util.logging.Logger globalLogger
+
+query "Get Awards"
+	award: Award()
+end
+
+rule "Reward 5 years of gold status"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge == 5)
+	then
+		Award a = new Award("Congrats for 5 years of GOLD!");
+		a.setCarrier($c);
+		insert(a);
+		globalLogger.log(Level.INFO, "Awarding 5 yrs of GOLD status.");
+end
+
+rule "Reward 10 years of platinum status"
+	when
+		$c: Customer(loyaltyLevel == Customer.PLATINUM, loyaltyAge == 10)
+	then
+		Award a = new Award("Congrats for 10 years of PLATINUM!");
+		a.setCarrier($c);
+		insert(a);
+		globalLogger.log(Level.INFO, "Awarding 10 yrs of PLATINUM status.");
+end
+
+rule "Promote over 5 years of gold status"
+	salience 10
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge >= 5)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.PLATINUM);
+		}
+		globalLogger.log(Level.INFO, "Promoting " + $c.getName() + " to PLATINUM!"); 
+end
+
+rule "No Status"
+	when
+		$c: Customer(milesFlown <= 10000, loyaltyLevel != Customer.NONE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.NONE);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Bronze Status"
+	when
+		$c: Customer(milesFlown > 10000, milesFlown <= 20000, loyaltyLevel != Customer.BRONZE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.BRONZE);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Silver Status"
+	when
+		$c: Customer(milesFlown > 20000, milesFlown <= 35000, loyaltyLevel != Customer.SILVER)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.SILVER);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Gold Status"
+	when
+		$c: Customer(milesFlown > 35000, loyaltyLevel != Customer.GOLD)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.GOLD);
+		}
+		globalLogger.log(Level.INFO, "Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+

+ 28 - 0
src/main/resources/net/p0f/samples/rules_processes/facts/loyalty-awards.drl

@@ -0,0 +1,28 @@
+package net.p0f.samples.rules_processes.facts
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+query "Get Awards"
+	award: Award()
+end
+
+rule "Reward 5 years of gold status"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge == 5)
+	then
+		Award a = new Award("Congrats for 5 years of GOLD!");
+		a.setCarrier($c);
+		insert(a);
+		System.out.println("Awarding 5 yrs of GOLD status.");
+end
+
+rule "Reward 10 years of platinum status"
+	when
+		$c: Customer(loyaltyLevel == Customer.PLATINUM, loyaltyAge == 10)
+	then
+		Award a = new Award("Congrats for 10 years of PLATINUM!");
+		a.setCarrier($c);
+		insert(a);
+		System.out.println("Awarding 10 yrs of PLATINUM status.");
+end

+ 20 - 0
src/main/resources/net/p0f/samples/rules_processes/integrity/integrity.drl

@@ -0,0 +1,20 @@
+package net.p0f.samples.rules_processes.integrity
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+rule "Incorrect Way of Matching Related Facts"
+    when
+        $c: Customer()
+        $a: Award()
+    then
+		System.out.println("[WRONG] Found award " + $a.getReason() + " for customer " + $c.getName());
+end
+
+rule "Correct Way of Matching Related Facts"
+    when
+        $c: Customer()
+        $a: Award(carrier == $c)
+    then
+		System.out.println("[RIGHT] Found award " + $a.getReason() + " for customer " + $c.getName());
+end

+ 238 - 0
src/main/resources/net/p0f/samples/rules_processes/ruleflow/RulesRulesRules.bpmn2

@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_3" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_4" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:process id="ruleflow.RulesRulesRules" tns:packageName="net.p0f.samples.rules_processes.ruleflow" name="RulesRulesRules" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customer" itemSubjectRef="ItemDefinition_3" name="customer"/>
+    <bpmn2:property id="award" itemSubjectRef="ItemDefinition_4" name="award"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="awards" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:dataInput id="DataInput_4" itemSubjectRef="ItemDefinition_4" name="input2"/>
+        <bpmn2:dataOutput id="DataOutput_1" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:dataOutput id="DataOutput_2" itemSubjectRef="ItemDefinition_4" name="input2"/>
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1">
+          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_4</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1">
+          <bpmn2:dataOutputRefs>DataOutput_1</bpmn2:dataOutputRefs>
+          <bpmn2:dataOutputRefs>DataOutput_2</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_4">
+        <bpmn2:sourceRef>award</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_4</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_1">
+        <bpmn2:sourceRef>DataOutput_1</bpmn2:sourceRef>
+        <bpmn2:targetRef>customer</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_2">
+        <bpmn2:sourceRef>DataOutput_2</bpmn2:sourceRef>
+        <bpmn2:targetRef>award</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:dataInput id="DataInput_5" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3">
+          <bpmn2:dataInputRefs>DataInput_5</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_5">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_5</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_4" tns:priority="1" sourceRef="StartEvent_1" targetRef="BusinessRuleTask_3"/>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Award Issued?" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:script>System.out.println(&quot;Congratulating &quot; + customer);</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_1">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(this != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Process">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Process]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Normally">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Normally]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_2" tns:ruleFlowGroup="promotion" name="Look for Promotions">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Promotions]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_2">
+        <bpmn2:dataInput id="DataInput_2" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:inputSet id="InputSet_2" name="Input Set 2">
+          <bpmn2:dataInputRefs>DataInput_2</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_2" name="Output Set 2"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_2">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_2</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_2"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="BusinessRuleTask_2" targetRef="BusinessRuleTask_1"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="ruleflow.RulesRulesRules">
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="460.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="466.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="140.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="11.0" width="91.0" x="149.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="624.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="11.0" width="60.0" x="619.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="594.0" y="120.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="595.0" y="139.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="738.0" y="127.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="11.0" width="52.0" x="730.0" y="163.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="11.0" width="55.0" x="728.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_2" bpmnElement="BusinessRuleTask_2" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="300.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8">
+          <dc:Bounds height="11.0" width="81.0" x="314.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="110.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="140.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="570.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="597.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="624.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="104.0"/>
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="120.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="704.0" y="145.0"/>
+        <di:waypoint xsi:type="dc:Point" x="721.0" y="145.0"/>
+        <di:waypoint xsi:type="dc:Point" x="738.0" y="145.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="674.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="705.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="737.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_2">
+        <di:waypoint xsi:type="dc:Point" x="250.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="275.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="300.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_BusinessRuleTask_2" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="410.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="435.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="460.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_14"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 88 - 0
src/main/resources/net/p0f/samples/rules_processes/ruleflow/ruleflow-groups.drl

@@ -0,0 +1,88 @@
+package net.p0f.samples.rules_processes.ruleflow
+
+import java.util.logging.Level
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+query "Get Awards"
+	award: Award()
+end
+
+rule "Reward 5 years of gold status"
+	ruleflow-group "awards"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge == 5)
+	then
+		Award a = new Award("Congrats for 5 years of GOLD!");
+		a.setCarrier($c);
+		insert(a);
+		System.out.println("Awarding 5 yrs of GOLD status.");
+end
+
+rule "Reward 10 years of platinum status"
+	ruleflow-group "awards"
+	when
+		$c: Customer(loyaltyLevel == Customer.PLATINUM, loyaltyAge == 10)
+	then
+		Award a = new Award("Congrats for 10 years of PLATINUM!");
+		a.setCarrier($c);
+		insert(a);
+		System.out.println("Awarding 10 yrs of PLATINUM status.");
+end
+
+rule "Promote over 5 years of gold status"
+	ruleflow-group "promotion"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge >= 5)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.PLATINUM);
+		}
+		System.out.println("Promoting " + $c.getName() + " to PLATINUM!"); 
+end
+
+
+rule "No Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown <= 10000, loyaltyLevel != Customer.NONE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.NONE);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Bronze Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 10000, milesFlown <= 20000, loyaltyLevel != Customer.BRONZE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.BRONZE);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Silver Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 20000, milesFlown <= 35000, loyaltyLevel != Customer.SILVER)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.SILVER);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Gold Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 35000, loyaltyLevel != Customer.GOLD)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.GOLD);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end

+ 238 - 0
src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/RulesRulesRules.bpmn2

@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_3" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_4" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:process id="ruleflow.RulesRulesRules" tns:packageName="net.p0f.samples.rules_processes.ruleflow_params" name="RulesRulesRules" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customer" itemSubjectRef="ItemDefinition_3" name="customer"/>
+    <bpmn2:property id="award" itemSubjectRef="ItemDefinition_4" name="award"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="awards" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:dataInput id="DataInput_4" itemSubjectRef="ItemDefinition_4" name="input2"/>
+        <bpmn2:dataOutput id="DataOutput_1" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:dataOutput id="DataOutput_2" itemSubjectRef="ItemDefinition_4" name="input2"/>
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1">
+          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_4</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1">
+          <bpmn2:dataOutputRefs>DataOutput_1</bpmn2:dataOutputRefs>
+          <bpmn2:dataOutputRefs>DataOutput_2</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_4">
+        <bpmn2:sourceRef>award</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_4</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_1">
+        <bpmn2:sourceRef>DataOutput_1</bpmn2:sourceRef>
+        <bpmn2:targetRef>customer</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_2">
+        <bpmn2:sourceRef>DataOutput_2</bpmn2:sourceRef>
+        <bpmn2:targetRef>award</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:dataInput id="DataInput_5" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3">
+          <bpmn2:dataInputRefs>DataInput_5</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_5">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_5</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_4" tns:priority="1" sourceRef="StartEvent_1" targetRef="BusinessRuleTask_3"/>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Award Issued?" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:script>System.out.println(&quot;Congratulating &quot; + customer);</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_1">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(reason != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Process">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Process]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Normally">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Normally]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_2" tns:ruleFlowGroup="promotion" name="Look for Promotions">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Promotions]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_2">
+        <bpmn2:dataInput id="DataInput_2" itemSubjectRef="ItemDefinition_3" name="input1"/>
+        <bpmn2:inputSet id="InputSet_2" name="Input Set 2">
+          <bpmn2:dataInputRefs>DataInput_2</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_2" name="Output Set 2"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_2">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_2</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_2"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="BusinessRuleTask_2" targetRef="BusinessRuleTask_1"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="ruleflow.RulesRulesRules">
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="460.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="466.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="140.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="11.0" width="91.0" x="149.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="624.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="11.0" width="60.0" x="619.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="594.0" y="120.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="595.0" y="139.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="738.0" y="127.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="11.0" width="52.0" x="730.0" y="163.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="11.0" width="55.0" x="728.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_2" bpmnElement="BusinessRuleTask_2" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="300.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8">
+          <dc:Bounds height="11.0" width="81.0" x="314.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="110.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="140.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="570.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="597.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="624.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="104.0"/>
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="120.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="704.0" y="145.0"/>
+        <di:waypoint xsi:type="dc:Point" x="721.0" y="145.0"/>
+        <di:waypoint xsi:type="dc:Point" x="738.0" y="145.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="674.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="705.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="737.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_2">
+        <di:waypoint xsi:type="dc:Point" x="250.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="275.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="300.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_BusinessRuleTask_2" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="410.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="435.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="460.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_14"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 240 - 0
src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/RulesWithListParams.bpmn2

@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_3" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_4" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1" isCollection="false" structureRef="java.util.List"/>
+  <bpmn2:process id="ruleflow.RulesWithListParams" tns:packageName="net.p0f.samples.rules_processes.ruleflow_params" name="RulesWithListParams" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+      <tns:import name="java.util.List"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customers" itemSubjectRef="ItemDefinition_1" name="customers"/>
+    <bpmn2:property id="awards" itemSubjectRef="ItemDefinition_1" name="awards"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="awards" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_1" name="input1"/>
+        <bpmn2:dataInput id="DataInput_4" itemSubjectRef="ItemDefinition_1" name="input2"/>
+        <bpmn2:dataOutput id="DataOutput_1" itemSubjectRef="ItemDefinition_1" name="input1"/>
+        <bpmn2:dataOutput id="DataOutput_2" itemSubjectRef="ItemDefinition_1" name="input2"/>
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1">
+          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_4</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1">
+          <bpmn2:dataOutputRefs>DataOutput_1</bpmn2:dataOutputRefs>
+          <bpmn2:dataOutputRefs>DataOutput_2</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
+        <bpmn2:sourceRef>customers</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_4">
+        <bpmn2:sourceRef>awards</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_4</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_1">
+        <bpmn2:sourceRef>DataOutput_1</bpmn2:sourceRef>
+        <bpmn2:targetRef>customers</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_2">
+        <bpmn2:sourceRef>DataOutput_2</bpmn2:sourceRef>
+        <bpmn2:targetRef>awards</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:dataInput id="DataInput_5" itemSubjectRef="ItemDefinition_1" name="input1"/>
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3">
+          <bpmn2:dataInputRefs>DataInput_5</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_5">
+        <bpmn2:sourceRef>customers</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_5</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_4" tns:priority="1" sourceRef="StartEvent_1" targetRef="BusinessRuleTask_3"/>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Award Issued?" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:script>System.out.println(&quot;Congratulating &quot; + customers);</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_1">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(this != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Process">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Process]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Normally">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Normally]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_2" tns:ruleFlowGroup="promotion" name="Look for Promotions">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Promotions]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_2">
+        <bpmn2:dataInput id="DataInput_2" itemSubjectRef="ItemDefinition_1" name="input1"/>
+        <bpmn2:inputSet id="InputSet_2" name="Input Set 2">
+          <bpmn2:dataInputRefs>DataInput_2</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_2" name="Output Set 2"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_2">
+        <bpmn2:sourceRef>customers</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_2</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_2"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="BusinessRuleTask_2" targetRef="BusinessRuleTask_1"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="ruleflow.RulesWithListParams">
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="460.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="466.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="140.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="11.0" width="91.0" x="149.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="624.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="11.0" width="60.0" x="619.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="594.0" y="120.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="595.0" y="139.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="738.0" y="127.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="11.0" width="52.0" x="730.0" y="163.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="11.0" width="55.0" x="728.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_2" bpmnElement="BusinessRuleTask_2" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="300.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8">
+          <dc:Bounds height="11.0" width="81.0" x="314.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="110.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="140.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="570.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="597.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="624.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="104.0"/>
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="120.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="704.0" y="145.0"/>
+        <di:waypoint xsi:type="dc:Point" x="721.0" y="145.0"/>
+        <di:waypoint xsi:type="dc:Point" x="738.0" y="145.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="674.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="705.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="737.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_2">
+        <di:waypoint xsi:type="dc:Point" x="250.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="275.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="300.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_BusinessRuleTask_2" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="410.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="435.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="460.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_14"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 551 - 0
src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/RulesWithListSubProc.bpmn2

@@ -0,0 +1,551 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_3" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_4" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1" isCollection="false" structureRef="java.util.List"/>
+  <bpmn2:process id="ruleflow.RulesWithListSubProc" tns:packageName="net.p0f.samples.rules_processes.ruleflow_params" name="RulesWithListSubProc" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+      <tns:import name="java.util.List"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customers" itemSubjectRef="ItemDefinition_1" name="customers"/>
+    <bpmn2:property id="awards" itemSubjectRef="ItemDefinition_1" name="awards"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="awards" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1"/>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1"/>
+      </bpmn2:ioSpecification>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_18</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3"/>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+    </bpmn2:businessRuleTask>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Award Issued?" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="SubProcess_3">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(reason != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Process">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Process]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="SubProcess_3" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Normally">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Normally]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_2" tns:ruleFlowGroup="promotion" name="Look for Promotions">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Promotions]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_2">
+        <bpmn2:inputSet id="InputSet_2" name="Input Set 2"/>
+        <bpmn2:outputSet id="OutputSet_2" name="Output Set 2"/>
+      </bpmn2:ioSpecification>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_2"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="BusinessRuleTask_2" targetRef="BusinessRuleTask_1"/>
+    <bpmn2:subProcess id="SubProcess_1" name="Populate Working Memory (Award)">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Populate Working Memory (Award)]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_17</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_5">
+        <bpmn2:dataInput id="DataInput_8" itemSubjectRef="ItemDefinition_1" isCollection="true" name="awards"/>
+        <bpmn2:inputSet id="InputSet_5" name="Input Set 5">
+          <bpmn2:dataInputRefs>DataInput_8</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_6">
+        <bpmn2:sourceRef>awards</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_8</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:multiInstanceLoopCharacteristics id="MultiInstanceLoopCharacteristics_1">
+        <bpmn2:loopDataInputRef>DataInput_8</bpmn2:loopDataInputRef>
+        <bpmn2:inputDataItem xsi:type="bpmn2:tDataInput" id="award" itemSubjectRef="ItemDefinition_4" name="award"/>
+      </bpmn2:multiInstanceLoopCharacteristics>
+      <bpmn2:startEvent id="StartEvent_3" name="Start Event 2">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[Start Event 2]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing>
+      </bpmn2:startEvent>
+      <bpmn2:scriptTask id="ScriptTask_3" name="Insert Awards" scriptFormat="http://www.java.com/java">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[Insert Awards]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming>
+        <bpmn2:outgoing>SequenceFlow_15</bpmn2:outgoing>
+        <bpmn2:script>System.out.println(&quot;Inserting fact: &quot; + award);
+kcontext.getKieRuntime().insert(award);</bpmn2:script>
+      </bpmn2:scriptTask>
+      <bpmn2:sequenceFlow id="SequenceFlow_14" tns:priority="1" sourceRef="StartEvent_3" targetRef="ScriptTask_3"/>
+      <bpmn2:endEvent id="EndEvent_3" name="End Event 3">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[End Event 3]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:incoming>SequenceFlow_15</bpmn2:incoming>
+      </bpmn2:endEvent>
+      <bpmn2:sequenceFlow id="SequenceFlow_15" tns:priority="1" sourceRef="ScriptTask_3" targetRef="EndEvent_3"/>
+    </bpmn2:subProcess>
+    <bpmn2:subProcess id="SubProcess_2" name="Populate Working Memory (Customer)">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Populate Working Memory]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_16</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_4">
+        <bpmn2:dataInput id="DataInput_6" itemSubjectRef="ItemDefinition_1" isCollection="true" name="customers"/>
+        <bpmn2:inputSet id="InputSet_4" name="Input Set 4">
+          <bpmn2:dataInputRefs>DataInput_6</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_3">
+        <bpmn2:sourceRef>customers</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_6</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:multiInstanceLoopCharacteristics id="MultiInstanceLoopCharacteristics_2">
+        <bpmn2:loopDataInputRef>DataInput_6</bpmn2:loopDataInputRef>
+        <bpmn2:inputDataItem xsi:type="bpmn2:tDataInput" id="customer" itemSubjectRef="ItemDefinition_3" name="customer"/>
+      </bpmn2:multiInstanceLoopCharacteristics>
+      <bpmn2:startEvent id="StartEvent_2" name="Start Event 2">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[Start Event 2]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:outgoing>SequenceFlow_11</bpmn2:outgoing>
+      </bpmn2:startEvent>
+      <bpmn2:scriptTask id="ScriptTask_2" name="Insert Customers" scriptFormat="http://www.java.com/java">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[Insert Customers]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:incoming>SequenceFlow_11</bpmn2:incoming>
+        <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing>
+        <bpmn2:script>System.out.println(&quot;Inserting fact: &quot; + customer);
+kcontext.getKieRuntime().insert(customer);</bpmn2:script>
+      </bpmn2:scriptTask>
+      <bpmn2:sequenceFlow id="SequenceFlow_11" tns:priority="1" sourceRef="StartEvent_2" targetRef="ScriptTask_2"/>
+      <bpmn2:endEvent id="EndEvent_1" name="End Event 1">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[End Event 1]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:incoming>SequenceFlow_13</bpmn2:incoming>
+      </bpmn2:endEvent>
+      <bpmn2:sequenceFlow id="SequenceFlow_13" tns:priority="1" sourceRef="ScriptTask_2" targetRef="EndEvent_1"/>
+    </bpmn2:subProcess>
+    <bpmn2:parallelGateway id="ParallelGateway_1" name="Parallel Gateway 1" gatewayDirection="Diverging">
+      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing>
+    </bpmn2:parallelGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_5" tns:priority="1" sourceRef="StartEvent_1" targetRef="ParallelGateway_1"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_7" tns:priority="1" sourceRef="ParallelGateway_1" targetRef="SubProcess_2"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_10" tns:priority="1" sourceRef="ParallelGateway_1" targetRef="SubProcess_1"/>
+    <bpmn2:parallelGateway id="ParallelGateway_2" name="Parallel Gateway 2" gatewayDirection="Converging">
+      <bpmn2:incoming>SequenceFlow_16</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_17</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_18</bpmn2:outgoing>
+    </bpmn2:parallelGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_16" tns:priority="1" sourceRef="SubProcess_2" targetRef="ParallelGateway_2"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_17" tns:priority="1" sourceRef="SubProcess_1" targetRef="ParallelGateway_2"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_18" tns:priority="1" sourceRef="ParallelGateway_2" targetRef="BusinessRuleTask_3"/>
+    <bpmn2:subProcess id="SubProcess_3" name="Congratulate if Award has a Reason">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate if Award has a Reason]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_6">
+        <bpmn2:dataInput id="DataInput_10" itemSubjectRef="ItemDefinition_1" isCollection="true" name="awards"/>
+        <bpmn2:inputSet id="InputSet_6" name="Input Set 6">
+          <bpmn2:dataInputRefs>DataInput_10</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_7">
+        <bpmn2:sourceRef>awards</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_10</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:multiInstanceLoopCharacteristics id="MultiInstanceLoopCharacteristics_3">
+        <bpmn2:loopDataInputRef>DataInput_10</bpmn2:loopDataInputRef>
+        <bpmn2:inputDataItem xsi:type="bpmn2:tDataInput" id="congrat" itemSubjectRef="ItemDefinition_4" name="congrat"/>
+      </bpmn2:multiInstanceLoopCharacteristics>
+      <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming>
+        <bpmn2:outgoing>SequenceFlow_20</bpmn2:outgoing>
+        <bpmn2:script>System.out.println(&quot;Congratulations,  &quot; + congrat.getCarrier() + &quot;, for &quot; + congrat);</bpmn2:script>
+      </bpmn2:scriptTask>
+      <bpmn2:startEvent id="StartEvent_4" name="Start Event 4">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[Start Event 4]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:outgoing>SequenceFlow_21</bpmn2:outgoing>
+      </bpmn2:startEvent>
+      <bpmn2:endEvent id="EndEvent_5" name="End Event 5">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[End Event 5]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:incoming>SequenceFlow_20</bpmn2:incoming>
+      </bpmn2:endEvent>
+      <bpmn2:sequenceFlow id="SequenceFlow_20" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_5"/>
+      <bpmn2:exclusiveGateway id="ExclusiveGateway_2" name="Award Justified?" gatewayDirection="Diverging" default="SequenceFlow_22">
+        <bpmn2:incoming>SequenceFlow_21</bpmn2:incoming>
+        <bpmn2:outgoing>SequenceFlow_22</bpmn2:outgoing>
+        <bpmn2:outgoing>SequenceFlow_23</bpmn2:outgoing>
+      </bpmn2:exclusiveGateway>
+      <bpmn2:sequenceFlow id="SequenceFlow_21" tns:priority="1" sourceRef="StartEvent_4" targetRef="ExclusiveGateway_2"/>
+      <bpmn2:endEvent id="EndEvent_6" name="End Event 6">
+        <bpmn2:extensionElements>
+          <tns:metaData name="elementname">
+            <tns:metaValue><![CDATA[End Event 6]]></tns:metaValue>
+          </tns:metaData>
+        </bpmn2:extensionElements>
+        <bpmn2:incoming>SequenceFlow_22</bpmn2:incoming>
+      </bpmn2:endEvent>
+      <bpmn2:sequenceFlow id="SequenceFlow_22" tns:priority="1" name="No" sourceRef="ExclusiveGateway_2" targetRef="EndEvent_6"/>
+      <bpmn2:sequenceFlow id="SequenceFlow_23" tns:priority="1" name="Yes" sourceRef="ExclusiveGateway_2" targetRef="ScriptTask_1">
+        <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_3" language="http://www.java.com/java">return congrat.getReason() != null;</bpmn2:conditionExpression>
+      </bpmn2:sequenceFlow>
+    </bpmn2:subProcess>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="ruleflow.RulesWithListSubProc">
+      <bpmndi:BPMNShape id="BPMNShape_SubProcess_1" bpmnElement="SubProcess_1" isExpanded="true">
+        <dc:Bounds height="150.0" width="311.0" x="129.0" y="410.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="140.0" x="135.0" y="413.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_SubProcess_2" bpmnElement="SubProcess_2" isExpanded="true">
+        <dc:Bounds height="150.0" width="312.0" x="129.0" y="240.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="154.0" x="135.0" y="243.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_SubProcess_3" bpmnElement="SubProcess_3" isExpanded="true">
+        <dc:Bounds height="204.0" width="320.0" x="672.0" y="127.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="144.0" x="678.0" y="130.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="460.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="466.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="140.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="11.0" width="91.0" x="149.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="624.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="11.0" width="60.0" x="619.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="770.0" y="147.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="771.0" y="166.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="814.0" y="377.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="11.0" width="52.0" x="806.0" y="413.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="11.0" width="55.0" x="728.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_2" bpmnElement="BusinessRuleTask_2" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="300.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8">
+          <dc:Bounds height="11.0" width="81.0" x="314.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ParallelGateway_1" bpmnElement="ParallelGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="38.0" y="317.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="76.0" x="25.0" y="367.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_2" bpmnElement="StartEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="149.0" y="299.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="53.0" x="141.0" y="335.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_3" bpmnElement="StartEvent_3">
+        <dc:Bounds height="36.0" width="36.0" x="149.0" y="468.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="53.0" x="141.0" y="504.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_2" bpmnElement="ScriptTask_2" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="228.0" y="292.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="69.0" x="248.0" y="311.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_1" bpmnElement="EndEvent_1">
+        <dc:Bounds height="36.0" width="36.0" x="373.0" y="299.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="50.0" x="366.0" y="335.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_3" bpmnElement="ScriptTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="229.0" y="461.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="55.0" x="256.0" y="480.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_3" bpmnElement="EndEvent_3">
+        <dc:Bounds height="36.0" width="36.0" x="372.0" y="468.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="50.0" x="365.0" y="504.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ParallelGateway_2" bpmnElement="ParallelGateway_2" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="516.0" y="290.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="76.0" x="503.0" y="340.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_4" bpmnElement="StartEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="708.0" y="256.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="53.0" x="700.0" y="292.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_5" bpmnElement="EndEvent_5">
+        <dc:Bounds height="36.0" width="36.0" x="914.0" y="154.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="50.0" x="907.0" y="190.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_2" bpmnElement="ExclusiveGateway_2" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="800.0" y="249.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="66.0" x="792.0" y="299.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_6" bpmnElement="EndEvent_6">
+        <dc:Bounds height="36.0" width="36.0" x="914.0" y="256.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="50.0" x="907.0" y="292.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="570.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="597.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="624.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_SubProcess_3">
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="649.0" y="229.0"/>
+        <di:waypoint xsi:type="dc:Point" x="672.0" y="229.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_SubProcess_3" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="832.0" y="331.0"/>
+        <di:waypoint xsi:type="dc:Point" x="832.0" y="354.0"/>
+        <di:waypoint xsi:type="dc:Point" x="832.0" y="377.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="674.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="705.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="737.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_2">
+        <di:waypoint xsi:type="dc:Point" x="250.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="275.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="300.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_BusinessRuleTask_2" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="410.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="435.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="460.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_14"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_ParallelGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="63.0" y="81.0"/>
+        <di:waypoint xsi:type="dc:Point" x="63.0" y="199.0"/>
+        <di:waypoint xsi:type="dc:Point" x="63.0" y="317.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_SubProcess_2">
+        <di:waypoint xsi:type="dc:Point" x="88.0" y="342.0"/>
+        <di:waypoint xsi:type="dc:Point" x="108.0" y="342.0"/>
+        <di:waypoint xsi:type="dc:Point" x="108.0" y="315.0"/>
+        <di:waypoint xsi:type="dc:Point" x="129.0" y="315.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_SubProcess_1">
+        <di:waypoint xsi:type="dc:Point" x="63.0" y="367.0"/>
+        <di:waypoint xsi:type="dc:Point" x="63.0" y="485.0"/>
+        <di:waypoint xsi:type="dc:Point" x="129.0" y="485.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_11" sourceElement="BPMNShape_StartEvent_2" targetElement="BPMNShape_ScriptTask_2">
+        <di:waypoint xsi:type="dc:Point" x="185.0" y="317.0"/>
+        <di:waypoint xsi:type="dc:Point" x="206.0" y="317.0"/>
+        <di:waypoint xsi:type="dc:Point" x="228.0" y="317.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_13" sourceElement="BPMNShape_ScriptTask_2" targetElement="BPMNShape_EndEvent_1">
+        <di:waypoint xsi:type="dc:Point" x="338.0" y="317.0"/>
+        <di:waypoint xsi:type="dc:Point" x="355.0" y="317.0"/>
+        <di:waypoint xsi:type="dc:Point" x="373.0" y="317.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="BPMNShape_StartEvent_3" targetElement="BPMNShape_ScriptTask_3">
+        <di:waypoint xsi:type="dc:Point" x="185.0" y="486.0"/>
+        <di:waypoint xsi:type="dc:Point" x="207.0" y="486.0"/>
+        <di:waypoint xsi:type="dc:Point" x="229.0" y="486.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="BPMNShape_ScriptTask_3" targetElement="BPMNShape_EndEvent_3">
+        <di:waypoint xsi:type="dc:Point" x="339.0" y="486.0"/>
+        <di:waypoint xsi:type="dc:Point" x="355.0" y="486.0"/>
+        <di:waypoint xsi:type="dc:Point" x="372.0" y="486.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_16" sourceElement="BPMNShape_SubProcess_2" targetElement="BPMNShape_ParallelGateway_2">
+        <di:waypoint xsi:type="dc:Point" x="441.0" y="315.0"/>
+        <di:waypoint xsi:type="dc:Point" x="478.0" y="315.0"/>
+        <di:waypoint xsi:type="dc:Point" x="516.0" y="315.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_17" bpmnElement="SequenceFlow_17" sourceElement="BPMNShape_SubProcess_1" targetElement="BPMNShape_ParallelGateway_2">
+        <di:waypoint xsi:type="dc:Point" x="440.0" y="485.0"/>
+        <di:waypoint xsi:type="dc:Point" x="541.0" y="485.0"/>
+        <di:waypoint xsi:type="dc:Point" x="541.0" y="340.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_18" sourceElement="BPMNShape_ParallelGateway_2" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="541.0" y="290.0"/>
+        <di:waypoint xsi:type="dc:Point" x="541.0" y="189.0"/>
+        <di:waypoint xsi:type="dc:Point" x="195.0" y="189.0"/>
+        <di:waypoint xsi:type="dc:Point" x="195.0" y="88.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_20" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_5">
+        <di:waypoint xsi:type="dc:Point" x="880.0" y="172.0"/>
+        <di:waypoint xsi:type="dc:Point" x="897.0" y="172.0"/>
+        <di:waypoint xsi:type="dc:Point" x="914.0" y="172.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_21" sourceElement="BPMNShape_StartEvent_4" targetElement="BPMNShape_ExclusiveGateway_2">
+        <di:waypoint xsi:type="dc:Point" x="744.0" y="274.0"/>
+        <di:waypoint xsi:type="dc:Point" x="772.0" y="274.0"/>
+        <di:waypoint xsi:type="dc:Point" x="800.0" y="274.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_22" bpmnElement="SequenceFlow_22" sourceElement="BPMNShape_ExclusiveGateway_2" targetElement="BPMNShape_EndEvent_6">
+        <di:waypoint xsi:type="dc:Point" x="850.0" y="274.0"/>
+        <di:waypoint xsi:type="dc:Point" x="882.0" y="274.0"/>
+        <di:waypoint xsi:type="dc:Point" x="914.0" y="274.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="12.0" x="877.0" y="275.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_23" sourceElement="BPMNShape_ExclusiveGateway_2" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="825.0" y="249.0"/>
+        <di:waypoint xsi:type="dc:Point" x="825.0" y="223.0"/>
+        <di:waypoint xsi:type="dc:Point" x="825.0" y="197.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="15.0" x="818.0" y="224.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 88 - 0
src/main/resources/net/p0f/samples/rules_processes/ruleflow_params/ruleflow-groups.drl

@@ -0,0 +1,88 @@
+package net.p0f.samples.rules_processes.ruleflow_params
+
+import java.util.logging.Level
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+query "Get Awards"
+	award: Award()
+end
+
+rule "Reward 5 years of gold status"
+	ruleflow-group "awards"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge == 5)
+		$a: Award(carrier == $c, reason == null)
+	then
+		$a.setReason("Congrats for 5 years of GOLD!");
+		update($a);
+		System.out.println("Awarding 5 yrs of GOLD status.");
+end
+
+rule "Reward 10 years of platinum status"
+	ruleflow-group "awards"
+	when
+		$c: Customer(loyaltyLevel == Customer.PLATINUM, loyaltyAge == 10)
+		$a: Award(carrier == $c, reason == null)
+	then
+		$a.setReason("Congrats for 10 years of PLATINUM!");
+		update($a);
+		System.out.println("Awarding 10 yrs of PLATINUM status.");
+end
+
+rule "Promote over 5 years of gold status"
+	ruleflow-group "promotion"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge >= 5)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.PLATINUM);
+		}
+		System.out.println("Promoting " + $c.getName() + " to PLATINUM!"); 
+end
+
+
+rule "No Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown <= 10000, loyaltyLevel != Customer.NONE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.NONE);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Bronze Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 10000, milesFlown <= 20000, loyaltyLevel != Customer.BRONZE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.BRONZE);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Silver Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 20000, milesFlown <= 35000, loyaltyLevel != Customer.SILVER)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.SILVER);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Gold Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 35000, loyaltyLevel != Customer.GOLD)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.GOLD);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end

+ 272 - 0
src/main/resources/net/p0f/samples/rules_processes/service_tasks/BpmnRestTask.bpmn2

@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_6" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_7" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:process id="servicetasks.BpmnRestTask" tns:packageName="net.p0f.samples.rules_processes.service_tasks" name="BpmnRestTask" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customer" itemSubjectRef="ItemDefinition_6" name="customer"/>
+    <bpmn2:property id="award" itemSubjectRef="ItemDefinition_7" name="award"/>
+    <bpmn2:property id="customerId" itemSubjectRef="ItemDefinition_1065" name="customerId"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="eligibility" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_7" name="input1"/>
+        <bpmn2:dataInput id="DataInput_3" itemSubjectRef="ItemDefinition_6" name="input2"/>
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1">
+          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_3</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
+        <bpmn2:sourceRef>award</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_3">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_3</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:dataInput id="DataInput_5" itemSubjectRef="ItemDefinition_6" name="input1"/>
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3">
+          <bpmn2:dataInputRefs>DataInput_5</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_5">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_5</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_5" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_1"/>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Exclusive Gateway 1" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:script>System.out.println(&quot;Congratulating &quot; + award.getCarrier().getName() + &quot; for &quot; + award);</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_1">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(reason != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Event 2">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 2]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Event 4">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 4]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:task id="Task_1" taskName="Rest" name="Invoke REST Operation">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Invoke REST Operation]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_2">
+        <bpmn2:dataInput id="DataInput_6" itemSubjectRef="ItemDefinition_1064" name="AcceptHeader"/>
+        <bpmn2:dataInput id="DataInput_7" itemSubjectRef="ItemDefinition_1064" name="ContentType"/>
+        <bpmn2:dataInput id="DataInput_8" itemSubjectRef="ItemDefinition_1064" name="Method"/>
+        <bpmn2:dataInput id="DataInput_9" itemSubjectRef="ItemDefinition_1064" name="ResultClass"/>
+        <bpmn2:dataInput id="DataInput_10" itemSubjectRef="ItemDefinition_1064" name="Url"/>
+        <bpmn2:dataOutput id="DataOutput_1" itemSubjectRef="ItemDefinition_6" name="Result"/>
+        <bpmn2:inputSet id="InputSet_2" name="Input Set 2">
+          <bpmn2:dataInputRefs>DataInput_6</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_7</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_8</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_9</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_10</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_2" name="Output Set 2">
+          <bpmn2:dataOutputRefs>DataOutput_1</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_6">
+        <bpmn2:targetRef>DataInput_6</bpmn2:targetRef>
+        <bpmn2:assignment id="Assignment_1">
+          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="FormalExpression_4">application/json</bpmn2:from>
+          <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="FormalExpression_1">DataInput_6</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_7">
+        <bpmn2:targetRef>DataInput_7</bpmn2:targetRef>
+        <bpmn2:assignment id="Assignment_2">
+          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="FormalExpression_7">application/json</bpmn2:from>
+          <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="FormalExpression_5">DataInput_7</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_8">
+        <bpmn2:targetRef>DataInput_8</bpmn2:targetRef>
+        <bpmn2:assignment id="Assignment_3">
+          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="FormalExpression_10">GET</bpmn2:from>
+          <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="FormalExpression_8">DataInput_8</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_9">
+        <bpmn2:targetRef>DataInput_9</bpmn2:targetRef>
+        <bpmn2:assignment id="Assignment_4">
+          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="FormalExpression_13">net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer</bpmn2:from>
+          <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="FormalExpression_11">DataInput_9</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_10">
+        <bpmn2:targetRef>DataInput_10</bpmn2:targetRef>
+        <bpmn2:assignment id="Assignment_5">
+          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="FormalExpression_16">http://localhost:9080/ws-customer-data/api/customers/#{customerId}</bpmn2:from>
+          <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="FormalExpression_14">DataInput_10</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_1">
+        <bpmn2:sourceRef>DataOutput_1</bpmn2:sourceRef>
+        <bpmn2:targetRef>customer</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:task>
+    <bpmn2:sequenceFlow id="SequenceFlow_3" tns:priority="1" sourceRef="StartEvent_1" targetRef="Task_1"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_4" tns:priority="1" sourceRef="Task_1" targetRef="BusinessRuleTask_3"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="servicetasks.BpmnRestTask">
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="549.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="555.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="370.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="28.0" width="92.0" x="379.0" y="49.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="730.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="28.0" width="58.0" x="726.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="700.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="701.0" y="161.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="14.0" width="66.0" x="722.0" y="256.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="833.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="14.0" width="66.0" x="818.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_Task_1" bpmnElement="Task_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="175.0" y="38.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="11.0" width="95.0" x="182.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="480.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="514.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="549.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="659.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="694.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="730.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="115.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="192.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="206.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="780.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="806.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="833.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_Task_1">
+        <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="128.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="175.0" y="63.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="BPMNShape_Task_1" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="285.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="327.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="370.0" y="63.0"/>
+        <bpmndi:BPMNLabel/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 243 - 0
src/main/resources/net/p0f/samples/rules_processes/service_tasks/JavaBeanServiceTask.bpmn2

@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_6" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_7" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:itemDefinition id="ItemDefinition_9" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.beans.GenerateCustomer"/>
+  <bpmn2:message id="Message_1" itemRef="ItemDefinition_1065" name="CustomerId"/>
+  <bpmn2:message id="Message_2" itemRef="ItemDefinition_6" name="Customer"/>
+  <bpmn2:interface id="Interface_1" implementationRef="net.p0f.samples.rhpam_fuse_integration.beans.GenerateCustomer" name="CustomerService">
+    <bpmn2:operation id="Operation_1" name="getCustomer">
+      <bpmn2:inMessageRef>Message_1</bpmn2:inMessageRef>
+      <bpmn2:outMessageRef>Message_2</bpmn2:outMessageRef>
+    </bpmn2:operation>
+  </bpmn2:interface>
+  <bpmn2:process id="servicetasks.JavaBeanServiceTask" tns:packageName="net.p0f.samples.rules_processes.service_tasks" name="JavaBeanServiceTask" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.beans.GenerateCustomer"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customer" itemSubjectRef="ItemDefinition_6" name="customer"/>
+    <bpmn2:property id="award" itemSubjectRef="ItemDefinition_7" name="award"/>
+    <bpmn2:property id="customerId" itemSubjectRef="ItemDefinition_1065" name="customerId"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="eligibility" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_7" name="input1"/>
+        <bpmn2:dataInput id="DataInput_3" itemSubjectRef="ItemDefinition_6" name="input2"/>
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1">
+          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_3</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
+        <bpmn2:sourceRef>award</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_3">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_3</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:dataInput id="DataInput_5" itemSubjectRef="ItemDefinition_6" name="input1"/>
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3">
+          <bpmn2:dataInputRefs>DataInput_5</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_5">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_5</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_5" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_1"/>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Exclusive Gateway 1" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:script>System.out.println(&quot;Congratulating &quot; + award.getCarrier().getName() + &quot; for &quot; + award);</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_1">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(reason != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Event 2">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 2]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Event 4">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 4]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:serviceTask id="ServiceTask_1" name="Get Customer Data" implementation="Java" operationRef="Operation_1">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Get Customer Data]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_5">
+        <bpmn2:dataInput id="DataInput_2" itemSubjectRef="ItemDefinition_1065" name="Parameter"/>
+        <bpmn2:dataOutput id="DataOutput_2" itemSubjectRef="ItemDefinition_6" name="Result"/>
+        <bpmn2:inputSet id="InputSet_5" name="Input Set 5">
+          <bpmn2:dataInputRefs>DataInput_2</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_5" name="Output Set 5">
+          <bpmn2:dataOutputRefs>DataOutput_2</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_2">
+        <bpmn2:sourceRef>customerId</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_2</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_3">
+        <bpmn2:sourceRef>DataOutput_2</bpmn2:sourceRef>
+        <bpmn2:targetRef>customer</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:serviceTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="StartEvent_1" targetRef="ServiceTask_1"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="ServiceTask_1" targetRef="BusinessRuleTask_3"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="servicetasks.JavaBeanServiceTask">
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="549.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="555.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="370.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="28.0" width="92.0" x="379.0" y="49.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="730.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="28.0" width="58.0" x="726.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="700.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="701.0" y="161.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="14.0" width="66.0" x="722.0" y="256.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="833.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="14.0" width="66.0" x="818.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ServiceTask_1" bpmnElement="ServiceTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="186.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8">
+          <dc:Bounds height="14.0" width="104.0" x="189.0" y="56.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="480.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="514.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="549.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="659.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="694.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="730.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="115.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="192.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="206.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="780.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="806.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="833.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_ServiceTask_1">
+        <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="133.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="186.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_14"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_ServiceTask_1" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="296.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="333.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="370.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_15"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 244 - 0
src/main/resources/net/p0f/samples/rules_processes/service_tasks/JavaRestClientServiceTask.bpmn2

@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_6" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_7" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:itemDefinition id="ItemDefinition_3" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.ws_client.CustomerServiceClient"/>
+  <bpmn2:message id="Message_1" itemRef="ItemDefinition_1065" name="CustomerId"/>
+  <bpmn2:message id="Message_2" itemRef="ItemDefinition_6" name="Customer"/>
+  <bpmn2:interface id="Interface_1" implementationRef="net.p0f.samples.rhpam_fuse_integration.ws_client.CustomerServiceClient" name="CustomerService">
+    <bpmn2:operation id="Operation_1" name="getCustomer">
+      <bpmn2:inMessageRef>Message_1</bpmn2:inMessageRef>
+      <bpmn2:outMessageRef>Message_2</bpmn2:outMessageRef>
+    </bpmn2:operation>
+  </bpmn2:interface>
+  <bpmn2:process id="servicetasks.JavaRestClientServiceTask" tns:packageName="net.p0f.samples.rules_processes.service_tasks" name="JavaRestClientServiceTask" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.ws_client.CustomerServiceClient"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customer" itemSubjectRef="ItemDefinition_6" name="customer"/>
+    <bpmn2:property id="award" itemSubjectRef="ItemDefinition_7" name="award"/>
+    <bpmn2:property id="customerId" itemSubjectRef="ItemDefinition_1065" name="customerId"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="eligibility" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_7" name="input1"/>
+        <bpmn2:dataInput id="DataInput_3" itemSubjectRef="ItemDefinition_6" name="input2"/>
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1">
+          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_3</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
+        <bpmn2:sourceRef>award</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_3">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_3</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:dataInput id="DataInput_5" itemSubjectRef="ItemDefinition_6" name="input1"/>
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3">
+          <bpmn2:dataInputRefs>DataInput_5</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_5">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_5</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_5" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_1"/>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Exclusive Gateway 1" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:script>System.out.println(&quot;Congratulating &quot; + award.getCarrier().getName() + &quot; for &quot; + award);</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_1">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(reason != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Event 2">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 2]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Event 4">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 4]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:serviceTask id="ServiceTask_1" name="Get Customer Data" implementation="Java" operationRef="Operation_1">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Get Customer Data]]></tns:metaValue>
+        </tns:metaData>
+        <tns:onEntry-script scriptFormat="http://www.java.com/java"/>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_5">
+        <bpmn2:dataInput id="DataInput_2" itemSubjectRef="ItemDefinition_1065" name="Parameter"/>
+        <bpmn2:dataOutput id="DataOutput_2" itemSubjectRef="ItemDefinition_6" name="Result"/>
+        <bpmn2:inputSet id="InputSet_5" name="Input Set 5">
+          <bpmn2:dataInputRefs>DataInput_2</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_5" name="Output Set 5">
+          <bpmn2:dataOutputRefs>DataOutput_2</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_2">
+        <bpmn2:sourceRef>customerId</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_2</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_3">
+        <bpmn2:sourceRef>DataOutput_2</bpmn2:sourceRef>
+        <bpmn2:targetRef>customer</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:serviceTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="StartEvent_1" targetRef="ServiceTask_1"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="ServiceTask_1" targetRef="BusinessRuleTask_3"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="servicetasks.JavaRestClientServiceTask">
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="549.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="555.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="370.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="28.0" width="92.0" x="379.0" y="49.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="730.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="28.0" width="58.0" x="726.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="700.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="701.0" y="161.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="14.0" width="66.0" x="722.0" y="256.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="833.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="14.0" width="66.0" x="818.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ServiceTask_1" bpmnElement="ServiceTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="186.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8">
+          <dc:Bounds height="14.0" width="104.0" x="189.0" y="56.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="480.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="514.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="549.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="659.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="694.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="730.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="115.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="192.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="206.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="780.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="806.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="833.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_ServiceTask_1">
+        <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="133.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="186.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_14"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_ServiceTask_1" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="296.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="333.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="370.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_15"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 244 - 0
src/main/resources/net/p0f/samples/rules_processes/service_tasks/JavaRestProxyServiceTask.bpmn2

@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- origin at X=0.0 Y=0.0 -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.5.1.Final-v20190425-2005-B1" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
+  <bpmn2:itemDefinition id="ItemDefinition_1064" isCollection="false" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1065" isCollection="false" structureRef="java.lang.Integer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_1066" isCollection="false" structureRef="java.lang.Boolean"/>
+  <bpmn2:itemDefinition id="ItemDefinition_6" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+  <bpmn2:itemDefinition id="ItemDefinition_7" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+  <bpmn2:itemDefinition id="ItemDefinition_4" isCollection="false" structureRef="net.p0f.samples.rhpam_fuse_integration.ws_client.CustomerServiceProxy"/>
+  <bpmn2:message id="Message_1" itemRef="ItemDefinition_1065" name="CustomerId"/>
+  <bpmn2:message id="Message_2" itemRef="ItemDefinition_6" name="Customer"/>
+  <bpmn2:interface id="Interface_1" implementationRef="net.p0f.samples.rhpam_fuse_integration.ws_client.CustomerServiceProxy" name="CustomerService">
+    <bpmn2:operation id="Operation_1" name="getCustomer">
+      <bpmn2:inMessageRef>Message_1</bpmn2:inMessageRef>
+      <bpmn2:outMessageRef>Message_2</bpmn2:outMessageRef>
+    </bpmn2:operation>
+  </bpmn2:interface>
+  <bpmn2:process id="servicetasks.JavaRestProxyServiceTask" tns:packageName="net.p0f.samples.rules_processes.service_tasks" name="JavaRestProxyServiceTask" isExecutable="true" processType="Private">
+    <bpmn2:extensionElements>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.shared_dom.Award"/>
+      <tns:import name="net.p0f.samples.rhpam_fuse_integration.ws_client.CustomerServiceProxy"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="customer" itemSubjectRef="ItemDefinition_6" name="customer"/>
+    <bpmn2:property id="award" itemSubjectRef="ItemDefinition_7" name="award"/>
+    <bpmn2:property id="customerId" itemSubjectRef="ItemDefinition_1065" name="customerId"/>
+    <bpmn2:startEvent id="StartEvent_1" name="StartProcess">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[StartProcess]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_1" tns:ruleFlowGroup="eligibility" name="Look for Award Eligibility">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Look for Award Eligibility]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_1">
+        <bpmn2:dataInput id="DataInput_1" itemSubjectRef="ItemDefinition_7" name="input1"/>
+        <bpmn2:dataInput id="DataInput_3" itemSubjectRef="ItemDefinition_6" name="input2"/>
+        <bpmn2:inputSet id="InputSet_1" name="Input Set 1">
+          <bpmn2:dataInputRefs>DataInput_1</bpmn2:dataInputRefs>
+          <bpmn2:dataInputRefs>DataInput_3</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_1" name="Output Set 1"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_1">
+        <bpmn2:sourceRef>award</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_1</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_3">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_3</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:businessRuleTask id="BusinessRuleTask_3" tns:ruleFlowGroup="status" name="Fix Customer's Loyalty">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Fix Customer's Loyalty]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_3">
+        <bpmn2:dataInput id="DataInput_5" itemSubjectRef="ItemDefinition_6" name="input1"/>
+        <bpmn2:inputSet id="InputSet_3" name="Input Set 3">
+          <bpmn2:dataInputRefs>DataInput_5</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_3" name="Output Set 3"/>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_5">
+        <bpmn2:sourceRef>customer</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_5</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_5" tns:priority="1" sourceRef="BusinessRuleTask_3" targetRef="BusinessRuleTask_1"/>
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Exclusive Gateway 1" gatewayDirection="Diverging" default="SequenceFlow_12">
+      <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_6" tns:priority="1" sourceRef="BusinessRuleTask_1" targetRef="ExclusiveGateway_1"/>
+    <bpmn2:scriptTask id="ScriptTask_1" name="Congratulate the customer">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Congratulate the customer]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
+      <bpmn2:script>System.out.println(&quot;Congratulating &quot; + award.getCarrier().getName() + &quot; for &quot; + award);</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_8" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_1">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.jboss.org/drools/rule">exists Award(reason != null)</bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:endEvent id="EndEvent_2" name="End Event 2">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 2]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_9" tns:priority="1" sourceRef="ScriptTask_1" targetRef="EndEvent_2"/>
+    <bpmn2:endEvent id="EndEvent_4" name="End Event 4">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[End Event 4]]></tns:metaValue>
+        </tns:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_12" tns:priority="1" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_4"/>
+    <bpmn2:serviceTask id="ServiceTask_1" name="Get Customer Data" implementation="Java" operationRef="Operation_1">
+      <bpmn2:extensionElements>
+        <tns:metaData name="elementname">
+          <tns:metaValue><![CDATA[Get Customer Data]]></tns:metaValue>
+        </tns:metaData>
+        <tns:onEntry-script scriptFormat="http://www.java.com/java"/>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="InputOutputSpecification_5">
+        <bpmn2:dataInput id="DataInput_2" itemSubjectRef="ItemDefinition_1065" name="Parameter"/>
+        <bpmn2:dataOutput id="DataOutput_2" itemSubjectRef="ItemDefinition_6" name="Result"/>
+        <bpmn2:inputSet id="InputSet_5" name="Input Set 5">
+          <bpmn2:dataInputRefs>DataInput_2</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="OutputSet_5" name="Output Set 5">
+          <bpmn2:dataOutputRefs>DataOutput_2</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DataInputAssociation_2">
+        <bpmn2:sourceRef>customerId</bpmn2:sourceRef>
+        <bpmn2:targetRef>DataInput_2</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DataOutputAssociation_3">
+        <bpmn2:sourceRef>DataOutput_2</bpmn2:sourceRef>
+        <bpmn2:targetRef>customer</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:serviceTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="StartEvent_1" targetRef="ServiceTask_1"/>
+    <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="ServiceTask_1" targetRef="BusinessRuleTask_3"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="servicetasks.JavaRestProxyServiceTask">
+      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
+        <dc:Bounds height="0.0" width="0.0" x="45.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_1">
+          <dc:Bounds height="14.0" width="69.0" x="29.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_1" bpmnElement="BusinessRuleTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="549.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_2">
+          <dc:Bounds height="11.0" width="98.0" x="555.0" y="57.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_BusinessRuleTask_3" bpmnElement="BusinessRuleTask_3" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="370.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_3">
+          <dc:Bounds height="28.0" width="92.0" x="379.0" y="49.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">
+        <dc:Bounds height="50.0" width="50.0" x="730.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_4">
+          <dc:Bounds height="28.0" width="58.0" x="726.0" y="88.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ScriptTask_1" bpmnElement="ScriptTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="700.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_5">
+          <dc:Bounds height="11.0" width="107.0" x="701.0" y="161.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_2">
+        <dc:Bounds height="36.0" width="36.0" x="737.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_6">
+          <dc:Bounds height="14.0" width="66.0" x="722.0" y="256.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_EndEvent_4" bpmnElement="EndEvent_4">
+        <dc:Bounds height="36.0" width="36.0" x="833.0" y="45.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_7">
+          <dc:Bounds height="14.0" width="66.0" x="818.0" y="81.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="BPMNShape_ServiceTask_1" bpmnElement="ServiceTask_1" isExpanded="true">
+        <dc:Bounds height="50.0" width="110.0" x="186.0" y="38.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_8">
+          <dc:Bounds height="14.0" width="104.0" x="189.0" y="56.0"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_BusinessRuleTask_3" targetElement="BPMNShape_BusinessRuleTask_1">
+        <di:waypoint xsi:type="dc:Point" x="480.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="514.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="549.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_9"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_BusinessRuleTask_1" targetElement="BPMNShape_ExclusiveGateway_1">
+        <di:waypoint xsi:type="dc:Point" x="659.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="694.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="730.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_10"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_ScriptTask_1">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="88.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="115.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="142.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_11"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="BPMNShape_ScriptTask_1" targetElement="BPMNShape_EndEvent_2">
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="192.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="206.0"/>
+        <di:waypoint xsi:type="dc:Point" x="755.0" y="220.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_12"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_EndEvent_4">
+        <di:waypoint xsi:type="dc:Point" x="780.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="806.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="833.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_13"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_ServiceTask_1">
+        <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="133.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="186.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_14"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_ServiceTask_1" targetElement="BPMNShape_BusinessRuleTask_3">
+        <di:waypoint xsi:type="dc:Point" x="296.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="333.0" y="63.0"/>
+        <di:waypoint xsi:type="dc:Point" x="370.0" y="63.0"/>
+        <bpmndi:BPMNLabel id="BPMNLabel_15"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn2:definitions>

+ 71 - 0
src/main/resources/net/p0f/samples/rules_processes/service_tasks/rules.drl

@@ -0,0 +1,71 @@
+package net.p0f.samples.rules_processes.service_tasks
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Award
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+query "Get Awards"
+	award: Award()
+end
+
+rule "Reward 10-years of gold status"
+	ruleflow-group "eligibility"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge >= 10)
+		$a: Award(reason == null)
+	then
+		// The "slightly" weird way of updating the award is because initially
+		// it is a process parameter mapped onto the business rule task, and as
+		// such, would not be visible to the gateway at the end as a fact.
+		// Retracting and inserting it again does not hurt this session, as it
+		// is visible as a fact anyway, but it does make it also visible to the
+		// gateway, as opposed to just using modify() or update().
+		$a.setReason("Congrats for 10 years of GOLD!");
+		$a.setCarrier($c);
+		retract($a);
+		insert($a);
+		System.out.println("Awarding 10 yrs of GOLD status.");
+end
+
+rule "Promote 10-years of gold status"
+	ruleflow-group "eligibility"
+	when
+		$c: Customer(loyaltyLevel == Customer.GOLD, loyaltyAge >= 10)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.PLATINUM);
+		}
+		System.out.println("Promoting " + $c.getName() + " to PLATINUM!"); 
+end
+
+rule "Bronze Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 10000, milesFlown <= 20000, loyaltyLevel != Customer.BRONZE)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.BRONZE);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Silver Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 20000, milesFlown <= 35000, loyaltyLevel != Customer.SILVER)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.SILVER);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end
+
+rule "Gold Status"
+	ruleflow-group "status"
+	when
+		$c: Customer(milesFlown > 35000, loyaltyLevel != Customer.GOLD)
+	then
+		modify ($c) {
+			setLoyaltyLevel(Customer.GOLD);
+		}
+		System.out.println("Setting " + $c.getName() + " status to " + $c.getLoyaltyLevel());
+end

+ 73 - 0
src/main/resources/net/p0f/samples/rules_processes/simple/simple-matching.drl

@@ -0,0 +1,73 @@
+package net.p0f.samples.rules_processes.simple
+
+// Must import data model as it's from a different package
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer
+
+// Some simple pattern matching examples.
+
+rule "Customers?"
+    when
+        Customer()
+    then
+		System.out.println("We have some customer(s)!");
+end
+
+rule "Gold of age?"
+    when
+        Customer(loyaltyLevel == Customer.GOLD, age >= 18)
+    then
+		System.out.println("We have GOLD customer(s)!");
+end
+
+rule "Gold underage?"
+    when
+        Customer(loyaltyLevel == Customer.GOLD && age < 18)
+    then
+		System.out.println("We have underage GOLD customer(s)!");
+end
+
+rule "Gold or underage? (option 1)"
+    when
+        Customer(loyaltyLevel == Customer.GOLD) or
+        Customer(age < 18)
+    then
+		System.out.println("We have either gold or underage customer(s) 1!");
+end
+
+rule "Gold or underage? (option 2)"
+    when
+        Customer(loyaltyLevel == Customer.GOLD || age < 18)
+    then
+		System.out.println("We have either gold or underage customer(s) 2!");
+end
+
+rule "Gold or underage? (option 1) a"
+    when
+        Customer(loyaltyLevel == Customer.GOLD)
+    then
+		System.out.println("We have either gold or underage customer(s) 1a!");
+end
+
+rule "Gold or underage? (option 1) b"
+    when
+        Customer(age < 18)
+    then
+		System.out.println("We have either gold or underage customer(s) 1b!");
+end
+
+// An example of capturing data:
+rule "Platinum of age?"
+    when
+        $c: Customer(loyaltyLevel == Customer.PLATINUM, $a: age >= 18)
+    then
+		System.out.println("We have a " + $a + "-year-old platinum customer: " + $c.getName());
+end
+
+// This rule belongs to a ruleflow group, so it will be ignored:
+rule "I never match"
+	ruleflow-group "somegroup"
+    when
+        Customer()
+    then
+		System.out.println("I never execute.");
+end