Package eu.admire.dispel.graph

Examples of eu.admire.dispel.graph.CompositeProcessingElement


    }
   
    public ProcessingElementType getPE()
    {
        Graph graph = getGraph();
        CompositeProcessingElement composite =
            new CompositeProcessingElement(null, graph.getNodes());
        composite.setInputs(mInputs.getInputs());
        composite.setOutputs(mOutputs.getOutputs());
        ProcessingElementDescriptor descriptor = getDescriptor();
        composite.setDescriptor(descriptor);
        ProcessingElementType type = new ProcessingElementType(composite);
        type.setDescriptor(descriptor);
        return type;
    }
View Full Code Here


                    + " to " + targetInput.getDType());
        }
        List<RequestNode> composite = new ArrayList<RequestNode>();
        TupleDType s = (TupleDType)((CollectionDType)sourceOutput.getDType()).getType();
        TupleDType t = (TupleDType)((CollectionDType)targetInput.getDType()).getType();
        CompositeProcessingElement wrapper =
            new CompositeProcessingElement(
                    null,
                    composite);
        ProcessingElementNode project = createProject(composite, s, t);
        wrapper.setInput("input", 0, project.getInput("data", 0));
        wrapper.setOutput("output", 0, project.getOutput("result", 0));
        return wrapper;
    }
View Full Code Here

                "|- 1, 2, 3 -| => myPE.input; ");
        assertNull(mError);
        Variable var = builder.getDispelExecutionState().getVariables().get("myPE");
        Object value = var.getValue();
        assertTrue(value instanceof CompositeProcessingElement);
        CompositeProcessingElement comp = (CompositeProcessingElement)value;
        Connection input = comp.getInput("input", 0);
        assertEquals(2, input.getTargets().size());
        RequestNode node = input.getTargets().get(0).getRequestNode();
        assertEquals("a.A", node.getName());
        assertNotNull(node.getAllInputs().get("in1"));
        node = input.getTargets().get(1).getRequestNode();
View Full Code Here

            {
                if (var.getType() instanceof ProcessingElementType)
                {
                    if (var.getValue() instanceof CompositeProcessingElement)
                    {
                        CompositeProcessingElement composite =
                            (CompositeProcessingElement)var.getValue();
                        List<RequestNode> elements = composite.getElements();
                        if (graph.getNodes().removeAll(elements))
                        {
                            graph.add(composite);
                        }
                    }
View Full Code Here

//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
   
    public void testComposite()
    {
        CompositeProcessingElement c = new CompositeProcessingElement("X");
        ProcessingElementNode a = c.add("eu.admire.A");
        ProcessingElementNode b = c.add("eu.admire.B");
        a.connectOutput("out", 0, b.getInput("in", 0));
        Graph graph = new Graph();
        graph.add(c);
//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
View Full Code Here

        resultNames.add(ListMarker.BEGIN);
        resultNames.add(sourceOutput.getName());
        resultNames.add(ListMarker.END);
        project.connectInput("expressions", 0, expressions.getOutput());
        project.connectInput("resultColumnNames", 0, resultNames.getOutput());
        CompositeProcessingElement wrapper =
            new CompositeProcessingElement(
                    null,
                    composite);
        wrapper.setInput("input", 0, project.getInput("data", 0));
        wrapper.setOutput("output", 0, project.getOutput("result", 0));
        return wrapper;
    }
View Full Code Here

//        System.out.println(GraphConverter.convertToDISPEL(graph));
    }
   
    public void testRegisterComposite()
    {
        CompositeProcessingElement c = new CompositeProcessingElement("X");
        ProcessingElementNode a = c.add("eu.admire.A");
        ProcessingElementNode b = c.add("eu.admire.B");
        a.connectOutput("out", 0, b.getInput("in", 0));
        c.setInput("in0", 0, a.getInput("input0", 0));
        c.setInput("in1", 0, a.getInput("input1", 0));
        c.setOutput("out0", 0, b.getOutput("output0", 0));
//        System.out.println(GraphConverter.convertToDISPEL("MyPE", c));
    }
View Full Code Here

    {
        ProcessingElementNode a = new ProcessingElementNode("A");
        ProcessingElementNode b = new ProcessingElementNode("B");
        ProcessingElementNode c = new ProcessingElementNode("C");
        a.connectInput("in", 0, b.getOutput("out", 0));
        CompositeProcessingElement composite =
            new CompositeProcessingElement("C", Arrays.<RequestNode>asList(a, b));
        composite.setInput("in", 0, b.getInput("in", 0));
        c.connectOutput("out", 0, composite.getInput("in", 0));
        Graph graph = GraphUtilities.getConnectedComponent(composite);
        List<RequestNode> nodes = graph.getNodes();
        System.out.println(graph);
        Assert.assertEquals(2, nodes.size());
        Assert.assertTrue(nodes.contains(composite));
View Full Code Here

        }
       
        ProcessingElementType peType =
            (ProcessingElementType) registeredObject.getObject();

        CompositeProcessingElement cpe =
            (CompositeProcessingElement) peType.getImplementation();
           
        if (cpe != null)
        {
            GraphUtilities.replaceNode(node, cpe);
View Full Code Here

    @Test
    public void testConnectOutput() throws Exception
    {
        ProcessingElementNode a = new ProcessingElementNode("A");
        ProcessingElementNode b = new ProcessingElementNode("B");
        CompositeProcessingElement composite =
            new CompositeProcessingElement(
                    "Composite",
                    Arrays.<RequestNode>asList(a, b));
        composite.setOutput("out", 0, b.getOutput("out", 0));
        ProcessingElementNode c = new ProcessingElementNode("C");
        c.connectInput("in", 0, composite.getOutput("out", 0));
        System.out.println(composite);
        System.out.println(c);
    }
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.