use of alien4cloud.paas.wf.validation.UnknownRelationshipError in project alien4cloud by alien4cloud.
the class WorkflowPostProcessor method processWorkflowErrors.
private void processWorkflowErrors(Workflow wf, List<AbstractWorkflowError> errors, Node workflowNode) {
for (AbstractWorkflowError error : errors) {
if (error instanceof InlinedWorkflowNotFoundError) {
Node node = ParsingContextExecution.getObjectToNodeMap().get(((InlinedWorkflowNotFoundError) error).getInlinedWorkflow());
ParsingContextExecution.getParsingErrors().add(new ParsingError(ParsingErrorLevel.ERROR, ErrorCode.WORKFLOW_INLINED_WORKFLOW_NOT_FOUND, null, getSafeNodeStartMark(node), null, getSafeNodeEndMark(node), ((InlinedWorkflowNotFoundError) error).getInlinedWorkflow()));
} else if (error instanceof UnknownNodeError) {
Node node = ParsingContextExecution.getObjectToNodeMap().get(((UnknownNodeError) error).getNodeId());
ParsingContextExecution.getParsingErrors().add(new ParsingError(ParsingErrorLevel.ERROR, ErrorCode.UNKNWON_WORKFLOW_STEP_TARGET, null, getSafeNodeStartMark(node), "The target node referenced by the workflow step do not exist.", getSafeNodeEndMark(node), ((UnknownNodeError) error).getNodeId()));
} else if (error instanceof UnknownRelationshipError) {
Node node = ParsingContextExecution.getObjectToNodeMap().get(((UnknownRelationshipError) error).getRelationshipId());
ParsingContextExecution.getParsingErrors().add(new ParsingError(ParsingErrorLevel.ERROR, ErrorCode.UNKNWON_WORKFLOW_STEP_RELATIONSHIP_TARGET, null, getSafeNodeStartMark(node), "The target relationship referenced by the workflow step do not exist.", getSafeNodeEndMark(node), ((UnknownRelationshipError) error).getRelationshipId()));
} else if (error instanceof WorkflowHasCycleError) {
ParsingContextExecution.getParsingErrors().add(new ParsingError(ParsingErrorLevel.ERROR, ErrorCode.WORKFLOW_HAS_CYCLE, null, getSafeNodeStartMark(workflowNode), null, getSafeNodeEndMark(workflowNode), wf.getName()));
} else {
ParsingContextExecution.getParsingErrors().add(new ParsingError(ParsingErrorLevel.WARNING, ErrorCode.WORKFLOW_HAS_ERRORS, null, getSafeNodeStartMark(workflowNode), null, getSafeNodeEndMark(workflowNode), wf.getName()));
}
}
}
Aggregations