JBoss.orgCommunity Documentation
In this chapter we suggest a step-by-step walk-through of creating and configuring your own simple process. Let's try to organize a new jBPM project.
A wizard for creating a jBPM project is included in the GPD plugin. We have opted to create a project based on a template already containing a number of advanced artifacts that we will ignore for this section. In the future we will elaborate this wizard and offer the possibility to create an empty jBPM project as well as projects based on templates taken from the jBPM tutorial.
This section will show you how to use the Creation wizard for creating a new jBPM project with already included source folders.
At first you should select File >New Project... and then JBoss jBPM > Process Project in the New Project dialog:
Clicking Next brings us to the wizard page where it's necessary to specify the name and location for the project. We choose, for example, HellojBPM as the name and accept the default location.
Thus, our project will be created in the workspace root directory by default. If you want to change the directory for your future project, deselect Use default location and click Browse... button to set needed location or simply type it.
On the next screen you'll be prompted to select the core jBPM location that we have defined in the previous chapter.
Clicking on Finish results in the project being generated. The wizard creates four source folders: one for the processes ( src/main/jpdl ), one for the java sources ( src/main/java ), one for the unit tests ( src/test/java ) and one for the resources such as the jbpm.properties and the hibernate.properties files ( src/main/config ). In addition a classpath container with all the core jBPM libraries is added to the project
Looking inside the different source folders will reveal a number of other artifacts that were generated, but we will leave these untouched for the moment. Instead, we will look at another wizard that enables us to create an empty process definition.
Now when the project is set up, we can use a Creation wizard to create an empty process definition. Bring up the New wizard by clicking the File > New > Other... menu item. The wizard opens on the Select Wizard page.
Selecting the JBoss jBPM category, then the Process Definition item and clicking on the Next button brings us to the Create Process Definition page.
We choose hello as the name of the process archive file. Click on the Finish button to end the wizard and open the process definition editor.
You can see in the Package Explorer that creating a process definition involves creating a folder with the name of the process definition and populating this folder with two .xml files : gpd.xml and processdefinition.xml.
The gpd.xml contains the graphical information used by the process definition editor. The processdefinition.xml file contains the actual process definition info without the graphical rendering info. At present, the GPD assumes that these two files are siblings. More sophisticated configuration will be supported later.
Now we are ready to create a very simple process definition consisting of a begin state, an intermediate state and an end state.
To make the configuration of actions much easier it's better to use the jPDL perspective. It provides the tabbed Properties Editor which allows to configure all the relevant properties of the current selected item.
At first select respectively Start, State and End on the tools palette and click on the canvas to add these nodes to the process definition. The result should look similar to this:
Then, we will connect the nodes with transitions. To do that select the Transition tool in the tools palette and click on the Start node, then move to the State node and click again to see the transition being drawn. Perform the same steps to create a transition from the State node to the End node. The result will look like:
Now, when you've got background knowledge of simple project creation, let's move to more advanced tools.