A Gradle project using Spring Boot with Cyoda integration for building scalable web clients with workflow-driven backend interactions.
🛠️ Getting Started
☕ Java 21 Required
Make sure Java 21 is installed and set as the active version.
1. Clone the Project
git clone https://github.com/Cyoda-platform/java-client-template.git
cd java-client-template
2. ⚙️ Configure the Application
Configuration is managed via Spring Boot YAML files. For local development:
# Option 1: Create a local profile
# For example, create src/main/resources/application-local.yml with your settings
./gradlew runApp --args='--spring.profiles.active=local'
# Option 2: Use environment variables
export APP_CONFIG_CYODA_HOST=your-cyoda-host:8443
export APP_CONFIG_CYODA_CLIENT_ID=your-client-id
export APP_CONFIG_CYODA_CLIENT_SECRET=your-client-secret
3. 🧰 Run Workflow Import Tool
Option 1: Run via Gradle (recommended for local development)
Note: The default port is 8080 as configured in src/main/resources/application.yml. You can change this by setting the server.port property.
🏗️ Project Structure
This template follows a clear separation between framework code (that you don’t modify) and application code (where you implement your business logic).
src/main/java/com/java_template/common/ - Framework Code (DO NOT MODIFY)
Core Framework Components:
auth/ – Authentication & token management for Cyoda integration
config/ – Configuration classes using Spring Boot’s configuration management
dto/ – Data transfer objects including EntityWithMetadata<T> wrapper
grpc/ – gRPC client integration with Cyoda platform
repository/ – Data access layer for Cyoda REST API operations
service/ – EntityService interface and implementation for all Cyoda operations
serializer/ – Serialization framework with fluent APIs (ProcessorSerializer, CriterionSerializer)
tool/ – Utility tools like WorkflowImportTool for importing workflow configurations
Domain objects that represent your business data. Must implement CyodaEntity interface and be placed in application/entity/ directory.
What is a CyodaProcessor?
Workflow components that handle business logic and entity transformations. Critical limitation: Cannot update the current entity being processed via EntityService.
What is a CyodaCriterion?
Pure functions that evaluate conditions without side effects. Must not modify entities or have side effects.
EntityWithMetadata Pattern
Unified wrapper that includes both entity data and technical metadata (UUID, state, etc.). Used consistently across controllers, processors, and criteria.
🔄 Workflow Configuration
Workflows are defined using finite-state machine (FSM) JSON files placed in:
Java Client Template
A Gradle project using Spring Boot with Cyoda integration for building scalable web clients with workflow-driven backend interactions.
🛠️ Getting Started
1. Clone the Project
2. ⚙️ Configure the Application
Configuration is managed via Spring Boot YAML files. For local development:
3. 🧰 Run Workflow Import Tool
Option 1: Run via Gradle (recommended for local development)
Option 2: Build and Run JAR (recommended for CI or scripting)
4. ▶️ Run the Application
Option 1: Run via Gradle
Option 2: Run Manually After Build
🏗️ Project Structure
This template follows a clear separation between framework code (that you don’t modify) and application code (where you implement your business logic).
src/main/java/com/java_template/common/- Framework Code (DO NOT MODIFY)Core Framework Components:
auth/– Authentication & token management for Cyoda integrationconfig/– Configuration classes using Spring Boot’s configuration managementdto/– Data transfer objects includingEntityWithMetadata<T>wrappergrpc/– gRPC client integration with Cyoda platformrepository/– Data access layer for Cyoda REST API operationsservice/–EntityServiceinterface and implementation for all Cyoda operationsserializer/– Serialization framework with fluent APIs (ProcessorSerializer,CriterionSerializer)tool/– Utility tools likeWorkflowImportToolfor importing workflow configurationsutil/– Various utility functions and helpersworkflow/– Core interfaces:CyodaEntity,CyodaProcessor,CyodaCriterionsrc/main/java/com/java_template/application/- Your Business Logic (CREATE AS NEEDED)Your Implementation Areas:
controller/– REST endpoints and HTTP API controllersentity/– Domain entities implementingCyodaEntityinterfaceprocessor/– Workflow processors implementingCyodaProcessorinterfacecriterion/– Workflow criteria implementingCyodaCriterioninterface🔑 Core Concepts
What is a CyodaEntity?
Domain objects that represent your business data. Must implement
CyodaEntityinterface and be placed inapplication/entity/directory.What is a CyodaProcessor?
Workflow components that handle business logic and entity transformations. Critical limitation: Cannot update the current entity being processed via EntityService.
What is a CyodaCriterion?
Pure functions that evaluate conditions without side effects. Must not modify entities or have side effects.
EntityWithMetadata Pattern
Unified wrapper that includes both entity data and technical metadata (UUID, state, etc.). Used consistently across controllers, processors, and criteria.
🔄 Workflow Configuration
Workflows are defined using finite-state machine (FSM) JSON files placed in:
Workflow Schema Reference
The workflow configuration schema is defined in:
This schema defines the structure for workflow definitions, including states, transitions, processors, and criteria.
Key Concepts
@Componentannotation📚 Documentation and Examples
Code Examples
src/test/java/com/example/application/- Complete implementation examples for all componentscontroller/- REST controller patternsentity/- Entity class implementationsprocessor/- Workflow processor examplescriterion/- Workflow criteria examplespatterns/- Comprehensive patterns and anti-patterns guideConfiguration Examples
llm_example/config/- Configuration templates and examplesworkflow/- Workflow JSON configuration templatesDocumentation Files
README.md- Complete project documentation (this file)CONTRIBUTING.md- Contributors guide and validation workflowusage-rules.md- Developer and AI agent guidelines.augment-guidelines- Project overview and development workflowllms.txt/llms-full.txt- AI-friendly documentation references📝 Quick Reference
Key Concepts
common/) - Never modify, provides all Cyoda integrationapplication/) - Your business logic implementation areaImplementation Checklist
CyodaEntitywithgetModelKey()andisValid()CyodaProcessorwithprocess()andsupports()CyodaCriterionwithcheck()andsupports()@Componentannotation for Spring discoverysrc/main/resources/workflow/$entity_name/version_$version/llm_example/for implementation patternsCritical Limitations
common/directory🚀 Getting Started
llm_example/code/for implementation patternsCyodaEntityinapplication/entity/CyodaProcessorinapplication/processor/CyodaCriterioninapplication/criterion/src/main/resources/workflow/application/controller/🔧 Development Workflow
llm_example/directory for patterns before implementing new featuresusage-rules.mdfor detailed implementation guidelines./gradlew buildto generate required classes before developmentFor Contributors:
CONTRIBUTING.mdfor detailed guidelinesPackage Management
Always use appropriate package managers for dependency management:
build/generated-sources/js2p/org/cyoda/cloud/api/eventclasses are available via./gradlew build