Overview
The Data-Audit subsystem enables the storage of events issued by various process components and persists them in a structured format. It captures the complete evolution of process instances, from creation to completion, including all intermediate state changes. The Data-Audit system consists of several modules:- Data-Audit Common: Provides the common framework to create implementations
- Data-Audit «Quarkus»: Provides the wiring to use Data-Audit with Quarkus as a colocated service
- Data-Audit JPA Common: Provides the common extension that doesn’t depend on the runtime
- Data-Audit JPA «Quarkus»: Provides the wiring between the specific implementation and Quarkus System
Key Features
Comprehensive Event Recording
The Data-Audit subsystem records events from multiple sources:- Workflow Engine Events: Process instance creation, state transitions, completion
- User Task Events: Task creation, assignment, completion
- Temporal Events: Timer creation, execution, cancellation
- Variable Events: Data modifications throughout the process lifecycle
Immutable Audit Trail
The Process History Service maintains an immutable record of all events, ensuring compliance with regulatory requirements and providing a trusted audit trail for:- Compliance verification
- Process forensics
- Legal documentation
- Historical analysis
Temporal Querying
Through its GraphQL interface, the Data-Audit service supports sophisticated temporal queries that can:- Identify historical patterns
- Compare process performance over time
- Reconstruct the state of a process at any point in time
- Analyze decision paths and outcomes
Extensibility
The Data-Audit subsystem provides several extension points:- Storage customization
- Query customization
- Event filtering
- Security integration
Querying the Process History Service
The Data-Audit service exposes a GraphQL endpoint for querying historical process data:Example Queries
Retrieve Process Instance States
This example shows how to retrieve all process instance states:Register a Custom Query
You can register custom queries to extract specific information:Schema Discovery
To retrieve the GraphQL schema definition including a list of all registered queries, run a GET command to:Adding Data-Audit to Your Project
To enable the Process History Service in your project, add the following dependencies:Java Persistence API (JPA) Implementation
The JPA implementation allows you to store the events in a relational database. This implementation uses the same database connection as your application, simplifying configuration and deployment. Depending on your database, you may need additional dependencies:Extension Points
The Data-Audit system provides several extension points for customization:Context Factory
org.kogito.kie.app.audit.spi.DataAuditContextFactory depends on the runtime and enables the creation of the context needed by a particular implementation.
Runtime-Independent Extensions
These extension points do not depend on the runtime:org.kie.kogito.app.audit.spi.DataAuditStore: Stores the data in a particular wayorg.kie.kogito.app.audit.spi.GraphQLSchemaQuery<T>: Enables execution of a GraphQL queryorg.kie.kogito.app.audit.spi.GraphQLSchemaQueryProvider: Enables the subsystem to identify additional queries provided by the end user
Configuration
The Data-Audit service is automatically configured to use the same data source as your main application. The most relevant configuration properties are:Best Practices
Data Volume Management
- Implement appropriate retention policies for audit data
- Consider archiving older audit data to cold storage
- Monitor the growth of audit tables
Query Performance
- Create custom queries for frequently used reports
- Use pagination for large result sets
- Index database fields used in filtering
Compliance Requirements
- Document the audit trail capabilities for regulatory reviews
- Ensure audit data is properly secured
- Implement backup strategies appropriate for compliance requirements