use of com.netflix.conductor.common.metadata.workflow.SkipTaskRequest in project conductor by Netflix.
the class AbstractProtoMapper method fromProto.
public SkipTaskRequest fromProto(SkipTaskRequestPb.SkipTaskRequest from) {
SkipTaskRequest to = new SkipTaskRequest();
Map<String, Object> taskInputMap = new HashMap<String, Object>();
for (Map.Entry<String, Value> pair : from.getTaskInputMap().entrySet()) {
taskInputMap.put(pair.getKey(), fromProto(pair.getValue()));
}
to.setTaskInput(taskInputMap);
Map<String, Object> taskOutputMap = new HashMap<String, Object>();
for (Map.Entry<String, Value> pair : from.getTaskOutputMap().entrySet()) {
taskOutputMap.put(pair.getKey(), fromProto(pair.getValue()));
}
to.setTaskOutput(taskOutputMap);
if (from.hasTaskInputMessage()) {
to.setTaskInputMessage(fromProto(from.getTaskInputMessage()));
}
if (from.hasTaskOutputMessage()) {
to.setTaskOutputMessage(fromProto(from.getTaskOutputMessage()));
}
return to;
}
use of com.netflix.conductor.common.metadata.workflow.SkipTaskRequest in project conductor by Netflix.
the class WorkflowServiceTest method testInvalidSkipTaskFromWorkflow.
@Test(expected = ConstraintViolationException.class)
public void testInvalidSkipTaskFromWorkflow() {
try {
SkipTaskRequest skipTaskRequest = new SkipTaskRequest();
workflowService.skipTaskFromWorkflow(null, null, skipTaskRequest);
} catch (ConstraintViolationException ex) {
assertEquals(2, ex.getConstraintViolations().size());
Set<String> messages = getConstraintViolationMessages(ex.getConstraintViolations());
assertTrue(messages.contains("WorkflowId name cannot be null or empty."));
assertTrue(messages.contains("TaskReferenceName cannot be null or empty."));
throw ex;
}
}
use of com.netflix.conductor.common.metadata.workflow.SkipTaskRequest in project conductor by Netflix.
the class WorkflowServiceImpl method skipTaskFromWorkflow.
@Override
public void skipTaskFromWorkflow(WorkflowServicePb.SkipTaskRequest req, StreamObserver<WorkflowServicePb.SkipTaskResponse> response) {
try {
SkipTaskRequest skipTask = PROTO_MAPPER.fromProto(req.getRequest());
workflowService.skipTaskFromWorkflow(req.getWorkflowId(), req.getTaskReferenceName(), skipTask);
response.onNext(WorkflowServicePb.SkipTaskResponse.getDefaultInstance());
response.onCompleted();
} catch (Exception e) {
GRPC_HELPER.onError(response, e);
}
}
Aggregations