diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/ServerlessWorkflowUtils.java b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/ServerlessWorkflowUtils.java index 7c9de936772..03ae00308f4 100644 --- a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/ServerlessWorkflowUtils.java +++ b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/utils/ServerlessWorkflowUtils.java @@ -196,9 +196,9 @@ public static Optional loadResourceFile(Workflow workflow, Optional loadResourceFile(String uriStr, Optional workflow, Optional parserContext, String authRef) { final URI uri = URI.create(uriStr); try { - Builder builder = URIContentLoaderFactory.builder(uri).withAuthRef(authRef); - workflow.ifPresent(builder::withWorkflow); - parserContext.map(p -> p.getContext().getClassLoader()).ifPresent(builder::withClassloader); + Builder builder = URIContentLoaderFactory.builder(uri).withAuthRef(authRef); + workflow.ifPresent(builder::withWorkflow); + parserContext.map(p -> p.getContext().getClassLoader()).ifPresent(builder::withClassloader); return Optional.of(URIContentLoaderFactory.readAllBytes(builder.build())); } catch (UncheckedIOException io) { // if file cannot be found in build context, warn it and return the unmodified uri (it might be possible that later the resource is available at runtime)