@startuml
'https://plantuml.com/sequence-diagram


title Primary Resource directly compiled to class

autonumber 1
actor Resource_provider
note over Resource_provider: Any service requiring codegen/class compilation (e.g. Kie Maven Plugin, Kogito, KieLoaderService)

Resource_provider -> Compilation_Manager: compile (Primary Resource)
Compilation_Manager --> Compilation_Manager: Find specific KieCompilerService (Primary Resource)
Compilation_Manager --> KieCompilerService: process (Primary Resource)
KieCompilerService --> Compilation_Manager: Compiled Class
Compilation_Manager -> Resource_provider: IndexFile
Resource_provider -> Resource_provider: Consume IndexFile

newpage Primary Resource compiled to Intermediate Resource

autonumber 1
note over Resource_provider: Any service requiring codegen/class compilation (e.g. Kie Maven Plugin, Kogito, KieLoaderService)

Resource_provider -> Compilation_Manager: compile (Primary Resource)
Compilation_Manager --> Compilation_Manager: Find specific KieCompilerService (Primary Resource)
Compilation_Manager --> KieCompilerService: process (Primary Resource)
KieCompilerService --> Compilation_Manager: Intermediate Resource
Compilation_Manager --> Compilation_Manager: Find specific KieCompilerService (Intermediate Resource)
Compilation_Manager --> KieCompilerService: process (Intermediate Resource)
KieCompilerService --> Compilation_Manager: Compiled Class
Compilation_Manager -> Resource_provider: IndexFile
Resource_provider -> Resource_provider: Consume IndexFile

@enduml