Package eu.scape_project.planning.services.taverna.generator.model.processor

Examples of eu.scape_project.planning.services.taverna.generator.model.processor.NestedWorkflow


     *            map with parameters of the component
     */
    public void setMigrationComponent(WorkflowDescription workflowDescription, String workflowContent,
        Map<String, String> parameters) {
        // Dataflow
        migration = new NestedWorkflow("Migration", workflowDescription.getDataflowId());
        workflow.addProcessor(migration);

        workflowContent = convertWorkflowToNested(workflowContent);
        workflow.addDataflow(new Dataflow(workflowDescription.getDataflowId(), workflowContent));

View Full Code Here


    public void addQaComponent(final WorkflowDescription workflowDescription, final String workflowContent,
        final InputSource leftSource, final InputSource rightSource, final Map<String, String> parameters,
        final List<String> measures, RelatedObject relatedObject) {

        // Dataflow
        NestedWorkflow qa = new NestedWorkflow(createProcessorName(workflowDescription.getName()),
            workflowDescription.getDataflowId());
        workflow.addProcessor(qa);

        String dataflowContent = convertWorkflowToNested(workflowContent);
        workflow.addDataflow(new Dataflow(workflowDescription.getDataflowId(), dataflowContent));

        // Input ports
        List<Port> inputPorts = workflowDescription.getInputPorts();
        for (Port p : inputPorts) {
            if (ComponentConstants.VALUE_LEFT_OBJECT.equals(p.getValue())) {
                if (leftSource == InputSource.SOURCE_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(workflow, SOURCE_PORT_NAME, qa, p.getName()));
                } else if (leftSource == InputSource.TARGET_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(migration, migrationTargetPortName, qa, p.getName()));
                }
            } else if (ComponentConstants.VALUE_RIGHT_OBJECT.equals(p.getValue())) {
                if (rightSource == InputSource.SOURCE_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(workflow, SOURCE_PORT_NAME, qa, p.getName()));
                } else if (rightSource == InputSource.TARGET_OBJECT) {
                    qa.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(migration, migrationTargetPortName, qa, p.getName()));
                }
            } else if (ComponentConstants.VALUE_PARAMETER.equals(p.getValue())) {
                qa.addInputPort(new InputPort(p.getName(), 0));
                TextConstant c = new TextConstant(p.getName(), parameters.get(p.getName()));
                workflow.addProcessor(c);
                workflow.addDatalink(new Datalink(c, "value", qa, p.getName()));
            }
        }

        // Output ports
        List<Port> outputPorts = workflowDescription.getOutputPorts();
        for (Port p : outputPorts) {
            if (measures.contains(p.getValue())) {
                if (p.getRelatedObject() == null || p.getRelatedObject().equals(relatedObject.toString())) {
                    String measurePortName = createMeasurePortName(p.getValue());
                    if (!workflow.hasSink(measurePortName)) {
                        addMeasurePort(p.getValue());
                    }
                    qa.addOutputPort(new OutputPort(p.getName()));
                    workflow.addDatalink(new Datalink(qa, p.getName(), workflow, measurePortName));
                }
            }
        }
    }
View Full Code Here

     *            the input source of the CC component
     */
    public void addCcComponent(final WorkflowDescription workflowDescription, final String workflowContent,
        final Map<String, String> parameters, final List<String> measures, final InputSource inputSource) {
        // Dataflow
        NestedWorkflow cc = new NestedWorkflow(createProcessorName(workflowDescription.getName()),
            workflowDescription.getDataflowId());
        workflow.addProcessor(cc);

        String dataflowContent = convertWorkflowToNested(workflowContent);
        workflow.addDataflow(new Dataflow(workflowDescription.getDataflowId(), dataflowContent));

        // Input ports
        List<Port> inputPorts = workflowDescription.getInputPorts();
        for (Port p : inputPorts) {
            if (ComponentConstants.VALUE_SOURCE_OBJECT.equals(p.getValue())) {
                if (inputSource == InputSource.SOURCE_OBJECT && workflowDescription.handlesMimetype(sourceMimetype)) {
                    cc.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(workflow, SOURCE_PORT_NAME, cc, p.getName()));
                } else if (inputSource == InputSource.TARGET_OBJECT
                    && workflowDescription.handlesMimetype(targetMimetype)) {
                    cc.addInputPort(new InputPort(p.getName(), 0));
                    workflow.addDatalink(new Datalink(migration, migrationTargetPortName, cc, p.getName()));
                }
            } else if (ComponentConstants.VALUE_PARAMETER.equals(p.getValue())) {
                cc.addInputPort(new InputPort(p.getName(), 0));
                TextConstant c = new TextConstant(p.getName(), parameters.get(p.getName()));
                workflow.addProcessor(c);
                workflow.addDatalink(new Datalink(c, "value", cc, p.getName()));
            }
        }

        // Output ports
        List<Port> outputPorts = workflowDescription.getOutputPorts();
        for (Port p : outputPorts) {
            if (measures.contains(p.getValue())) {
                String measurePortName = createMeasurePortName(p.getValue());
                if (!workflow.hasSink(measurePortName)) {
                    addMeasurePort(p.getValue());
                }
                cc.addOutputPort(new OutputPort(p.getName()));
                workflow.addDatalink(new Datalink(cc, p.getName(), workflow, measurePortName));
            }
        }
    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.services.taverna.generator.model.processor.NestedWorkflow

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.