Package eu.admire.dispel.graph

Examples of eu.admire.dispel.graph.CompositeProcessingElement


        ProcessingElementOutputDescriptor output = new ProcessingElementOutputDescriptor("output");
        output.setDType(new CollectionDType(tupleOut, CollectionDType.LIST));
        RequestNode result = converter.checkCompatibility(output, input);

        TestCase.assertTrue(result instanceof CompositeProcessingElement);
        CompositeProcessingElement composite = (CompositeProcessingElement)result;
        List<RequestNodeInput> targets = composite.getInput("input", 0).getTargets();
        TestCase.assertEquals(1, targets.size());
        ProcessingElementNode convert = (ProcessingElementNode) targets.get(0).getRequestNode();
        TestCase.assertEquals(SimpleTupleTypeConverter.TUPLE_CONVERT, convert.getName());
    }
View Full Code Here


        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>>();
        nodeC.setInputs(inputs);
        Map<String, Map<Integer, Connection>> outputs = new HashMap<String, Map<Integer, Connection>>();
        Map<Integer, Connection> map = new HashMap<Integer, Connection>();
        map.put(0, out);
        outputs.put("out2", map);
        nodeC.setOutputs(outputs);
        graph.add(nodeC);
        ProcessingElementNode nodeD = new ProcessingElementNode("uk.org.ogsadai.DeliverToRequestStatus");
        graph.add(nodeD);
        nodeD.connectInput("data", 0, out);
        String dot = DotGenerator.generate(graph);
View Full Code Here

        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>>();
        nodeC.setInputs(inputs);
        Map<String, Map<Integer, Connection>> outputs = new HashMap<String, Map<Integer, Connection>>();
        Map<Integer, Connection> map = new HashMap<Integer, Connection>();
        map.put(0, out);
        outputs.put("out2", map);
        nodeC.setOutputs(outputs);
        graph.add(nodeC);
        String dot = DotGenerator.generate(graph);
//        writeFile(dot);
        System.out.println(dot);
    }
View Full Code Here

        TestCase.assertTrue(nodes.remove(c));
        TestCase.assertTrue(!nodes.contains(b));
        TestCase.assertEquals(1, nodes.size());
        RequestNode node = nodes.get(0);
        TestCase.assertTrue(node instanceof CompositeProcessingElement);
        CompositeProcessingElement composite = (CompositeProcessingElement)node;
        TestCase.assertEquals(2, composite.getElements().size());
    }
View Full Code Here

                    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);
View Full Code Here

    {
        for (RequestNode node : nodes)
        {
            if (node instanceof CompositeProcessingElement)
            {
                CompositeProcessingElement composite =
                    (CompositeProcessingElement) node;
                List<RequestNode> subnodes = composite.getElements();
                addNodes(subnodes);
            }
            else if (node instanceof LiteralValuesNode)
            {
                // doesn't map to an activity
View Full Code Here

            Map<RequestNode, String> names,
            RequestNode node)
    {
        if (node instanceof CompositeProcessingElement)
        {
            CompositeProcessingElement element =
                (CompositeProcessingElement)node;
            for (RequestNode el : element.getElements())
            {
                connectNodes(dispel, names, el);
            }
        }
        else if (node instanceof ResultNode)
View Full Code Here

            StringBuilder dispel,
            RequestNode node)
    {
        if (node instanceof CompositeProcessingElement)
        {
            CompositeProcessingElement composite =
                (CompositeProcessingElement)node;
            for (RequestNode element : composite.getElements())
            {
                createInstances(varCounter, variables, dispel, element);
            }
        }
        else if (!(node instanceof LiteralValuesNode))
View Full Code Here

                }
                dot.append("\"];\n");
            }
            else if (requestNode instanceof CompositeProcessingElement)
            {
                CompositeProcessingElement composite =
                    (CompositeProcessingElement)requestNode;
                HashSet<Connection> compositeInputs = new HashSet<Connection>();
                HashSet<Connection> compositeOutputs = new HashSet<Connection>();
                for (Map<Integer, Connection> value : composite.getAllInputs().values())
                {
                    compositeInputs.addAll(value.values());
                }
                for (Map<Integer, Connection> value : composite.getAllOutputs().values())
                {
                    compositeOutputs.addAll(value.values());
                }
                dot.append("subgraph cluster_");
                dot.append(name);
                dot.append("\n{\n");
                dot.append("node [style=filled, fillcolor=white];\n");
                dot.append("style=filled;\n");
                dot.append("color=lightgrey;\n");
                List<RequestNode> subnodes = composite.getElements();
                dot.append(generateGraph(subnodes, compositeInputs, compositeOutputs, variables));
                dot.append("}\n");
            }
            else
            {
View Full Code Here

TOP

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

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.