diff --git a/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/di/DependencyInjectionAnnotator.java b/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/di/DependencyInjectionAnnotator.java index d6f19bd3ffa..eb8c3126158 100644 --- a/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/di/DependencyInjectionAnnotator.java +++ b/kogito-codegen-modules/kogito-codegen-api/src/main/java/org/kie/kogito/codegen/api/di/DependencyInjectionAnnotator.java @@ -263,5 +263,5 @@ default Expression getOptionalInstance(String fieldName) { default > T withTagAnnotation(T node, NodeList attributes) { return node; - }; + } } diff --git a/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/process/TagResourceGenerator.java b/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/process/TagResourceGenerator.java index af0c6a835a6..0f5deecfb86 100644 --- a/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/process/TagResourceGenerator.java +++ b/kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/process/TagResourceGenerator.java @@ -44,12 +44,14 @@ private TagResourceGenerator() { * @param process the {@link KogitoWorkflowProcess} to get the tags from */ static void addTags(CompilationUnit compilationUnit, KogitoWorkflowProcess process, KogitoBuildContext context) { - Map metadata = process.getMetaData(); - @SuppressWarnings("unchecked") - Collection tags = (Collection) metadata.getOrDefault(Metadata.TAGS, Set.of()); - String description = (String) metadata.get(Metadata.DESCRIPTION); - compilationUnit.findAll(ClassOrInterfaceDeclaration.class) - .forEach(cls -> addTags(process, tags, description, cls, context)); + if (context.hasDI()) { + Map metadata = process.getMetaData(); + @SuppressWarnings("unchecked") + Collection tags = (Collection) metadata.getOrDefault(Metadata.TAGS, Set.of()); + String description = (String) metadata.get(Metadata.DESCRIPTION); + compilationUnit.findAll(ClassOrInterfaceDeclaration.class) + .forEach(cls -> addTags(process, tags, description, cls, context)); + } } private static void addTags(KogitoWorkflowProcess process, Collection tags, String description, ClassOrInterfaceDeclaration cls, KogitoBuildContext context) {