Search in sources :

Example 6 with Problem

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();
}
Also used : TalendProblem(org.talend.core.model.process.TalendProblem) Problem(org.talend.core.model.process.Problem) IProblem(org.eclipse.jdt.core.compiler.IProblem) TalendProblem(org.talend.core.model.process.TalendProblem)

Example 7 with Problem

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));
            }
        }
    }
}
Also used : OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode) TreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode) Problem(org.talend.core.model.process.Problem)

Example 8 with Problem

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);
}
Also used : Problem(org.talend.core.model.process.Problem)

Example 9 with Problem

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));
                    }
                }
            }
        }
    }
}
Also used : InputLoopNodesTable(org.talend.designer.xmlmap.model.emf.xmlmap.InputLoopNodesTable) OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode) TreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode) ArrayList(java.util.ArrayList) Problem(org.talend.core.model.process.Problem) OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)

Example 10 with Problem

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);
    }
}
Also used : Problem(org.talend.core.model.process.Problem)

Aggregations

Problem (org.talend.core.model.process.Problem)34 TalendProblem (org.talend.core.model.process.TalendProblem)15 ArrayList (java.util.ArrayList)10 IProblem (org.eclipse.jdt.core.compiler.IProblem)9 PersistenceException (org.talend.commons.exception.PersistenceException)4 IProcess (org.talend.core.model.process.IProcess)4 IFile (org.eclipse.core.resources.IFile)3 CoreException (org.eclipse.core.runtime.CoreException)3 SystemException (org.talend.commons.exception.SystemException)3 Item (org.talend.core.model.properties.Item)3 ITalendSynchronizer (org.talend.designer.codegen.ITalendSynchronizer)3 HashSet (java.util.HashSet)2 List (java.util.List)2 IMarker (org.eclipse.core.resources.IMarker)2 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)2 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)2 ProblemStatus (org.talend.core.model.process.Problem.ProblemStatus)2 Property (org.talend.core.model.properties.Property)2 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 IColumnEntry (org.talend.designer.abstractmap.model.tableentry.IColumnEntry)2