use of com.netflix.conductor.common.metadata.tasks.TaskResult in project orkesworkers by orkes-io.
the class MapStateCodeWorker method execute.
@Override
public TaskResult execute(Task task) {
List<Map<String, Object>> statePopulations = (List<Map<String, Object>>) task.getInputData().get("statePopulations");
statePopulations.forEach(stateData -> {
String state = (String) stateData.get("State");
stateData.put("stateCode", Constants.STATE_CODES.getOrDefault(state, "NOT_AVAILABLE"));
});
TaskResult result = new TaskResult(task);
String currentTimeOnServer = Instant.now().toString();
result.log("Mapped states to codes at " + currentTimeOnServer);
result.addOutputData("statePopulations", statePopulations);
result.setStatus(TaskResult.Status.COMPLETED);
return result;
}
use of com.netflix.conductor.common.metadata.tasks.TaskResult in project orkesworkers by orkes-io.
the class ReadNameWorker method execute.
@Override
public TaskResult execute(Task task) {
TaskResult result = new TaskResult(task);
result.setStatus(TaskResult.Status.COMPLETED);
return result;
}
use of com.netflix.conductor.common.metadata.tasks.TaskResult in project orkesworkers by orkes-io.
the class ShippingInfoWorker method execute.
@Override
public TaskResult execute(Task task) {
TaskResult result = new TaskResult(task);
result.addOutputData("shipping_service", task.getInputData().get("service"));
result.log("Shipped order reference id : " + UUID.randomUUID());
result.setStatus(TaskResult.Status.COMPLETED);
return result;
}
use of com.netflix.conductor.common.metadata.tasks.TaskResult in project orkesworkers by orkes-io.
the class Task10Worker method execute.
@Override
public TaskResult execute(Task task) {
TaskResult result = new TaskResult(task);
result.setStatus(TaskResult.Status.COMPLETED);
return result;
}
use of com.netflix.conductor.common.metadata.tasks.TaskResult in project orkesworkers by orkes-io.
the class HelloWorld method execute.
@Override
public TaskResult execute(Task task) {
TaskResult result = new TaskResult(task);
result.addOutputData("hw_response", "Hello World!");
result.setStatus(TaskResult.Status.COMPLETED);
return result;
}
Aggregations