Package eu.admire.dispel.graph

Examples of eu.admire.dispel.graph.Connection


        Graph graph = new Graph();
        ProcessingElementNode nodeA = new ProcessingElementNode("uk.org.ogsadai.SQLQuery");
        graph.add(nodeA);
        ProcessingElementNode nodeB = new ProcessingElementNode("uk.org.ogsadai.DeliverToRequestStatus");
        graph.add(nodeB);
        Connection connection = new TeeConnection();
        nodeA.connectOutput("out1", 0, connection);
        nodeB.connectInput("in1", 0, connection);
        Connection connection2 = new TeeConnection();
        nodeA.connectOutput("out1", 1, connection2);
        nodeB.connectInput("in2", 0, connection2);
        String dot = DotGenerator.generate(graph);
//        writeFile(dot);
        System.out.println(dot);
View Full Code Here


        nodeA.setDescriptor(desc);
        graph.add(nodeA);
        ProcessingElementNode nodeB = new ProcessingElementNode("uk.org.ogsadai.DeliverToRequestStatus");
        nodeB.setDescriptor(desc);
        graph.add(nodeB);
        Connection connection = new TeeConnection();
        nodeA.connectOutput("out1", 0, connection);
        nodeB.connectInput("in1", 0, connection);
        Connection connection2 = new TeeConnection();
        nodeA.connectOutput("out1", 1, connection2);
        nodeB.connectInput("in2", 0, connection2);
        String dot = DotGenerator.generate(graph);
//        writeFile(dot);
        System.out.println(dot);
View Full Code Here

        graph.add(nodeA);
        ProcessingElementNode nodeB = new ProcessingElementNode("uk.org.ogsadai.TupleToWebRowSetCharArrays");
        graph.add(nodeB);
        ProcessingElementNode nodeC = new ProcessingElementNode("uk.org.ogsadai.DeliverToRequestStatus");
        graph.add(nodeC);
        Connection connection = new TeeConnection();
        nodeA.connectOutput("out1", 0, connection);
        nodeB.connectInput("in1", 0, connection);
        Connection connection2 = new TeeConnection();
        nodeB.connectOutput("data", 0, connection2);
        nodeC.connectInput("in1", 0, connection2);
        Connection connection3 = new TeeConnection();
        nodeA.connectOutput("data", 0, connection3);
        nodeC.connectInput("data", 0, connection3);
        String dot = DotGenerator.generate(graph);
//        writeFile(dot);
        System.out.println(dot);
View Full Code Here

        LiteralValuesNode nodeL = new LiteralValuesNode("VALUE");
        graph.add(nodeL);
        ProcessingElementNode nodeA = new ProcessingElementNode("uk.org.ogsadai.SQLQuery");
        nodeA.connectInput("expression", 0, nodeL.getOutput());
        ProcessingElementNode nodeB = new ProcessingElementNode("uk.org.ogsadai.TupleToWebRowSetCharArrays");
        Connection connection = new TeeConnection();
        nodeA.connectOutput("out1", 0, connection);
        nodeB.connectInput("in1", 0, connection);
        Connection out = new TeeConnection();
        nodeB.connectOutput("out2", 0, out);
        CompositeProcessingElement nodeC = new CompositeProcessingElement(
                "Composite",
                Arrays.<RequestNode>asList(nodeA, nodeB));
        Map<String, Map<Integer, Connection>> inputs = new HashMap<String, Map<Integer, Connection>>();
View Full Code Here

        LiteralValuesNode nodeL = new LiteralValuesNode("VALUE");
        graph.add(nodeL);
        ProcessingElementNode nodeA = new ProcessingElementNode("uk.org.ogsadai.SQLQuery");
        nodeA.connectInput("expression", 0, nodeL.getOutput());
        ProcessingElementNode nodeB = new ProcessingElementNode("uk.org.ogsadai.TupleToWebRowSetCharArrays");
        Connection connection = new TeeConnection();
        nodeA.connectOutput("out1", 0, connection);
        nodeB.connectInput("in1", 0, connection);
        Connection out = new TeeConnection();
        nodeB.connectOutput("out2", 0, out);
        CompositeProcessingElement nodeC = new CompositeProcessingElement(
                "Composite",
                Arrays.<RequestNode>asList(nodeA, nodeB));
        Map<String, Map<Integer, Connection>> inputs = new HashMap<String, Map<Integer, Connection>>();
View Full Code Here

            }
        }
        assertNotNull(echo);
       
        // test that the converter has been inserted correctly
        Connection echoInput = echo.getInput("input", 0);
        RequestNode converter = echoInput.getSource();
        assertNotNull(converter);
        assertEquals(SimpleTupleTypeConverter.TUPLE_CONVERT, converter.getName());
        RequestNode node = converter.getInput("expressions", 0).getSource();
        assertTrue(node instanceof LiteralValuesNode);
        List<Object> values = ((LiteralValuesNode)node).getValues();
View Full Code Here

       
        for (RequestNode node : graph.getNodes())
        {
            if (node.getName().equals("uk.org.ogsadai.SQLQuery"))
            {
                Connection output = node.getOutput("result", 0);
                assertEquals(2, output.getTargets().size());
            }
        }
    }
View Full Code Here

        {
            if (node instanceof LiteralValuesNode)
            {
                LiteralValuesNode literal = (LiteralValuesNode)node;
                List<Object> values = literal.getValues();
                Connection output = literal.getOutput();
                for (RequestNodeInput target : output.getTargets())
                {
                    RequestNode targetNode = target.getRequestNode();
                    if (targetNode instanceof ProcessingElementNode)
                    {
                        ProcessingElementNode peNode = (ProcessingElementNode)targetNode;
                        String dataSourceName = (String)peNode.getAnnotation(AnnotationKeys.DATA_SOURCE_ANCHOR);
                        if (dataSourceName != null)
                        {
                            if (peNode.getProcessingElementDescriptor().getInput(target.getName()).getIsDataSourceInput())
                            {
                                String executionEngine = (String)peNode.getAnnotation(AnnotationKeys.EXECUTION_ENGINE);
                                String localDataSource;
                                try
                                {
                                    localDataSource = mExecutionEngineRegistry.getLocalDataSourceName(executionEngine, dataSourceName);
                                }
                                catch (UnknownExecutionEngineException e)
                                {
                                    throw new RuntimeException(e);
                                }
                                values.clear();
                                values.add(localDataSource);
                            }
                        }
                    }
                    ProcessingElement activity = mPEs.get(targetNode);
                    insertLiteralValues(literal, activity, target);
                }
            }
            else if (node instanceof CompositeProcessingElement)
            {
                CompositeProcessingElement composite =
                    (CompositeProcessingElement) node;
                connectPipes(composite.getElements());
            }
            else if (node instanceof ProcessingElementNode)
            {
                ProcessingElement activity = mPEs.get(node);
                Location sourceLocation = (Location)node.getAnnotation(AnnotationKeys.LOCATION);
                for (Entry<String, Map<Integer, Connection>> output : node.getAllOutputs().entrySet())
                {
                    Map<Integer, Connection> connections = output.getValue();
                    for (Entry<Integer, Connection> entry : connections.entrySet())
                    {
                        Connection connection = entry.getValue();
                        for (RequestNodeInput consumer : connection.getTargets())
                        {
                            if (consumer.getRequestNode() instanceof ExternalOutputNode)
                            {
                                // we've already connected this output
                                continue;
View Full Code Here

                declaration.append("; ");
            }
            dispel.append("Connection ").append(entry.getKey());
            declaration.append("Connection ").append(entry.getKey());
            dispel.append(" = ");
            Connection connection = entry.getValue().get(0);
            RequestNodeInput target = connection.getTargets().get(0);
            String var = names.get(target.getRequestNode());
            dispel.append(var).append(".").append(target.getName());
            dispel.append("[").append(target.getIndex()).append("]");
            first = false;
        }
        declaration.append("> => <");
        dispel.append("> => <");       
       
        Map<String, Map<Integer, Connection>> allOutputs = composite.getAllOutputs();
        first = true;
        for (Entry<String, Map<Integer, Connection>> entry : allOutputs.entrySet())
        {
            if (!first)
            {
                dispel.append("; ");
                declaration.append("; ");
            }
            dispel.append("Connection ").append(entry.getKey());
            declaration.append("Connection ").append(entry.getKey());
            dispel.append(" = ");
            Connection connection = entry.getValue().get(0);
            String var = names.get(connection.getSource());
            dispel.append(var).append(".").append(connection.getSourceOutputName());
            dispel.append("[").append(connection.getSourceOutputIndex()).append("]");
            first = false;
        }
        dispel.append(">);\n");
        declaration.append(">) ");
        dispel.insert(length, declaration);
View Full Code Here

            Map<RequestNode, ProcessingElement> peToActivity,
            Map<Location, PipelineWorkflow> workflows)
    throws RepeatEnoughMissingControlInputException
    {
        RequestNode node = target.getRequestNode();
        Connection connection = null;
        for (Entry<String, Map<Integer, Connection>> entry: node.getAllInputs().entrySet())
        {
            for (Entry<Integer, Connection> input : entry.getValue().entrySet())
            {
                // ignore the literal output
                if (input.getValue() == literal.getOutput())
                {
                    continue;
                }
                else
                {
                    // use the first connection we come across
                    // except other infinite repeaters
                    connection = input.getValue();
                    if (connection.getSource() instanceof LiteralValuesNode)
                    {
                        LiteralValuesNode lit = (LiteralValuesNode) connection.getSource();
                        // we can't use an infinite repeater as a control
                        if (isInfiniteRepeater(lit.getValues()))
                        {
                            connection = null;
                            continue;
View Full Code Here

TOP

Related Classes of eu.admire.dispel.graph.Connection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.