From 876f0acda2718f9e7ab4409936d0bfb65cd876d1 Mon Sep 17 00:00:00 2001 From: Emanuele Ferrelli Date: Tue, 1 Apr 2025 16:33:22 +0200 Subject: [PATCH] Update Codegenie step --- .../services/ScenarioExecutionService.java | 2 +- .../stepSolvers/ExternalCodeGenieSolver.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java b/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java index a6f8229..adab07c 100644 --- a/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java +++ b/src/main/java/com/olympus/hermione/services/ScenarioExecutionService.java @@ -387,7 +387,7 @@ public class ScenarioExecutionService { public String folderToBase64(String folderName) throws Exception { File folder = new File(uploadDir, folderName); if (!folder.exists() || !folder.isDirectory()) { - throw new IllegalArgumentException("La cartella specificata non esiste o non รจ una directory"); + throw new IllegalArgumentException("Folder does not exist or is not in a directory"); } // File ZIP temporaneo diff --git a/src/main/java/com/olympus/hermione/stepSolvers/ExternalCodeGenieSolver.java b/src/main/java/com/olympus/hermione/stepSolvers/ExternalCodeGenieSolver.java index ad8dff7..d1cdaf8 100644 --- a/src/main/java/com/olympus/hermione/stepSolvers/ExternalCodeGenieSolver.java +++ b/src/main/java/com/olympus/hermione/stepSolvers/ExternalCodeGenieSolver.java @@ -40,6 +40,7 @@ public class ExternalCodeGenieSolver extends StepSolver { private String codegenie_project; private String codegenie_model_provider; private String codegenie_output_type; + private String force_application_name; @Autowired private ScenarioExecutionRepository scenarioExecutionRepo; @@ -91,6 +92,10 @@ public class ExternalCodeGenieSolver extends StepSolver { this.codegenie_output_type = (String) this.step.getAttributes().get("codegenie_output_type"); logger.info("codegenie_output_type: " + this.codegenie_output_type); } + if (this.step.getAttributes().get("codegenie_output_type") != null) { + this.codegenie_output_type = (String) this.step.getAttributes().get("codegenie_output_type"); + logger.info("codegenie_output_type: " + this.codegenie_output_type); + } AttributeParser attributeParser = new AttributeParser(this.scenarioExecution); @@ -98,6 +103,12 @@ public class ExternalCodeGenieSolver extends StepSolver { this.codegenie_application = attributeParser .parse((String) this.step.getAttributes().get("codegenie_application")); this.codegenie_project = attributeParser.parse((String) this.step.getAttributes().get("codegenie_project")); + if(this.step.getAttributes().get("force_application_name") != null){ + this.force_application_name = (String) this.step.getAttributes().get("force_application_name"); + logger.info("force_application_name: " + this.force_application_name); + }else{ + this.force_application_name = this.codegenie_application; + } } @@ -135,7 +146,8 @@ public class ExternalCodeGenieSolver extends StepSolver { JSONObject requestBody = new JSONObject(); requestBody.put("execution_id", this.scenarioExecution.getId()); requestBody.put("docs_zip_file", this.codegenie_input); - requestBody.put("application", this.codegenie_application); + // requestBody.put("application", this.codegenie_application); + requestBody.put("application", this.force_application_name); requestBody.put("project", this.codegenie_project); requestBody.put("output_type", output_type); requestBody.put("output_variable", this.codegenie_output_variable);