14.8. Creating a Process Using BPMN Maven Process Wizard

Use can use the JBoss BPM Suite Maven Project Wizard to set up an executable sample project to start using processes immediately by using Maven to define your project's properties and dependencies. This wizard sets up a Maven project using a pom.xml, and includes a sample process and Java class to execute it.

Procedure 14.9.  Create a New Process

  1. To create a new project, select FileNewProject and then select jBPMjBPM Project (Maven).
  2. Enter a name for your project and click Finish.
    This creates your maven project with a sample process in the src/main/resources directory and a Java class that can be used to execute the sample process. In addition to that, the project contains:
    • A pom.xml file containing the following:
      <?xml version="1.0" encoding="UTF-8"?>
      <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/xsd/maven-4.0.0.xsd">
      
        <modelVersion>4.0.0</modelVersion>
      
        <groupId>com.sample</groupId>
        <artifactId>jbpm-example</artifactId>
        <version>1.0.0-SNAPSHOT</version>
      
        <name>jBPM :: Sample Maven Project</name>
        <description>A sample jBPM Maven project</description>
      
        <properties>
          <jbpm.version>6.0.0.Final</jbpm.version>
        </properties>
      
        <repositories>
          <repository>
            <id>redhat-techpreview-all-repository</id>
            <name>Red Hat Tech Preview repository (all)</name>
            <url>http://maven.repository.redhat.com/techpreview/all/</url>
            <releases>
              <enabled>true</enabled>
              <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
              <enabled>true</enabled>
              <updatePolicy>daily</updatePolicy>
            </snapshots>
          </repository>
        </repositories>
      
        <dependencies>
          <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-test</artifactId>
            <version>${jbpm.version}</version>
          </dependency>
        </dependencies>
      </project>
    • A kmodule.xml configuration file under the META-INF folder. The kmodule.xml defines which resources (like processes, rules) are to be loaded as part of your project. In this case, it defines a knowledge base called kbase that loads all the resources in the com.sample directory as shown below:
      
      <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
        <kbase name="kbase" packages="com.sample"/>
      </kmodule>
      
  3. Update the project properties in the Properties tab and specify the JBoss BPM Suite version.
    It adds the JBoss Nexus Maven repository (where all the JBoss BPM Suite JARs and their dependencies are located) to your project and configures the dependencies.

    Note

    By default, only the jbpm-test JAR is specified as a dependency, as this has transitive dependencies to almost all of the core dependencies you will need. You are free to update the dependencies section however to include only the dependencies you need.