Getting Started with the Aletyx Enterprise Build of Kogito and Drools Quarkus Maven Archetype to try the Adaptive Process Architecture with Quarkus™¶
This guide demonstrates how to use the Aletyx Enterprise Build of Kogito and Drools Quarkus Maven Archetype to create a fully-configured business automation project quickly to see how process can be built with mvn quarkus:dev and the Adaptive Process Architecture.
Introduction¶
The Aletyx Enterprise Build of Kogito and Drools Quarkus Maven Archetype Quarkus Maven Archetype provides a standardized template for creating new Kogito/jBPM projects with a focus on business automation. The archetype creates two distinct architectures you can try as a developer:
- Using
mvn quarkus:devto see how the Quarkus Developer UI Tools work, located at http://localhost:8080/q/dev-ui - Using a combination of
mvn clean installanddocker compose up --buildto build a local version of the Adaptive Process Architecture with the components to mimic how your process could look.
Within these configurations, the associated datasources are created attached to the environments. For mvn quarkus:dev this is a local, non-persisted instance that will go away when your service stops. With the Adaptive Process Architecture version, a PostgreSQL container is built with the appropriate SQL required for it to work within the docker-compose.yaml. This process helps mimic what would be used when deployed to your container platform of choice.
Prerequisites¶
Before starting, ensure you have the following installed:
- Java™ 17 or higher
- Apache Maven™ 3.9.6+
- Docker® and Docker Compose™ (for containerized deployment)
- PostgreSQL® (optional, for local development without containers)
Creating a New Project¶
Step 1: Generate the Project¶
Run the following command to create a new project using the Aletyx Enterprise Build of Kogito and Drools Quarkus Maven Archetype:
mvn archetype:generate \
-DarchetypeGroupId=ai.aletyx.archetypes \
-DarchetypeArtifactId=quarkus-kogito-jbpm-archetype \
-DarchetypeVersion=1.0.0 \
-DgroupId=com.example \
-DartifactId=my-kogito-app \
-Dversion=1.0.0-SNAPSHOT \
-Dpackage=com.example.test \
-DkogitoVersion=10.1.0-aletyx \
-DquarkusVersion=3.20.3
This command will: 1. Connect to the repository containing the archetype 2. Download the archetype 3. Generate a new project based on the archetype template 4. Customize the project with the parameters you provided at the artifactId folder in the directory this is ran from.
Step 2: Explore the Generated Project¶
Navigate to the newly created project directory:
The generated project will have the following structure:
my-kogito-app/
├── Dockerfile # Docker file for containerization
├── README.md # Project README with usage instructions
├── docker-compose.yaml # Docker Compose configuration
├── docker-compose/ # Docker Compose supporting files
│ ├── pgadmin/ # pgAdmin configuration
│ │ ├── pgpass
│ │ └── servers.json
│ └── postgres/ # PostgreSQL configuration
│ ├── Dockerfile
│ └── sql/ # SQL initialization scripts
│ ├── 01_init.sql
│ ├── data-audit.sql
│ ├── data-index.sql
│ ├── jobs-service.sql
│ ├── runtime-persistence.sql
│ └── user-tasks.sql
├── pom.xml # Project POM file
└── src/
├── main/
│ ├── java/ # Java source files
│ │ ├── listeners/ # Process event listeners
│ │ │ └── MinimalClaimListener.java
│ │ └── model/ # Domain model classes
│ │ └── Policy.java
│ └── resources/ # Resource files
│ ├── application.properties # Application configuration
│ └── claim_initiation.bpmn # Sample BPMN process
└── test/ # Test files
├── java/
└── resources/
Running the Application in Development Mode¶
Step 1: Start the Development Server¶
Run the following command to start the application in development mode:
This will start a development server with hot reloading enabled.
Step 2: Access the Application¶
Once the application is running, you can access:
- Application API: http://localhost:8080
- Swagger UI: http://localhost:8080/q/swagger-ui
- Dev UI: http://localhost:8080/q/dev-ui
Step 3: Test the Sample Process¶
- Navigate to the Swagger UI™ at http://localhost:8080/q/swagger-ui
- Find the "claim_initiation" process endpoint
- Create a new process instance by sending a request with "Home" as the claimType
- The process will create a user task assigned to user "jdoe"
- You can claim and complete the task by impersonating as "jdoe"
Running with Docker Compose¶
For a full deployment including PostgreSQL persistence and the Kogito Management Console:
Step 1: Build the Application¶
First, build the application:
Step 2: Start the Docker Compose Environment¶
Launch all services using Docker Compose:
This will start: - PostgreSQL database (port 5432) - Your application (port 8080) - Kogito Management Console (port 8280) - pgAdmin (port 8055)
Step 3: Access the Services¶
- Application API: http://localhost:8080
- Swagger UI: http://localhost:8080/q/swagger-ui
- Management Console: http://localhost:8280
- pgAdmin: http://localhost:8055 (login with user@kie.org / pass)
Step 4: Test the Application¶
- Navigate to http://localhost:8080/q/swagger-ui
- Test the claim_initiation process (use "Home" for the claimType)
- Navigate to http://localhost:8280 to open the Management Console
- Connect to a new service at http://localhost:8080
- Monitor the process instance in the Management Console
- Complete the task by impersonating as user "jdoe"
- Verify the process is completed in the Management Console
Customizing the Project¶
Adding New Processes¶
- Create new BPMN™ files in
src/main/resources - They will be automatically compiled and deployed when the application starts
Creating Process Event Listeners¶
- Create a new class that extends
DefaultKogitoProcessEventListener - Annotate it with
@ApplicationScoped - Override the desired event methods, such as:
beforeProcessStartedafterProcessStartedbeforeTaskCompletedafterTaskCompleted
Example:
@ApplicationScoped
public class MyProcessListener extends DefaultKogitoProcessEventListener {
private static final Logger LOGGER = LoggerFactory.getLogger(MyProcessListener.class);
@Override
public void afterProcessStarted(ProcessStartedEvent event) {
LOGGER.info("Process started: {}", event.getProcessInstance().getProcessId());
}
@Override
public void afterTaskCompleted(TaskCompletedEvent event) {
LOGGER.info("Task completed: {}", event.getTask().getName());
}
}
Deployment Options¶
The generated project supports several deployment options:
Local Development¶
Use the default profile for local development with in-memory persistence:
Docker Compose¶
Use the compose profile for containerized deployment with PostgreSQL:
Red Hat OpenShift® Deployment¶
Use the Red Hat OpenShift® profile for deploying to OpenShift:
Conclusion¶
The Aletyx Enterprise Build of Kogito and Drools Quarkus Maven Archetype provides a comprehensive starting point for building business automation applications with Kogito, jBPM, and Quarkus. By using this archetype, you can quickly set up a project with all the necessary components for workflow automation, decision management, and business rules processing.