if(e.getCode().equals(Code.NOT_FOUND)) { logger.error("Workflow ID specified is not valid for this environment: " + e.getMessage()); queue.ack(Arrays.asList(msg));
public Map<String, Object> toMap(){ HashMap<String, Object> map = new LinkedHashMap<>(); map.put("code", code.name()); map.put("message", super.getMessage()); map.put("retryable", isRetryable()); return map; } }
if(e.getCode().equals(Code.NOT_FOUND)) { logger.error("Workflow ID specified is not valid for this environment: " + e.getMessage()); queue.ack(Arrays.asList(msg));
if(e.getCode().equals(Code.NOT_FOUND)) { logger.error("Workflow NOT found for id: " + workflowId, e); queueDAO.remove(WorkflowExecutor.DECIDER_QUEUE, workflowId);
public int getHttpStatusCode(){ return this.code.getStatusCode(); }
public ApplicationException(Code code, Throwable t){ super(code.name(), t); this.code = code; }
public Map<String, Object> toMap(){ HashMap<String, Object> map = new LinkedHashMap<>(); map.put("code", code.name()); map.put("message", super.getMessage()); map.put("retryable", isRetryable()); return map; } }
if(e.getCode().equals(Code.NOT_FOUND)) { logger.error("Workflow NOT found for id: " + workflowId, e); queueDAO.remove(WorkflowExecutor.DECIDER_QUEUE, workflowId);
@Override public void startWorkflow(StartWorkflowRequestPb.StartWorkflowRequest pbRequest, StreamObserver<WorkflowServicePb.StartWorkflowResponse> response) { // TODO: better handling of optional 'version' final StartWorkflowRequest request = PROTO_MAPPER.fromProto(pbRequest); try { String id = workflowService.startWorkflow(pbRequest.getName(), GRPC_HELPER.optional(request.getVersion()),request.getCorrelationId(), request.getInput(), request.getExternalInputPayloadStoragePath(), request.getTaskToDomain(), request.getWorkflowDef()); response.onNext(WorkflowServicePb.StartWorkflowResponse.newBuilder() .setWorkflowId(id) .build() ); response.onCompleted(); } catch (ApplicationException ae) { if (ae.getCode().equals(ApplicationException.Code.NOT_FOUND)) { response.onError(Status.NOT_FOUND .withDescription("No such workflow found by name="+request.getName()) .asRuntimeException() ); } else { GRPC_HELPER.onError(response, ae); } } }
public int getHttpStatusCode(){ return this.code.getStatusCode(); }
public ApplicationException(Code code, Throwable t){ super(code.name(), t); this.code = code; }