Document processing integration application that transforms ABBYY OCR XML output into Equinor's standardized XML format and delivers it to Equinor backend systems.
- XML Processing Pipeline: Polls folders for ABBYY-generated XML files and transforms them using XSLT
- Schema Validation: Validates XML against XSD schemas before processing
- Document Aggregation: Aggregates multiple XML documents by correlation ID
- OAuth2 Authentication: Secure API access via Azure AD bearer tokens
- Mailroom Integration: Sends scanned documents as PDF email attachments
- Scheduled Cleanup: Automatic deletion of old processed files
| Technology | Version | Purpose |
|---|---|---|
| Spring Boot | 2.6.0 | Application framework |
| Apache Camel | 3.13.0 | Integration/routing engine |
| Java | 8 | Primary language |
| Groovy | - | Scripting and utilities |
| Saxon | - | XSLT transformation engine |
| Install4j | 9.0.5 | Windows installer generation |
equinorabbyyintegration/
├── src/main/
│ ├── groovy/dk/bpas/equinor/gomintegration/
│ │ ├── GomApplication.java # Spring Boot entry point
│ │ ├── routes/ # Camel route definitions
│ │ ├── utilities/ # Processing utilities
│ │ └── tools/ # Services (email, cleanup)
│ └── resources/
│ ├── application.properties # Configuration
│ ├── *.xsl # XSLT stylesheets
│ └── *.xsd # XML schemas
├── fromFolder/ # Production input
├── fromTestFolder/ # Test input
├── toFolder/ # Production output
├── toTestFolder/ # Test output
└── build.gradle # Build configuration
The following environment variables must be set for OAuth2 authentication:
| Variable | Description |
|---|---|
DEV_OAUTH_CLIENT_ID |
Development OAuth client ID |
DEV_OAUTH_CLIENT_SECRET |
Development OAuth client secret |
QA_OAUTH_CLIENT_ID |
QA OAuth client ID |
QA_OAUTH_CLIENT_SECRET |
QA OAuth client secret |
PROD_OAUTH_CLIENT_ID |
Production OAuth client ID |
PROD_OAUTH_CLIENT_SECRET |
Production OAuth client secret |
Key configuration in application.properties:
- Folder paths for file polling
- OAuth2 endpoints for DEV/QA/PROD environments
- Email settings for mailroom integration
- File cleanup schedule and retention period
# Run tests
gradle test
# Build Spring Boot JAR
gradle bootJar
# Create Windows installer (requires Install4j license)
gradle copyInstall4JMediajava -jar build/libs/equinorabbyyintegration.jarABBYY XML Files → File Polling → BOM Removal → Namespace Stripping
→ Element Restructuring → XSD Validation → XSLT Transformation
→ Document Aggregation → OAuth2 Token → HTTP POST to Equinor
→ Output Saved
- Restructure XML: Uses
remove_namespace.xslandrename_details.xsl - Validate XML: Uses
abbyySummary.xsd,abbyyDetails.xsd,abbyySummary_Details.xsd,abbyyIncludes.xsd - Transform to Equinor format: Uses
Summary.xsl,Details.xsl,Summary_Details.xsl - Aggregate:
XmlAggregationStrategycombines multiple XMLs into one file
- Summary
- Details
- Summary_Details
- Verification
Each document type has its own test case to verify that the generated Equinor XML files are correct.
gradle testPush to Bitbucket triggers the pipeline (bitbucket-pipelines.yml):
- Run Gradle tests
- Build Spring Boot JAR
- Generate Windows EXE installer
- Upload artifacts
The EXE is built automatically if all tests pass.
See AGENTS.md for security review findings and credential management practices.
BPA Solutions A/S