Merge remote-tracking branch 'origin/dev' into common

This commit is contained in:
2021-11-08 14:30:50 +01:00
19 changed files with 201 additions and 117 deletions

View File

@@ -55,8 +55,8 @@ public class GetAssignmentAdapter implements GetAssignmentPort {
if (response.body().equals("")) {
return null;
}
return new Task(new JSONObject(response.body()).getString("taskID"));
JSONObject responseBody = new JSONObject(response.body());
return new Task(responseBody.getString("taskID"), responseBody.getString("input"));
} catch (InterruptedException e) {
logger.log(Level.SEVERE, e.getLocalizedMessage(), e);

View File

@@ -70,7 +70,7 @@ public abstract class ExecutorBase {
logger.info("Starting execution");
this.status = ExecutorStatus.EXECUTING;
task.setResult(execution());
task.setResult(execution(task.getInput()));
// TODO implement logic if execution was not successful
executionFinishedEventPort.publishExecutionFinishedEvent(
@@ -84,6 +84,6 @@ public abstract class ExecutorBase {
* Implementation of the actual execution method of an executor
* @return the execution result
**/
protected abstract String execution();
protected abstract String execution(String... input);
}

View File

@@ -12,8 +12,12 @@ public class Task {
@Setter
private String result;
public Task(String taskID) {
@Getter
private String[] input;
public Task(String taskID, String... input) {
this.taskID = taskID;
this.input = input;
}
}