update codegenie
This commit is contained in:
@@ -104,8 +104,6 @@ public class ExternalCodeGenieSolver extends StepSolver {
|
||||
@Override
|
||||
public ScenarioExecution solveStep() throws Exception {
|
||||
|
||||
try {
|
||||
|
||||
System.out.println("Solving step: " + this.step.getName());
|
||||
|
||||
this.scenarioExecution.setCurrentStepId(this.step.getStepId());
|
||||
@@ -149,7 +147,6 @@ public class ExternalCodeGenieSolver extends StepSolver {
|
||||
jsonResponse.get("token_type").toString() + " " + jsonResponse.get("access_token").toString());
|
||||
HttpEntity<String> request = new HttpEntity<>(requestBody.toString(), headers);
|
||||
|
||||
|
||||
response = restTemplate.exchange(
|
||||
this.codegenie_base_url + "/execute",
|
||||
HttpMethod.POST,
|
||||
@@ -158,13 +155,16 @@ public class ExternalCodeGenieSolver extends StepSolver {
|
||||
|
||||
jsonResponse = new JSONObject(response.getBody());
|
||||
|
||||
/* response = restTemplate.exchange(
|
||||
//this.codegenie_base_url + "/execution_status/" + this.scenarioExecution.getId(),
|
||||
this.codegenie_base_url + "/execution_status/679752f85189eb5621b48e17",
|
||||
HttpMethod.GET,
|
||||
request,
|
||||
String.class);
|
||||
jsonResponse = new JSONObject(response.getBody());*/
|
||||
/*
|
||||
* response = restTemplate.exchange(
|
||||
* //this.codegenie_base_url + "/execution_status/" +
|
||||
* this.scenarioExecution.getId(),
|
||||
* this.codegenie_base_url + "/execution_status/679752f85189eb5621b48e17",
|
||||
* HttpMethod.GET,
|
||||
* request,
|
||||
* String.class);
|
||||
* jsonResponse = new JSONObject(response.getBody());
|
||||
*/
|
||||
|
||||
int maxTries = 500;
|
||||
// Pool the status GET api until it return the SUCCESS or FAILED message
|
||||
@@ -274,12 +274,17 @@ public class ExternalCodeGenieSolver extends StepSolver {
|
||||
this.scenarioExecution.getExecSharedMap().put("status",
|
||||
"DONE");
|
||||
} else {
|
||||
|
||||
this.scenarioExecution.getExecSharedMap().put(this.codegenie_output_variable,
|
||||
"Error while generating file");
|
||||
throw new Exception(
|
||||
"codegenie execution failed with status: " + jsonResponse.get("status").toString());
|
||||
}
|
||||
|
||||
} else {
|
||||
logger.error("ERROR on pooling codegenies");
|
||||
this.scenarioExecution.getExecSharedMap().put(this.codegenie_output_variable,
|
||||
"Error while generating file");
|
||||
|
||||
throw new Exception("codegenie execution failed with status: " + jsonResponse.get("status").toString());
|
||||
}
|
||||
@@ -309,11 +314,7 @@ public class ExternalCodeGenieSolver extends StepSolver {
|
||||
|
||||
// scenarioExecutionRepo.save(this.scenarioExecution);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in codegenie execution: " + e.getMessage(), e);
|
||||
this.scenarioExecution.getExecSharedMap().put("status",
|
||||
"ERROR");
|
||||
}
|
||||
this.scenarioExecution.setNextStepId(this.step.getNextStepId());
|
||||
|
||||
return this.scenarioExecution;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user