Package com.asakusafw.vocabulary.flow.graph

Examples of com.asakusafw.vocabulary.flow.graph.FlowPartDescription


    private void inlineFlowParts(FlowGraph graph) {
        assert graph != null;
        for (FlowElement element : FlowGraphUtil.collectFlowParts(graph)) {
            // first, inlines nested flow parts
            FlowPartDescription desc = (FlowPartDescription) element.getDescription();
            inlineFlowParts(desc.getFlowGraph());

            Inline inlineConfig = element.getAttribute(Inline.class);
            if (inlineConfig == null || inlineConfig == Inline.DEFAULT) {
                inlineConfig = options.isCompressFlowPart()
                        ? Inline.FORCE_AGGREGATE
View Full Code Here


        boolean valid = true;
        valid &= validateConnection(graph, elements);
        valid &= validateAcyclic(graph, elements);
        for (FlowElement element : FlowGraphUtil.collectFlowParts(graph)) {
            FlowPartDescription description = (FlowPartDescription) element.getDescription();
            valid &= validate(description.getFlowGraph());
        }

        return valid;
    }
View Full Code Here

        Object operator = invoke(factory, "create", in);

        Source<MockHoge> flowOut = output(MockHoge.class, operator, "out");
        out.add(flowOut);

        FlowPartDescription desc = (FlowPartDescription) flowOut
            .toOutputPort()
            .getOwner()
            .getDescription();

        assertThat(desc.getInputPorts().size(), is(1));
        assertThat(desc.getInputPorts().get(0).getName(), is("in"));
        assertThat(desc.getInputPorts().get(0).getDataType(), is((Object) MockHoge.class));
        assertThat(desc.getOutputPorts().size(), is(1));
        assertThat(desc.getOutputPorts().get(0).getName(), is("out"));
        assertThat(desc.getOutputPorts().get(0).getDataType(), is((Object) MockHoge.class));

        Graph<String> graph = toGraph(in);
        assertThat(graph.getConnected("in"), isJust("Simple"));
        assertThat(graph.getConnected("Simple"), isJust("out"));

        FlowGraph flow = desc.getFlowGraph();
        assertThat(flow.getDescription(), is((Object) loader.loadClass("com.example.Simple")));
        assertThat(flow.getFlowInputs().size(), is(1));
        assertThat(flow.getFlowInputs().get(0).getDescription().getName(), is("in"));
        assertThat(flow.getFlowInputs().get(0).getDescription().getDataType(), is((Object) MockHoge.class));
        assertThat(flow.getFlowOutputs().size(), is(1));
View Full Code Here

                    successors.addAll(output.getOpposites());
                }
                continue;
            }
            if (element.getDescription().getKind() == FlowElementKind.FLOW_COMPONENT) {
                FlowPartDescription desc = (FlowPartDescription) element.getDescription();
                FlowIn<?> internal = desc.getInternalInputPort(next.getDescription());
                modified |= rewriteSuccessors(source, internal);
                continue;
            }
            if (element.getDescription().getKind() == FlowElementKind.OPERATOR) {
                modified |= rewriteOperator(source, next);
View Full Code Here

        }

        private void connectSuccessors(FlowElement element) {
            assert element != null;
            if (element.getDescription().getKind() == FlowElementKind.FLOW_COMPONENT) {
                FlowPartDescription desc = (FlowPartDescription) element.getDescription();
                for (FlowElementOutput output : element.getOutputPorts()) {
                    FlowOut<?> internal = desc.getInternalOutputPort(output.getDescription());
                    Port source = toPort(internal.toInputPort());
                    for (FlowElementInput downstream : output.getOpposites()) {
                        connect(source, downstream);
                    }
                }
View Full Code Here

        private void connect(Port source, FlowElementInput downstream) {
            assert source != null;
            assert downstream != null;
            if (downstream.getOwner().getDescription().getKind() == FlowElementKind.FLOW_COMPONENT) {
                FlowPartDescription desc = (FlowPartDescription) downstream.getOwner().getDescription();
                FlowIn<?> internal = desc.getInternalInputPort(downstream.getDescription());
                Port sink = toPort(internal.toOutputPort());
                related(source, sink);
            } else {
                Port sink = toPort(downstream);
                related(source, sink);
View Full Code Here

            LOG.debug("Ignored already presented element: {}", element);
            return null;
        }
        sawElements.add(element);
        if (element.getDescription().getKind() == FlowElementKind.FLOW_COMPONENT) {
            FlowPartDescription desc = (FlowPartDescription) element.getDescription();
            Set<VisualNode> nodes = Sets.create();
            for (FlowElement inner : FlowGraphUtil.collectElements(desc.getFlowGraph())) {
                VisualNode node = convertElement(inner);
                if (node != null) {
                    nodes.add(node);
                }
            }
View Full Code Here

TOP

Related Classes of com.asakusafw.vocabulary.flow.graph.FlowPartDescription

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.