Skip to content

Error when using dashes in subFlowRefs #4071

@oEscal

Description

@oEscal

Describe the bug

When creating a workflow with a subFlowRef whose ID has dashes, the user gets an error when building it using Quarkus.
For instance, for a workflow with:

states:
  - name: advertise-listing
      type: operation
      actions:
        - subFlowRef: advertise-listing
      end: true

I got the error:

$ kn workflow quarkus build --image=workflow --jib
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.20.1:build (default) on project workflow: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor#generateModel threw an exception: org.kie.memorycompiler.KieMemoryCompilerException: [org/kie/kogito/serverless/ValveProcess.java (16:109) : ';' expected, org/kie/kogito/serverless/ValveProcess.java (16:117) : <identifier> expected]
[ERROR]         at org.kie.memorycompiler.KieMemoryCompiler.compileNoLoad(KieMemoryCompiler.java:140)
[ERROR]         at org.kie.memorycompiler.KieMemoryCompiler.compileNoLoad(KieMemoryCompiler.java:108)
[ERROR]         at org.drools.quarkus.util.deployment.DroolsQuarkusResourceUtils.compileGeneratedSources(DroolsQuarkusResourceUtils.java:148)
[ERROR]         at org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor.createGeneratedBeanBuildItemsFromJavaSources(KogitoAssetsProcessor.java:309)
[ERROR]         at org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor.generateModel(KogitoAssetsProcessor.java:189)
[ERROR]         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:840)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:499)

The problem seems to be with the process class generation, because this was what I got (notice that the dash is channelled into the corresponding Process variable name, which in Java is then treated as a minus sign):

@jakarta.enterprise.context.ApplicationScoped()
@jakarta.inject.Named("valve")
@io.quarkus.runtime.Startup()
public class ValveProcess extends org.kie.kogito.process.impl.AbstractProcess<org.kie.kogito.serverless.workflow.models.JsonNodeModel> {

    @jakarta.inject.Inject()
    @jakarta.inject.Named("advertise-listing")
    org.kie.kogito.process.Process<org.kie.kogito.serverless.workflow.models.JsonNodeModel> processadvertise-listing;
[...]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions