Chapter 16. Red Hat Build of OptaPlanner on Red Hat build of Quarkus: an employee scheduler quick start guide The employee scheduler quick start application assigns employees to shifts on various positions in an organization. For example, you can use the application to distribute shifts in a hospital between nurses, guard duty shifts across a number of locations, or shifts on an assembly line between workers. Optimal employee scheduling must take a number of variables into account. For example, different skills can be required for shifts in different positions. Also, some employees might be unavailable for some time slots or might prefer a particular time slot. Moreover, an employee can have a contract that limits the number of hours that the employee can work in a single time period. The Red Hat Build of OptaPlanner rules for this starter application use both hard and soft constraints. During an optimization, the Planner engine may not violate hard constraints, for example, if an employee is unavailable (out sick), or that an employee cannot work two spots in a single shift. The Planner engine tries to adhere to soft constraints, such as an employee's preference to not work a specific shift, but can violate them if the optimal solution requires it. Prerequisites OpenJDK 11 or later is installed. Red Hat build of Open JDK is available from the Software Downloads page in the Red Hat Customer Portal (login required). Apache Maven 3.8 or higher is installed. Maven is available from the Apache Maven Project website. An IDE, such as IntelliJ IDEA, VSCode, or Eclipse is available. 16.1. Downloading and running the OptaPlanner employee scheduler Download the OptaPlanner employee scheduler quick start archive, start it in Quarkus development mode, and view the application in a browser. Quarkus development mode enables you to make changes and update your application while it is running. Procedure 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: Red Hat Build of OptaPlanner Version: 8.38 Download Red Hat Build of OptaPlanner 8.38 Quick Starts . Extract the rhbop-8.38.0-optaplanner-quickstarts-sources.zip file. Navigate to the org.optaplanner.optaplanner-quickstarts-8.38.0.Final-redhat-00004/use-cases/employee-scheduling directory. Enter the following command to start the OptaPlanner employee scheduler in development mode: USD mvn quarkus:dev To view the OptaPlanner employee scheduler, enter the following URL in a web browser. To run the OptaPlanner employee scheduler, click Solve . Make changes to the source code then press the F5 key to refresh your browser. Notice that the changes that you made are now available. 16.2. Package and run the OptaPlanner employee scheduler When you have completed development work on the OptaPlanner employee scheduler in quarkus:dev mode, run the application as a conventional jar file. Prerequisites You have downloaded the OptaPlanner employee scheduling quick start. Procedure Navigate to the /use-cases/vaccination-scheduling directory. To compile the OptaPlanner employee scheduler, enter the following command: USD mvn package To run the compiled OptaPlanner employee scheduler, enter the following command: USD java -jar ./target/quarkus-app/quarkus-run.jar Note To run the application on port 8081, add -Dquarkus.http.port=8081 to the preceding command. To start the OptaPlanner employee scheduler, enter the following URL in a web browser.

Commands:
mvn quarkus:dev
http://localhost:8080/
mvn package
java -jar ./target/quarkus-app/quarkus-run.jar
http://localhost:8080/