Update Codegenie step

This commit is contained in:
2025-04-01 16:33:22 +02:00
parent a985bcd46a
commit 876f0acda2
2 changed files with 14 additions and 2 deletions

View File

@@ -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

View File

@@ -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);