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);
}
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;
}
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);
}
}
}
}
}
}
Aggregations