Package eu.scape_project.planning.services.taverna.executor

Examples of eu.scape_project.planning.services.taverna.executor.SSHInMemoryTempFile


            result.setSuccessful(false);
            result.setReport("The workflow " + action.getUrl() + " has not target port.");
            return result;
        }
        HashMap<String, SSHInMemoryTempFile> requestedFiles = new HashMap<String, SSHInMemoryTempFile>(1);
        SSHInMemoryTempFile tempFile = new SSHInMemoryTempFile();
        requestedFiles.put(targetPathPort, tempFile);
        tavernaExecutor.setOutputFiles(requestedFiles);

        // Execute
        try {
            tavernaExecutor.execute();
        } catch (IOException e) {
            result.setSuccessful(false);
            result.setReport("Error connecting to execution server");
            log.error("Error connecting to execution server", e);
            return result;
        } catch (TavernaExecutorException e) {
            result.setSuccessful(false);
            result.setReport("Error executing taverna workflow");
            log.error("Error executing taverna workflow", e);
            return result;
        }

        result.setSuccessful(true);
        result.setReport(tavernaExecutor.getOutputDoc());

        Map<String, ?> outputFiles = tavernaExecutor.getOutputFiles();

        DigitalObject u = new DigitalObject();
        for (Entry<String, ?> entry : outputFiles.entrySet()) {
            SSHInMemoryTempFile resultFile = (SSHInMemoryTempFile) entry.getValue();
            u.getData().setData(resultFile.getData());
            u.setFullname(action.getShortname() + " - " + digitalObject.getFullname());
        }
        FormatInfo tFormat = new FormatInfo();
        result.setTargetFormat(tFormat);
        result.setMigratedObject(u);
View Full Code Here


        tavernaExecutor.setInputData(inputData);

        // Outputs
        tavernaExecutor.setOutputPorts(null);
        HashMap<String, SSHInMemoryTempFile> requestedFiles = new HashMap<String, SSHInMemoryTempFile>(1);
        SSHInMemoryTempFile tempFile = new SSHInMemoryTempFile();
        requestedFiles.put("target", tempFile);
        tavernaExecutor.setOutputFiles(requestedFiles);

        // Execute
        try {
            tavernaExecutor.execute();
            result.setReport(tavernaExecutor.getOutputDoc());

            // Migrated file
            Map<String, ?> outputFiles = tavernaExecutor.getOutputFiles();

            DigitalObject migrated = new DigitalObject();
            for (Entry<String, ?> entry : outputFiles.entrySet()) {
                SSHInMemoryTempFile resultFile = (SSHInMemoryTempFile) entry.getValue();
                migrated.getData().setData(resultFile.getData());
                migrated.setFullname(alternative.getAction().getShortname() + " - " + digitalObject.getFullname());
            }
            result.setMigratedObject(migrated);
            result.setTargetFormat(migrated.getFormatInfo());
            result.setSuccessful(migrated.isDataExistent());
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.services.taverna.executor.SSHInMemoryTempFile

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.