use of org.talend.core.model.process.Problem in project tdi-studio-se by Talend.
the class Problems method add.
public static void add(ProblemStatus status, IMarker marker, String javaUnitName, String markerErrorMessage, Integer lineN, String uniName, Integer charStart, Integer charEnd, ProblemType type, String version) {
Problem problem = new TalendProblem(status, javaUnitName, marker, markerErrorMessage, lineN, uniName, charStart, charEnd, type, version);
add(problem);
// addErrorMark();
}
use of org.talend.core.model.process.Problem in project tdi-studio-se by Talend.
the class ProblemsAnalyser method checkTreeNodesProblem.
private void checkTreeNodesProblem(AbstractInOutTree treeToCheck, List<? extends TreeNode> treeNodes) {
for (TreeNode treeNode : treeNodes) {
if (XmlMapUtil.DOCUMENT.equals(treeNode.getType())) {
if (!hasDocumentLoop(treeNode)) {
String message = ERROR_MESSAGE_START + treeNode.getXpath();
addProblem(treeToCheck, new Problem(null, message, ProblemStatus.ERROR));
}
if (!isMultipleDocType) {
isMultipleDocType = true;
} else {
String message = ERROR_MESSAGE_MULTIPLE_DOC_TYPE + treeNode.getXpath();
addProblem(treeToCheck, new Problem(null, message, ProblemStatus.ERROR));
}
}
}
}
use of org.talend.core.model.process.Problem in project tdi-studio-se by Talend.
the class ProblemsAnalyser method getErrorMessage.
public String getErrorMessage() {
String errorMessage = "";
final List<Problem> problems = getProblems();
if (problems.isEmpty()) {
return null;
} else {
for (Problem problem : problems) {
final String description = problem.getDescription();
if (description != null) {
errorMessage = errorMessage + description + ",";
}
}
}
return errorMessage.substring(0, errorMessage.length() - 1);
}
use of org.talend.core.model.process.Problem in project tdi-studio-se by Talend.
the class ProblemsAnalyser method checkInputLoopTablesProblem.
private void checkInputLoopTablesProblem(OutputXmlTree outputTree, InputXmlTree mainInputTree) {
if (mainInputTree == null) {
return;
}
if (mainInputTree.isMultiLoops()) {
if (!XmlMapUtil.hasDocument(outputTree)) {
if (outputTree.getInputLoopNodesTables().isEmpty() || outputTree.getInputLoopNodesTables().get(0).getInputloopnodes().isEmpty()) {
String message = outputTree.getName() + " have no source loop";
addProblem(outputTree, new Problem(null, message, ProblemStatus.ERROR));
}
} else {
List<TreeNode> loopNodes = new ArrayList<TreeNode>();
XmlMapUtil.getChildLoops(loopNodes, outputTree.getNodes());
if (!loopNodes.isEmpty()) {
for (TreeNode node : loopNodes) {
InputLoopNodesTable inutLoopTable = ((OutputTreeNode) node).getInputLoopNodesTable();
if (inutLoopTable == null || inutLoopTable.getInputloopnodes().isEmpty()) {
String message = node.getXpath() + " have no source loop";
addProblem(outputTree, new Problem(null, message, ProblemStatus.ERROR));
}
}
}
}
}
}
use of org.talend.core.model.process.Problem in project tdi-studio-se by Talend.
the class ProblemsManager method addLookupProblem.
private void addLookupProblem(IColumnEntry entity) {
List<Problem> problems = entity.getProblems();
if (problems == null) {
problems = new ArrayList<Problem>();
entity.setProblems(problems);
}
// incase other entities already have this problem in list.
boolean exist = false;
for (Problem problem : problems) {
if (problem.equals(lookupProblem)) {
exist = true;
}
}
if (!exist) {
problems.add(lookupProblem);
}
}
Aggregations