Chapter 4. Downloading Red Hat build of OptaPlanner examples
You can download the Red Hat build of OptaPlanner examples as a part of the Red Hat Process Automation Manager add-ons package available on the Red Hat Customer Portal.
Navigate to the Software Downloads page in the Red Hat Customer Portal (login required), and select the product and version from the drop-down options:
- Product: Process Automation Manager
- Version: 7.12
- Download Red Hat Process Automation Manager 7.12 Add Ons.
rhpam-7.12.0-add-ons.zipfile. The extracted
add-onsfolder contains the
rhpam-7.12.0-planner-engine directory contains example source code under the following subdirectories:
4.1. Running OptaPlanner examples
Red Hat build of OptaPlanner includes several examples that demonstrate a variety of planning use cases. Download and use the examples to explore different types of planning solutions.
- You have downloaded and extracted the examples as described in Chapter 4, Downloading Red Hat build of OptaPlanner examples.
To run the examples, in the
rhpam-7.12.0-planner-engine/examplesdirectory enter one of the following commands:
Linux or Mac:
The OptaPlanner Examples window opens.
- Select an example to run that example.
Red Hat build of OptaPlanner has no GUI dependencies. It runs just as well on a server or a mobile JVM as it does on the desktop.
4.2. Running the Red Hat build of OptaPlanner examples in an IDE (IntelliJ, Eclipse, or Netbeans)
If you use an integrated development environment (IDE), such as IntelliJ, Eclipse, or Netbeans, you can run your downloaded OptaPlanner examples within your development environment.
- You have downloaded and extracted the OptaPlanner examples as described in Chapter 4, Downloading Red Hat build of OptaPlanner examples.
Open the OptaPlanner examples as a new project:
For IntelliJ or Netbeans, open
examples/sources/pom.xmlas the new project. The Maven integration guides you through the rest of the installation. Skip the rest of the steps in this procedure.
For Eclipse, open a new project for the
/examples/binariesdirectory, located under the
- For IntelliJ or Netbeans, open
Add all the JAR files that are in the
binariesdirectory to the classpath, except for the
Add the Java source directory
src/main/javaand the Java resources directory
src/main/resources, located under the
Create a run configuration:
VM parameters (optional):
-Xmx512M -server -Dorg.optaplanner.examples.dataDir=examples/sources/data
- Main class:
- Run the run configuration.