Search in sources :

Example 16 with Connection

use of org.talend.designer.xmlmap.model.emf.xmlmap.Connection in project tdi-studio-se by Talend.

the class XmlMapConnectionBuilder method createConnection.

public void createConnection(AbstractNode sourceNode, AbstractNode targetNode, XmlMapData mapData) {
    Connection conn = XmlmapFactory.eINSTANCE.createConnection();
    conn.setSource(sourceNode);
    conn.setTarget(targetNode);
    targetNode.getIncomingConnections().add(conn);
    sourceNode.getOutgoingConnections().add(conn);
    mapData.getConnections().add(conn);
}
Also used : FilterConnection(org.talend.designer.xmlmap.model.emf.xmlmap.FilterConnection) Connection(org.talend.designer.xmlmap.model.emf.xmlmap.Connection) LookupConnection(org.talend.designer.xmlmap.model.emf.xmlmap.LookupConnection)

Example 17 with Connection

use of org.talend.designer.xmlmap.model.emf.xmlmap.Connection in project tdi-studio-se by Talend.

the class ProblemsAnalyser method checkNodeInputLookTableProblem.

private boolean checkNodeInputLookTableProblem(OutputTreeNode outputNode, InputXmlTree mainInputTree, boolean checkChildren) {
    for (Connection connection : outputNode.getIncomingConnections()) {
        if (connection.getSource() instanceof TreeNode) {
            TreeNode source = (TreeNode) connection.getSource();
            InputXmlTree abstractInOutTree = (InputXmlTree) XmlMapUtil.getAbstractInOutTree(source);
            if (abstractInOutTree == mainInputTree) {
                return true;
            } else {
                EList<LookupConnection> lookupIncomingConnections = source.getLookupIncomingConnections();
                for (LookupConnection lookupConn : lookupIncomingConnections) {
                    TreeNode sourceNode = (TreeNode) lookupConn.getSource();
                    AbstractInOutTree abstractInOutTree2 = XmlMapUtil.getAbstractInOutTree(sourceNode);
                    if (abstractInOutTree2 == mainInputTree) {
                        return true;
                    }
                }
            }
            if (checkChildren && !outputNode.getChildren().isEmpty()) {
                for (TreeNode child : outputNode.getChildren()) {
                    if (checkNodeInputLookTableProblem((OutputTreeNode) child, mainInputTree, checkChildren)) {
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
Also used : InputXmlTree(org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree) OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode) TreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode) Connection(org.talend.designer.xmlmap.model.emf.xmlmap.Connection) LookupConnection(org.talend.designer.xmlmap.model.emf.xmlmap.LookupConnection) AbstractInOutTree(org.talend.designer.xmlmap.model.emf.xmlmap.AbstractInOutTree) LookupConnection(org.talend.designer.xmlmap.model.emf.xmlmap.LookupConnection)

Example 18 with Connection

use of org.talend.designer.xmlmap.model.emf.xmlmap.Connection in project tdi-studio-se by Talend.

the class SetLoopAction method addInputLoopNodesToOutput.

private void addInputLoopNodesToOutput(TreeNode loopNode, List<Connection> connections) {
    for (Connection connection : connections) {
        if (connection.getTarget() instanceof OutputTreeNode) {
            OutputTreeNode loopParentNode = (OutputTreeNode) XmlMapUtil.getLoopParentNode((OutputTreeNode) connection.getTarget());
            if (loopParentNode != null) {
                if (loopParentNode.getInputLoopNodesTable() != null) {
                    loopParentNode.getInputLoopNodesTable().getInputloopnodes().add(loopNode);
                }
            } else {
                OutputXmlTree abstractInOutTree = (OutputXmlTree) XmlMapUtil.getAbstractInOutTree((OutputTreeNode) connection.getTarget());
                if (!XmlMapUtil.hasDocument(abstractInOutTree)) {
                    EList<InputLoopNodesTable> inputLoopNodesTables = abstractInOutTree.getInputLoopNodesTables();
                    if (inputLoopNodesTables.size() == 1) {
                        InputLoopNodesTable inputLoopNodesTable = inputLoopNodesTables.get(0);
                        inputLoopNodesTable.getInputloopnodes().add(loopNode);
                    }
                }
            }
        }
    }
}
Also used : InputLoopNodesTable(org.talend.designer.xmlmap.model.emf.xmlmap.InputLoopNodesTable) Connection(org.talend.designer.xmlmap.model.emf.xmlmap.Connection) LookupConnection(org.talend.designer.xmlmap.model.emf.xmlmap.LookupConnection) OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode) OutputXmlTree(org.talend.designer.xmlmap.model.emf.xmlmap.OutputXmlTree)

Aggregations

Connection (org.talend.designer.xmlmap.model.emf.xmlmap.Connection)18 OutputTreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)13 TreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode)12 LookupConnection (org.talend.designer.xmlmap.model.emf.xmlmap.LookupConnection)11 FilterConnection (org.talend.designer.xmlmap.model.emf.xmlmap.FilterConnection)7 OutputXmlTree (org.talend.designer.xmlmap.model.emf.xmlmap.OutputXmlTree)5 TreeNodeEditPart (org.talend.designer.xmlmap.parts.TreeNodeEditPart)5 AbstractInOutTree (org.talend.designer.xmlmap.model.emf.xmlmap.AbstractInOutTree)4 AbstractNode (org.talend.designer.xmlmap.model.emf.xmlmap.AbstractNode)4 InputXmlTree (org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree)4 VarNode (org.talend.designer.xmlmap.model.emf.xmlmap.VarNode)4 VarTable (org.talend.designer.xmlmap.model.emf.xmlmap.VarTable)4 IConnection (org.talend.designer.xmlmap.model.emf.xmlmap.IConnection)3 INodeConnection (org.talend.designer.xmlmap.model.emf.xmlmap.INodeConnection)3 ArrayList (java.util.ArrayList)2 InputLoopNodesTable (org.talend.designer.xmlmap.model.emf.xmlmap.InputLoopNodesTable)2 XmlMapData (org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData)2 OutputTreeNodeEditPart (org.talend.designer.xmlmap.parts.OutputTreeNodeEditPart)2 VarNodeEditPart (org.talend.designer.xmlmap.parts.VarNodeEditPart)2 HashMap (java.util.HashMap)1