Projects >> seqware >>cae34e965b939727b592e0e0a2d5c54fc366c4bf

Chunk
Conflicting content
 */
package net.sourceforge.seqware;

<<<<<<< HEAD:seqware-archetype-java-workflow/src/main/resources/archetype-resources/src/main/java/WorkflowClient.java
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import net.sourceforge.seqware.pipeline.workflowV2.AbstractWorkflowDataModel;
import net.sourceforge.seqware.pipeline.workflowV2.model.AbstractJob;
import net.sourceforge.seqware.pipeline.workflowV2.model.Job;
import net.sourceforge.seqware.pipeline.workflowV2.model.SqwFile;
import net.sourceforge.seqware.pipeline.workflowV2.model.Workflow;
=======
import net.sourceforge.seqware.pipeline.workflowV2.model.Workflow;

/**
 * 

WorkflowContext class.

* * @author yongliang * @version $Id: $Id */ public class WorkflowContext { private static WorkflowContext instance; private Workflow workflow; /** *

Getter for the field instance.

* * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.pegasus.WorkflowContext} object. */ public static WorkflowContext getInstance() { if(null== instance) { instance = new WorkflowContext(); } return instance; } >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/WorkflowContext.java public class WorkflowClient extends AbstractWorkflowDataModel {
Solution content
 */
package net.sourceforge.seqware;

<<<<<<< HEAD:seqware-archetype-java-workflow/src/main/resources/archetype-resources/src/main/java/WorkflowClient.java
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import net.sourceforge.seqware.pipeline.workflowV2.AbstractWorkflowDataModel;
import net.sourceforge.seqware.pipeline.workflowV2.model.AbstractJob;
import net.sourceforge.seqware.pipeline.workflowV2.model.Job;
import net.sourceforge.seqware.pipeline.workflowV2.model.SqwFile;
import net.sourceforge.seqware.pipeline.workflowV2.model.Workflow;
=======
import net.sourceforge.seqware.pipeline.workflowV2.model.Workflow;

/**
 * 

WorkflowContext class.

* * @author yongliang * @version $Id: $Id */ public class WorkflowContext { private static WorkflowContext instance; private Workflow workflow; /** *

Getter for the field instance.

* * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.pegasus.WorkflowContext} object. */ public static WorkflowContext getInstance() { if(null== instance) { instance = new WorkflowContext(); } return instance; } >>>>>>> develop:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/WorkflowContext.java public class WorkflowClient extends AbstractWorkflowDataModel {
File
WorkflowClient.java
Developer's decision
Manual
Kind of conflict
Attribute
Class signature
Comment
Import
Method declaration
Chunk
Conflicting content
public class WorkflowClient extends AbstractWorkflowDataModel {


<<<<<<< HEAD:seqware-archetype-java-workflow/src/main/resources/archetype-resources/src/main/java/WorkflowClient.java
	
	@Override
	public void buildWorkflow() {
		
	}

=======
	/**
	 * 

Setter for the field workflow.

* * @param wf a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Workflow} object. */ public void setWorkflow(Workflow wf) { this.workflow = wf; } /** *

Getter for the field workflow.

* * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Workflow} object. */ public Workflow getWorkflow() { return this.workflow; } >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/WorkflowContext.java }
Solution content
public class WorkflowClient extends AbstractWorkflowDataModel {


<<<<<<< HEAD:seqware-archetype-java-workflow/src/main/resources/archetype-resources/src/main/java/WorkflowClient.java
	
	@Override
	public void buildWorkflow() {
		
	}

=======
	/**
	 * 

Setter for the field workflow.

* * @param wf a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Workflow} object. */ public void setWorkflow(Workflow wf) { this.workflow = wf; } /** *

Getter for the field workflow.

* * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Workflow} object. */ public Workflow getWorkflow() { return this.workflow; } >>>>>>> develop:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/WorkflowContext.java }
File
WorkflowClient.java
Developer's decision
Manual
Kind of conflict
Annotation
Comment
Method declaration
Chunk
Conflicting content
 * 

WorkflowLauncher class.

* * @author boconnor ProviderFor(PluginInterface.class) <<<<<<< HEAD * * TODO: validate at all the option below (especially * link-parent-to-workflow-run) actually work! ======= * * TODO: validate at all the option below (especially * link-parent-to-workflow-run) actually work! * @version $Id: $Id >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 */ @ServiceProvider(service = PluginInterface.class) public class WorkflowLauncher extends WorkflowPlugin {
Solution content
/**
* @author briandoconnor@gmail.com
*
* The WorkflowLauncher is responsible for launching workflows with or without
* metadata writeback.
*
* rules for command construction cd $cwd && $command --workflow-accession
* $workflow_accession --workflow-run-accession $workflow_run_accession
* --parent-accessions $parent_accessions --ini-files $temp_file --wait &
*
*/
package net.sourceforge.seqware.pipeline.plugins;

import net.sourceforge.seqware.pipeline.plugin.PluginInterface;
import net.sourceforge.seqware.pipeline.plugin.WorkflowPlugin;

import org.openide.util.lookup.ServiceProvider;

/**
* @author boconnor ProviderFor(PluginInterface.class)
*
* TODO: validate at all the option below (especially
* link-parent-to-workflow-run) actually work!
*/
@ServiceProvider(service = PluginInterface.class)
public class WorkflowLauncher extends WorkflowPlugin {
File
WorkflowLauncher.java
Developer's decision
Manual
Kind of conflict
Comment
Chunk
Conflicting content
     * 

Constructor for WorkflowLauncher.

*/ public WorkflowLauncher() { <<<<<<< HEAD super(); } ======= super(); /* * You should specify --workflow --version and --bundle or * --workflow-accession since the latter will use the database to find * all the needed info */ parser.acceptsAll(Arrays.asList("help", "h", "?"), "Provides this help message."); parser.acceptsAll(Arrays.asList("parent-accessions", "pa"), "Optional: Typically this is the sw_accession of the processing record that is the parent for this workflow e.g. whose file is used as the input. You can actually specify multiple parent accessions by using this parameter multiple times or providing a comma-delimited list, no space. You may want multiple parents when your workflow takes multiple input files. Most of the time the accession is from a processing row but can be an ius, lane, sequencer_run, study, experiment, or sample.").withRequiredArg(); parser.acceptsAll(Arrays.asList("workflow-accession", "wa"), "Optional: The sw_accession of the workflow that this run of a workflow should be associated with (via the workflow_id in the workflow_run_table). Specify this or the workflow, version, and bundle.").withRequiredArg(); parser.acceptsAll(Arrays.asList("schedule", "s"), "Optional: If this, the workflow-accession, and ini-files are all specified this will cause the workflow to be scheduled in the workflow run table rather than directly run. Useful if submitting the workflow to a remote server."); parser.acceptsAll(Arrays.asList("launch-scheduled", "ls"), "Optional: If this parameter is given (which can optionally have a comma separated list of workflow run accessions) all the workflows that have been scheduled in the database will have their commands constructed and executed on this machine (thus launching those workflows). This command can only be run on a machine capable of submitting workflows (e.g. a cluster submission host!). If you're submitting a workflow remotely you want to use the --schedule option instead.").withOptionalArg(); parser.acceptsAll(Arrays.asList("workflow-run-accession", "wra"), "Optional: The sw_accession of an existing workflow_run that should be used. This row is pre-created when another job schedules a workflow run by partially populating a workflow_run row and setting the status to 'scheduled'. If this is not specified then a new workflow_run row will be created. Specify this in addition to a workflow-accession.").withRequiredArg(); parser.acceptsAll(Arrays.asList("workflow", "w"), "The name of the workflow to run. This must be used in conjunction with a version and bundle. Alternatively you can use a workflow-accession in place of all three for installed workflows.").withRequiredArg(); parser.acceptsAll(Arrays.asList("version", "v", "workflow-version"), "The workflow version to be used. You can specify this or the workflow-accession of an already installed bundle.").withRequiredArg(); parser.acceptsAll(Arrays.asList("bundle", "b", "provisioned-bundle-dir"), "The path to a bundle zip file. You can specify this or the workflow-accession of an already installed bundle.").withRequiredArg(); parser.acceptsAll(Arrays.asList("link-workflow-run-to-parents", "lwrp"), "Optional: The sw_accession of the sequencer_run, lane, ius, processing, study, experiment, or sample (NOTE: only currently supports ius and lane) that should be linked to the workflow_run row created by this tool. This is optional but useful since it simplifies future queries on the metadb. Can be specified multiple times if there are multiple parents or comma-delimited with no spaces (or both).").withRequiredArg(); parser.acceptsAll(Arrays.asList("ini-files", "i"), "One or more ini files can be specified, these contain the parameters needed by the workflow template. Use commas without space to delimit a list of ini files.").withRequiredArg(); parser.acceptsAll(Arrays.asList("no-meta-db", "no-metadata"), "Optional: a flag that prevents metadata writeback (which is done by default) by the WorkflowLauncher and that is subsequently passed to the called workflow which can use it to determine if they should write metadata at runtime on the cluster."); parser.acceptsAll(Arrays.asList("wait"), "Optional: a flag that indicates the launcher should launch a workflow then monitor it's progress, waiting for it to exit, and returning 0 if everything is OK, non-zero if there are errors. This is useful for testing or if something else is calling the WorkflowLauncher. Without this option the launcher will immediately return with a 0 return value regardless if the workflow ultimately works."); parser.acceptsAll(Arrays.asList("metadata", "m"), "Specify the path to the metadata.xml file.").withRequiredArg(); parser.acceptsAll(Arrays.asList("host"), "If specified, the scheduled workflow will only be launched if this parameter value and the host field in the workflow run table match. This is a mechanism to target workflows to particular servers for launching.").withRequiredArg(); ret.setExitStatus(ReturnValue.SUCCESS); } /* * (non-Javadoc) @see * net.sourceforge.seqware.pipeline.plugin.PluginInterface#init() */ /** {@inheritDoc} */ @Override public ReturnValue init() { return ret; } /* * (non-Javadoc) @see * net.sourceforge.seqware.pipeline.plugin.PluginInterface#do_test() */ /** {@inheritDoc} */ @Override public ReturnValue do_test() { // TODO Auto-generated method stub return ret; } /* * (non-Javadoc) @see * net.sourceforge.seqware.pipeline.plugin.PluginInterface#do_run() */ /** {@inheritDoc} */ @Override public ReturnValue do_run() { /* * * TODO: need to be able to pass in the workflow_run metadata!!!! * */ // setup workflow object Workflow w = new Workflow(metadata, config); // figure out what was passed as params and make structs to pass to the workflow layer // metadata boolean metadataWriteback = true; if (options.has("no-metadata") || options.has("no-meta-db")) { metadataWriteback = false; } // parent accessions ArrayList parentAccessions = new ArrayList(); if (options.has("parent-accessions")) { List opts = options.valuesOf("parent-accessions"); for (Object opt : opts) { String[] tokens = ((String) opt).split(","); for (String t : tokens) { parentAccessions.add(t); } } } //link-workflow-run-to-parents ArrayList parentsLinkedToWR = new ArrayList(); if (options.has("link-workflow-run-to-parents")) { List opts = options.valuesOf("link-workflow-run-to-parents"); for (Object opt : opts) { String[] tokens = ((String) opt).split(","); for (String t : tokens) { parentsLinkedToWR.add(t); } } } // ini-files ArrayList iniFiles = new ArrayList(); if (options.has("ini-files")) { List opts = options.valuesOf("ini-files"); for (Object opt : opts) { String[] tokens = ((String) opt).split(","); for (String t : tokens) { iniFiles.add(t); } } } // extra params, these will be passed directly to the FTL layer // so you can use this to override key/values from the ini files // very useful if you're calling the workflow from another system // and want to pass in arguments on the command line rather than ini file List nonOptions = options.nonOptionArguments(); Log.info("EXTRA OPTIONS: " + nonOptions.size()); // THE MAIN ACTION HAPPENS HERE if (options.has("workflow-accession") && options.has("ini-files")) { // then you're scheduling a workflow that has been installed if (options.has("schedule")) { Log.info("You are scheduling a workflow to run by adding it to the metadb."); ret = w.scheduleInstalledBundle((String) options.valueOf("workflow-accession"), (String) options.valueOf("workflow-run-accession"), iniFiles, metadataWriteback, parentAccessions, parentsLinkedToWR, false, nonOptions); } else { // then your running locally but taking info saved in the workflow table from the DB Log.info("You are running a workflow installed in the metadb on the local computer."); ret = w.launchInstalledBundle((String) options.valueOf("workflow-accession"), (String) options.valueOf("workflow-run-accession"), iniFiles, metadataWriteback, parentAccessions, parentsLinkedToWR, options.has("wait"), nonOptions); } } else if ((options.has("bundle") || options.has("provisioned-bundle-dir")) && options.has("workflow") && options.has("version") && options.has("ini-files")) { // then your launching direclty and not something that has been installed Log.info("FYI: You are running the workflow without metadata writeback since you are running directly from a bundle zip file or directory."); // then run the workflow specified String bundlePath = ""; if (options.has("bundle")) { bundlePath = (String) options.valueOf("bundle"); } else { bundlePath = (String) options.valueOf("provisioned-bundle-dir"); } Log.info("Bundle Path: " + bundlePath); String workflow = (String) options.valueOf("workflow"); String version = (String) options.valueOf("version"); String metadataFile = (String) options.valueOf("metadata"); // NOTE: this overrides options to process with metadata writeback since this is not supported for bundle running! ret = w.launchBundle(workflow, version, metadataFile, bundlePath, iniFiles, false, new ArrayList(), new ArrayList(), options.has("wait"), nonOptions); } else if (options.has("launch-scheduled")) { // check to see if this code is already running, if so exit try { JUnique.acquireLock(appID); } catch (AlreadyLockedException e) { Log.error("I could not get a lock for " + appID + " this most likely means the application is alredy running and this instance will exit!",e); ret.setExitStatus(ReturnValue.FAILURE); } // LEFT OFF HERE, not sure if the workflow will come back from the web service!? // then you are either launching all workflows scheduled in the DB workflow_run table or just particular ones List scheduledAccessions = (List) options.valuesOf("launch-scheduled"); // BIG ISSUE: HOW DO YOU GO FROM WORKFLOW_RUN BACK TO WORKFLOW VIA WEB SERVICE!? // then need to loop over these and just launch those workflows or launch all if accession not specified List scheduledWorkflows = this.metadata.getWorkflowRunsByStatus("submitted"); Log.stdout("Number of submitted workflows: " + scheduledWorkflows.size()); for (WorkflowRun wr : scheduledWorkflows) { Log.stdout("Working Run: " + wr.getSwAccession()); if (scheduledAccessions.isEmpty() || (scheduledAccessions.size() > 0 && scheduledAccessions.contains(wr.getSwAccession().toString()))) { if (!options.has("host") || (options.has("host") && options.valueOf("host") != null && options.valueOf("host").equals(wr.getHost()))) { WorkflowRun wrWithWorkflow = this.metadata.getWorkflowRunWithWorkflow(wr.getSwAccession().toString()); w.launchScheduledBundle(wrWithWorkflow.getWorkflow().getSwAccession().toString(), wr.getSwAccession().toString(), metadataWriteback, options.has("wait")); } } } } else { Log.error("I don't understand the combination of arguments you gave!"); Log.info(this.get_syntax()); ret.setExitStatus(ReturnValue.INVALIDARGUMENT); } return ret; } /* * (non-Javadoc) @see * net.sourceforge.seqware.pipeline.plugin.PluginInterface#clean_up() */ /** {@inheritDoc} */ @Override public ReturnValue clean_up() { // TODO Auto-generated method stub return ret; } /** *

get_description.

* * @return a {@link java.lang.String} object. */ public String get_description() { return ("A plugin that lets you launch workflow bundles once you have installed them via the BundleManager."); } >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 }
Solution content
    public WorkflowLauncher() {
    	super();
    }

}
File
WorkflowLauncher.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method declaration
Method invocation
Chunk
Conflicting content
 *
=======
 * TODO: validate at all the option below (especially
 * 

WorkflowLauncherV2 class.

* * @author yongliang ProviderFor(PluginInterface.class) <<<<<<< HEAD * * TODO: validate at all the option below (especially * link-parent-to-workflow-run) actually work! * link-parent-to-workflow-run) actually work! * @version $Id: $Id >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 */ @ServiceProvider(service = PluginInterface.class) public class WorkflowLauncherV2 extends WorkflowPlugin {
Solution content
/**
* @author briandoconnor@gmail.com
*
* The WorkflowLauncher is responsible for launching workflows with or without
* metadata writeback.
*
*/
package net.sourceforge.seqware.pipeline.plugins;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.seqware.common.model.WorkflowRun;
import net.sourceforge.seqware.common.module.ReturnValue;
import net.sourceforge.seqware.common.util.Log;
import net.sourceforge.seqware.pipeline.plugin.PluginInterface;
import net.sourceforge.seqware.pipeline.plugin.WorkflowPlugin;
import net.sourceforge.seqware.pipeline.workflowV2.AbstractWorkflowDataModel;
import net.sourceforge.seqware.pipeline.workflowV2.AbstractWorkflowEngine;
import net.sourceforge.seqware.pipeline.workflowV2.WorkflowDataModelFactory;
import net.sourceforge.seqware.pipeline.workflowV2.engine.pegasus.PegasusWorkflowEngine;
import org.openide.util.lookup.ServiceProvider;

/**
* @author yongliang ProviderFor(PluginInterface.class)
*
* TODO: validate at all the option below (especially
* link-parent-to-workflow-run) actually work!
*/
@ServiceProvider(service = PluginInterface.class)
public class WorkflowLauncherV2 extends WorkflowPlugin {
File
WorkflowLauncherV2.java
Developer's decision
Manual
Kind of conflict
Comment
Chunk
Conflicting content
        .withRequiredArg().ofType(String.class).describedAs("Path to prepend to each file location.");
    }

<<<<<<< HEAD
    public String get_description() {
    	return ("A plugin that lets you launch workflow bundles once you have installed them via the BundleManager.");
=======

    /*
     * (non-Javadoc) @see
     * net.sourceforge.seqware.pipeline.plugin.PluginInterface#init()
     */
    /** {@inheritDoc} */
    @Override
    public ReturnValue init() {
        return ret;
    }

    /*
     * (non-Javadoc) @see
     * net.sourceforge.seqware.pipeline.plugin.PluginInterface#do_test()
     */
    /** {@inheritDoc} */
    @Override
    public ReturnValue do_test() {
        // TODO Auto-generated method stub
        return ret;
>>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302
    }

  
Solution content
        .withRequiredArg().ofType(String.class).describedAs("Path to prepend to each file location.");
    }

    public String get_description() {
     return ("A plugin that lets you launch workflow bundles once you have installed them via the BundleManager.");
    }

  
File
WorkflowLauncherV2.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Comment
Method declaration
Method signature
Return statement
Chunk
Conflicting content
    /** {@inheritDoc} */
    @Override
    public ReturnValue do_run() {
<<<<<<< HEAD
    	// set up workflow engine
    	AbstractWorkflowEngine engine = new PegasusWorkflowEngine();
    	WorkflowDataModelFactory factory = new WorkflowDataModelFactory(options, config, params, metadata);
    	AbstractWorkflowDataModel dataModel = factory.getWorkflowDataModel();
    	
    	ReturnValue retPegasus = engine.launchWorkflow(dataModel);
    	if(!Boolean.parseBoolean(dataModel.getConfigs().get("metadata"))) {
    		return retPegasus;
    	}
    	// metadataWriteback
    	String wra = dataModel.getConfigs().get("workflow-run-accession");
    	
    	if(wra==null || wra.isEmpty()) {
    		return retPegasus;
    	}
    	int workflowrunaccession = Integer.parseInt(wra);
    	int workflowrun = this.metadata.get_workflow_run_id(workflowrunaccession);
    	
    	// figure out the status command
    	String stdOut = retPegasus.getStdout();
    	Pattern p = Pattern.compile("(pegasus-status -l \\S+)");
    	Matcher m = p.matcher(stdOut);
    	String statusCmd = null;
    	if (m.find()) {
    	    statusCmd = m.group(1);
    	}

    	// look for the status directory
    	p = Pattern.compile("pegasus-status -l (\\S+)");
    	m = p.matcher(stdOut);
    	String statusDir = null;
    	if (m.find()) {
    	    statusDir = m.group(1);
    	}

    	List parentsLinkedToWR = new ArrayList();

		WorkflowRun wr = null;
		

		// need to figure out workflow_run_accession
		// need to link all the parents to this workflow run accession
		for (String parentLinkedToWR : parentsLinkedToWR) {
			try {
				this.metadata.linkWorkflowRunAndParent(workflowrun,
					Integer.parseInt(parentLinkedToWR));
			} catch (Exception e) {
				Log.error(e.getMessage());
			}
		}

	    	// need to pull back the workflow run object since some fields may
	    	// already be set
	    	// and we need to use their values before writing back to the DB!
	    wr = metadata.getWorkflowRun(workflowrunaccession);
		
    	if (retPegasus.getProcessExitStatus() != ReturnValue.SUCCESS
    			|| statusCmd == null) {
    		    // then something went wrong trying to call pegasus  		    
	    		metadata.update_workflow_run(workflowrun,  dataModel.getTags().get("workflow_command"), 
	    				dataModel.getTags().get("workflow_template"), "failed", statusCmd,
	    				dataModel.getWorkflowBundleDir(), "",
	    				"", wr.getHost(), 0, 0,
	    				retPegasus.getStderr(), retPegasus.getStdout());
    		    
    		    return (retPegasus);
    	} else {
    		metadata.update_workflow_run(workflowrun, dataModel.getTags().get("workflow_command"),
    				dataModel.getTags().get("workflow_template"), "completed",
    			    statusCmd, dataModel.getWorkflowBundleDir(), "","", wr
    				    .getHost(), Integer.parseInt(retPegasus
    				    .getAttribute("currStep")), Integer
    				    .parseInt(retPegasus
    					    .getAttribute("totalSteps")),
    			    retPegasus.getStderr(), retPegasus.getStdout());
    		return ret;
    	}
    	
=======

        /*
         *
         * TODO: need to be able to pass in the workflow_run metadata!!!!
         *
         */

        // setup workflow object
        PegasusWorkflowEngine w = new PegasusWorkflowEngine(metadata, config);

        // figure out what was passed as params and make structs to pass to the workflow layer
        // metadata
        boolean metadataWriteback = true;
        if (options.has("no-metadata") || options.has("no-meta-db")) {
            metadataWriteback = false;
        }

        // parent accessions
        ArrayList parentAccessions = new ArrayList();
        if (options.has("parent-accessions")) {
            List opts = options.valuesOf("parent-accessions");
            for (Object opt : opts) {
                String[] tokens = ((String) opt).split(",");
                for (String t : tokens) {
                    parentAccessions.add(t);
                }
            }
        }

        //link-workflow-run-to-parents
        ArrayList parentsLinkedToWR = new ArrayList();
        if (options.has("link-workflow-run-to-parents")) {
            List opts = options.valuesOf("link-workflow-run-to-parents");
            for (Object opt : opts) {
                String[] tokens = ((String) opt).split(",");
                for (String t : tokens) {
                    parentsLinkedToWR.add(t);
                }
            }
        }

        // ini-files
        ArrayList iniFiles = new ArrayList();
        if (options.has("ini-files")) {
            List opts = options.valuesOf("ini-files");
            for (Object opt : opts) {
                String[] tokens = ((String) opt).split(",");
                for (String t : tokens) {
                    iniFiles.add(t);
                }
            }
        }

        // extra params, these will be passed directly to the FTL layer
        // so you can use this to override key/values from the ini files
        // very useful if you're calling the workflow from another system
        // and want to pass in arguments on the command line rather than ini file
        List nonOptions = options.nonOptionArguments();
        Log.info("EXTRA OPTIONS: " + nonOptions.size());

        if (options.has("workflow-accession") && options.has("ini-files")) {

          if (options.has("schedule")) {
            Log.info("You are scheduling a workflow to run by adding it to the metadb.");
            ret = w.scheduleInstalledBundle((String) options.valueOf("workflow-accession"), (String) options.valueOf("workflow-run-accession"), iniFiles, metadataWriteback, parentAccessions, parentsLinkedToWR, false, nonOptions);
          } else {
            Log.info("You are running a workflow installed in the metadb on the local computer.");
            ret = w.launchInstalledBundle((String) options.valueOf("workflow-accession"), (String) options.valueOf("workflow-run-accession"), iniFiles, metadataWriteback, parentAccessions, parentsLinkedToWR, options.has("wait"), nonOptions);
          }
            
        } else if ((options.has("bundle") || options.has("provisioned-bundle-dir"))
                && options.has("workflow") && options.has("version") && options.has("ini-files")) {

            Log.info("FYI: You are running the workflow without metadata writeback since you are running directly from a bundle zip file or directory.");
            // then run the workflow specified
            String bundlePath = "";
            if (options.has("bundle")) {
                bundlePath = (String) options.valueOf("bundle");
            } else {
                bundlePath = (String) options.valueOf("provisioned-bundle-dir");
            }
            Log.info("Bundle Path: " + bundlePath);
	    //load clas
            String workflow = (String) options.valueOf("workflow");
            String version = (String) options.valueOf("version");
            String metadataFile = (String) options.valueOf("metadata");

            // NOTE: this overrides options to process with metadata writeback since this is not supported for bundle running!
            ret = w.launchBundle(workflow, version, metadataFile, bundlePath, iniFiles, false, new ArrayList(), new ArrayList(), options.has("wait"), nonOptions);

        } else {
            Log.error("I don't understand the combination of arguments you gave!");
            Log.info(this.get_syntax());
            ret.setExitStatus(ReturnValue.INVALIDARGUMENT);
        }

        return ret;
    }

    /*
     * (non-Javadoc) @see
     * net.sourceforge.seqware.pipeline.plugin.PluginInterface#clean_up()
     */
    /** {@inheritDoc} */
    @Override
    public ReturnValue clean_up() {
        // TODO Auto-generated method stub
        return ret;
    }

    /**
     * 

get_description.

* * @return a {@link java.lang.String} object. */ public String get_description() { return ("A plugin that lets you launch workflow bundles once you have installed them via the BundleManager."); >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 }
Solution content
    @Override
    public ReturnValue do_run() {
     // set up workflow engine
     AbstractWorkflowEngine engine = new PegasusWorkflowEngine();
     WorkflowDataModelFactory factory = new WorkflowDataModelFactory(options, config, params, metadata);
     AbstractWorkflowDataModel dataModel = factory.getWorkflowDataModel();
    
     ReturnValue retPegasus = engine.launchWorkflow(dataModel);
     if(!Boolean.parseBoolean(dataModel.getConfigs().get("metadata"))) {
     return retPegasus;
     }
     // metadataWriteback
     String wra = dataModel.getConfigs().get("workflow-run-accession");
    
     if(wra==null || wra.isEmpty()) {
     return retPegasus;
     }
     int workflowrunaccession = Integer.parseInt(wra);
     int workflowrun = this.metadata.get_workflow_run_id(workflowrunaccession);
    
     // figure out the status command
     String stdOut = retPegasus.getStdout();
     Pattern p = Pattern.compile("(pegasus-status -l \\S+)");
     Matcher m = p.matcher(stdOut);
     String statusCmd = null;
     if (m.find()) {
     statusCmd = m.group(1);
     }

     // look for the status directory
     p = Pattern.compile("pegasus-status -l (\\S+)");
     m = p.matcher(stdOut);
     String statusDir = null;
     if (m.find()) {
     statusDir = m.group(1);
     }

     List parentsLinkedToWR = new ArrayList();

	WorkflowRun wr = null;
	
	
	// need to figure out workflow_run_accession
	// need to link all the parents to this workflow run accession
	for (String parentLinkedToWR : parentsLinkedToWR) {
		try {
			this.metadata.linkWorkflowRunAndParent(workflowrun,
			Integer.parseInt(parentLinkedToWR));
		} catch (Exception e) {
			Log.error(e.getMessage());
		}
	}
	
	// need to pull back the workflow run object since some fields may
	// already be set
	// and we need to use their values before writing back to the DB!
	wr = metadata.getWorkflowRun(workflowrunaccession);

     if (retPegasus.getProcessExitStatus() != ReturnValue.SUCCESS
    		 || statusCmd == null) {
     // then something went wrong trying to call pegasus
		metadata.update_workflow_run(workflowrun, dataModel.getTags().get("workflow_command"),
			dataModel.getTags().get("workflow_template"), "failed", statusCmd,
			dataModel.getWorkflowBundleDir(), "",
			"", wr.getHost(), 0, 0,
			retPegasus.getStderr(), retPegasus.getStdout());
    
		return (retPegasus);
     } else {
	     metadata.update_workflow_run(workflowrun, dataModel.getTags().get("workflow_command"),
		     dataModel.getTags().get("workflow_template"), "completed",
		     statusCmd, dataModel.getWorkflowBundleDir(), "","", wr
		     .getHost(), Integer.parseInt(retPegasus
		     .getAttribute("currStep")), Integer
		     .parseInt(retPegasus
		     .getAttribute("totalSteps")),
		     retPegasus.getStderr(), retPegasus.getStdout());
	     return ret;
     }
    
    }
    
    
File
WorkflowLauncherV2.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Comment
For statement
If statement
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
import net.sourceforge.seqware.pipeline.bundle.BundleInfo;
import net.sourceforge.seqware.pipeline.daxgenerator.Daxgenerator;

<<<<<<< HEAD
public abstract class BasicWorkflow  {
=======
/**
 * 

Abstract BasicWorkflow class.

* * @author boconnor * @version $Id: $Id */ public abstract class BasicWorkflow implements WorkflowEngine { >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 protected ReturnValue ret = new ReturnValue(); protected Metadata metadata = null;
Solution content
import net.sourceforge.seqware.pipeline.bundle.BundleInfo;
import net.sourceforge.seqware.pipeline.daxgenerator.Daxgenerator;
import net.sourceforge.seqware.pipeline.workflowV2.WorkflowEngine;


/**
 * 

Abstract BasicWorkflow class.

* * @author boconnor * @version $Id: $Id */ public abstract class BasicWorkflow implements WorkflowEngine { protected ReturnValue ret = new ReturnValue(); protected Metadata metadata = null;
File
BasicWorkflow.java
Developer's decision
Manual
Kind of conflict
Class signature
Comment
Chunk
Conflicting content
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;

<<<<<<< HEAD
=======



/**
 * 

WorkflowClassFinder class.

* * @author boconnor * @version $Id: $Id */ >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 public class WorkflowClassFinder {
Solution content
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;




/**
 * 

WorkflowClassFinder class.

* * @author boconnor * @version $Id: $Id */ public class WorkflowClassFinder {
File
WorkflowClassFinder.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
	}

	/**
<<<<<<< HEAD
	 * find the first .class in the clazzPath
	 * @param clazzPath
	 * @return
	 */
	public Class findFirstWorkflowClass(String clazzPath) {
=======
	 * 

findFirstWorkflowClass.

* * @param clazzPath a {@link java.lang.String} object. * @return a {@link java.lang.Class} object. */ public Class findFirstWorkflowClass(String clazzPath) { >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 String candidateClassesLocationPattern = "file:" + clazzPath + "**" + FOLDERS_SEPARATOR_AS_STRING + "*.class"; Resource[] resources = null;
Solution content
	}

	/**
	 * find the first .class in the clazzPath
	 * @param clazzPath
	 * @return
	 */
	public Class findFirstWorkflowClass(String clazzPath) {

		String candidateClassesLocationPattern = "file:" + 
			clazzPath + "**" + FOLDERS_SEPARATOR_AS_STRING + "*.class";
		Resource[] resources = null;
File
WorkflowClassFinder.java
Developer's decision
Version 1
Kind of conflict
Comment
Method signature
Chunk
Conflicting content
  private static Pattern pattern = Pattern.compile(REGEX);

  /**
<<<<<<< HEAD:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/engine/pegasus/StringUtils.java
   * resolve all the FTL variables ${variable} in the string with the variables in maps
   * @param source
   * @param maps
   * @return
=======
   * 

replace.

* * @param source a {@link java.lang.String} object. * @param rep a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public static String replace(String source, String rep) { Matcher m = pattern.matcher(source); StringBuffer sb = new StringBuffer(); while (m.find()) { m.appendReplacement(sb, rep); } m.appendTail(sb); return sb.toString(); } /** *

replace.

* * @param source a {@link java.lang.String} object. * @param maps a {@link java.util.Map} object. * @return a {@link java.lang.String} object. >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/StringUtils.java */ public static String replace(String source, Map maps) { Matcher m = pattern.matcher(source);
Solution content
  private static Pattern pattern = Pattern.compile(REGEX);

  /**
   * resolve all the FTL variables ${variable} in the string with the variables in maps
   * @param source
   * @param maps
   * @return
   * 

replace.

* * @param source a {@link java.lang.String} object. * @param rep a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public static String replace(String source, String rep) { Matcher m = pattern.matcher(source); StringBuffer sb = new StringBuffer(); while (m.find()) { m.appendReplacement(sb, rep); } m.appendTail(sb); return sb.toString(); } /** *

replace.

* * @param source a {@link java.lang.String} object. * @param maps a {@link java.util.Map} object. * @return a {@link java.lang.String} object. */ public static String replace(String source, Map maps) { Matcher m = pattern.matcher(source);
File
StringUtils.java
Developer's decision
Concatenation
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
    return sb.toString();
  }

<<<<<<< HEAD:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/engine/pegasus/StringUtils.java
  /**
   * check if a string has FTL style variables ${variable}
   * @param input
   * @return
=======
  /**
   * 

hasVariable.

* * @param input a {@link java.lang.String} object. * @return a boolean. */ public static boolean hasVariable(String input) { Matcher m = pattern.matcher(input); return m.find(); } /** * split on the space+ only if that space has zero, or an even number of * quotes in ahead of it. for example: input = * "abc ccc -- \"ac bb dd\" ttt \"a c d\" b"; will produce * [abc,ccc,--,"ac bb dd", ttt, "a c d",b] * * @param input a {@link java.lang.String} object. * @return an array of {@link java.lang.String} objects. >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/StringUtils.java */ public static boolean hasVariable(String input) { Matcher m = pattern.matcher(input);
Solution content
    return sb.toString();
  }

  /**
   * check if a string has FTL style variables ${variable}
   * @param input
   * @return

   * 

hasVariable.

* * @param input a {@link java.lang.String} object. * @return a boolean. */ public static boolean hasVariable(String input) { Matcher m = pattern.matcher(input); return m.find(); } }
File
StringUtils.java
Developer's decision
Manual
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
import org.jdom.Element;

<<<<<<< HEAD:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/engine/pegasus/object/Pfn.java
public class Pfn  {
=======
/**
 * 

Pfn class.

* * @author boconnor * @version $Id: $Id */ public class Pfn extends PegasusAbstract { >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/object/Pfn.java private String url; private String site;
Solution content
import org.jdom.Element;

public class Pfn  {

  private String url;
  private String site;
File
Pfn.java
Developer's decision
Version 1
Kind of conflict
Class signature
Comment
Chunk
Conflicting content
  private String url;
  private String site;

<<<<<<< HEAD:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/engine/pegasus/object/Pfn.java

=======
  /** {@inheritDoc} */
  @Override
>>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/object/Pfn.java
  public Element serializeXML() {
    Element element = new Element("pfn", Adag.NAMESPACE);
    element.setAttribute("url", this.url);
Solution content
  private String url;
  private String site;


  /** {@inheritDoc} */
  public Element serializeXML() {
    Element element = new Element("pfn", Adag.NAMESPACE);
    element.setAttribute("url", this.url);
File
Pfn.java
Developer's decision
Combination
Kind of conflict
Annotation
Comment
Chunk
Conflicting content
    this.installed = installed;
  }

<<<<<<< HEAD:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/engine/pegasus/object/WorkflowExecutable.java

=======
  /** {@inheritDoc} */
  @Override
>>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302:seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/workflowV2/pegasus/object/WorkflowExecutable.java
  public Element serializeXML() {
    Element element = new Element("executable", Adag.NAMESPACE);
    element.setAttribute("namespace", this.namespace);
Solution content
    this.installed = installed;
  }


  public Element serializeXML() {
    Element element = new Element("executable", Adag.NAMESPACE);
    element.setAttribute("namespace", this.namespace);
File
WorkflowExecutable.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Chunk
Conflicting content
package net.sourceforge.seqware.pipeline.workflowV2.model;

<<<<<<< HEAD
public class JavaJob extends AbstractJob {
=======
/**
 * 

JavaJob class.

* * @author yongliang * @version $Id: $Id */ public class JavaJob extends Job { /** *

Constructor for JavaJob.

* * @param algo a {@link java.lang.String} object. */ public JavaJob(String algo) { super(algo); this.name = "java"; this.version = "1.6.0"; } >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 public JavaJob(String algo, String cp, String mainclass) { super(algo, cp, mainclass);
Solution content
package net.sourceforge.seqware.pipeline.workflowV2.model;


public class JavaJob extends AbstractJob {

	public JavaJob(String algo, String cp, String mainclass) {
		super(algo, cp, mainclass);
File
JavaJob.java
Developer's decision
Version 1
Kind of conflict
Class signature
Comment
Method declaration
Chunk
Conflicting content
	return id;
package net.sourceforge.seqware.pipeline.workflowV2.model;

import java.util.Collection;
<<<<<<< HEAD
=======
import java.util.List;

import net.sourceforge.seqware.common.util.Log;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 * 

Job class.

* * @author boconnor * @version $Id: $Id */ public class Job { private String id; private JobModule module; private Collection parents; protected String name; protected String version; // non default profiles private Collection profiles; private List jobArgs; private WorkflowExecutable executable; private String algo; private boolean hasProcessingFile; private String inputFile; private String outputDir; private String command; private String queue; private boolean hasCommandIO = false; private String preJobDir; private boolean metadataOverridable = false; private List moduleArgs; // default 1 private int threadCount = 1; // default 5000 private int maxMem = 5000; /** *

Constructor for Job.

*/ public Job() { this(""); } /** *

Constructor for Job.

* * @param algo a {@link java.lang.String} object. */ public Job(String algo) { this.algo = algo; this.name = "bash"; this.version = ""; this.parents = new ArrayList(); this.moduleArgs = new ArrayList(); this.profiles = new ArrayList(); } /** *

Getter for the field id.

* * @return a {@link java.lang.String} object. */ public String getId() { } /** *

Setter for the field id.

* * @param id a {@link java.lang.String} object. */ public void setId(String id) { this.id = id; } /** * if executable is not null && executable is not CUSTOM * * @return executable.getName(); */ public String getName() { return this.name; } // not sure what the version number for bash /** *

Getter for the field version.

* * @return a {@link java.lang.String} object. */ public String getVersion() { return this.version; } /** *

getJobModule.

* * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.JobModule} object. */ public JobModule getJobModule() { return module; } /** *

Getter for the field parents.

* * @return a {@link java.util.Collection} object. */ public Collection getParents() { return this.parents; } /** *

addParent.

* * @param parent a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Job} object. */ public void addParent(Job parent) { Log.debug("adding parent " + parent); if (parent != null && !this.parents.contains(parent)) { Log.debug("add parent " + parent); this.parents.add(parent); } } /** *

addJobArgument.

* * @param key a {@link java.lang.String} object. * @param value a {@link java.lang.String} object. */ public void addJobArgument(String key, String value) { Argument arg = new Argument(key, value); if (!this.jobArgs.contains(arg)) { this.jobArgs.add(arg); } } /** *

addModuleArgument.

* * @param key a {@link java.lang.String} object. */ public void addModuleArgument(String key) { Argument arg = new Argument(key, null); this.moduleArgs.add(arg); } /** *

addModuleArgument.

* * @param key a {@link java.lang.String} object. * @param value a {@link java.lang.String} object. */ public void addModuleArgument(String key, String value) { Argument arg = new Argument(key, value); this.moduleArgs.add(arg); } /** *

getModuleArguments.

* * @return a {@link java.util.Collection} object. */ public Collection getModuleArguments() { return this.moduleArgs; } /** *

getJobArgument.

* * @return a {@link java.util.Collection} object. */ public Collection getJobArgument() { return this.jobArgs; } /** *

addProfile.

* * @param pf a {@link net.sourceforge.seqware.pipeline.workflowV2.model.JobProfile} object. */ public void addProfile(JobProfile pf) { this.profiles.add(pf); } /** *

Getter for the field profiles.

* * @return a {@link java.util.Collection} object. */ public Collection getProfiles() { return this.profiles; } /** *

setAlgorithm.

* * @param algo a {@link java.lang.String} object. */ public void setAlgorithm(String algo) { this.algo = algo; } /** *

getAlgorithm.

* * @return a {@link java.lang.String} object. */ public String getAlgorithm() { return this.algo; } /** *

Setter for the field hasProcessingFile.

* * @param b a boolean. */ public void setHasProcessingFile(boolean b) { this.hasProcessingFile = b; } /** *

hasProcessingFile.

* * @return a boolean. */ public boolean hasProcessingFile() { return this.hasProcessingFile; } /** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (obj instanceof Job == false) return false; if (obj == this) return true; Job rhs = (Job) obj; return new EqualsBuilder().append(id, rhs.id).isEquals(); } /** {@inheritDoc} */ @Override public int hashCode() { return new HashCodeBuilder(17, 37).append(id).toHashCode(); } /** *

Setter for the field inputFile.

* * @param input a {@link java.lang.String} object. */ public void setInputFile(String input) { this.inputFile = input; } /** *

Getter for the field inputFile.

* * @return a {@link java.lang.String} object. */ public String getInputFile() { return this.inputFile; } /** *

Setter for the field outputDir.

* * @param output a {@link java.lang.String} object. */ public void setOutputDir(String output) { this.outputDir = output; } /** *

Getter for the field outputDir.

* * @return a {@link java.lang.String} object. */ public String getOutputDir() { return this.outputDir; } /** *

Setter for the field threadCount.

* * @param count a {@link java.lang.String} object. */ public void setThreadCount(String count) { this.threadCount = Integer.parseInt(count); } /** *

Getter for the field threadCount.

* * @return a int. */ public int getThreadCount() { return this.threadCount; } /** *

Setter for the field command.

* * @param command a {@link java.lang.String} object. */ public void setCommand(String command) { this.setCommand(command, false); } /** *

Setter for the field command.

* * @param command a {@link java.lang.String} object. * @param autoIO a boolean. */ public void setCommand(String command, boolean autoIO) { this.command = command; this.hasCommandIO = autoIO; } /** *

Getter for the field command.

* * @return a {@link java.lang.String} object. */ public String getCommand() { return this.command; } /** *

getMaxMemory.

* * @return a int. */ public int getMaxMemory() { return this.maxMem; } /** *

setMaxMemory.

* * @param mem a {@link java.lang.String} object. */ public void setMaxMemory(String mem) { this.maxMem = Integer.parseInt(mem); } /** *

Setter for the field queue.

* * @param queue a {@link java.lang.String} object. */ public void setQueue(String queue) { this.queue = queue; } /** *

Getter for the field queue.

* * @return a {@link java.lang.String} object. */ public String getQueue() { return this.queue; } /** *

checkCommandIO.

* * @return a boolean. */ public boolean checkCommandIO() { return this.hasCommandIO; } /** *

createPreJobDirtory.

* * @param dir a {@link java.lang.String} object. */ public void createPreJobDirtory(String dir) { this.preJobDir = dir; } /** *

getPreJobDirectory.

* * @return a {@link java.lang.String} object. */ public String getPreJobDirectory() { return this.preJobDir; } /** *

isMetadataOverridden.

* * @return a boolean. */ public boolean isMetadataOverridden() { return metadataOverridable; } /** *

setMetadataOverridden.

* * @param metadata a boolean. */ public void setMetadataOverridden(boolean metadata) { this.metadataOverridable = metadata; } >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 public interface Job { /**
Solution content
package net.sourceforge.seqware.pipeline.workflowV2.model;

import java.util.Collection;



public interface Job {
	/**
File
Job.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Class signature
Comment
Import
Method declaration
Chunk
Conflicting content
import java.util.List;


<<<<<<< HEAD
=======
/**
 * 

Workflow class.

* * @author yongliang * @version $Id: $Id */ @XmlRootElement >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 public class Workflow { private String workflowBundleDir;
Solution content
import java.util.List;


public class Workflow {

	private String workflowBundleDir;
File
Workflow.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Chunk
Conflicting content
	private List jobs;
	

<<<<<<< HEAD
	public Workflow() {
		this.jobs = new ArrayList();
		this.tests = new ArrayList();
	}
	
	/**
	 * get all jobs in current workflow
	 * @return
	 */
	public List getJobs() {
		return jobs;
	}

	/**
	 * add job to the workflow
	 * @param job
	 */
	public void addJobs(AbstractJob job) {
		this.jobs.add(job);
	}
	
	/**
	 * 
	 * @return the workflowbundle diretory
	 */
	public String getWorkflowBundleDir() {
		return workflowBundleDir;
	}
	/**
	 * set the workflowBundle directory
	 * @param workflowBundleDir
	 */
	public void setWorkflowBundleDir(String workflowBundleDir) {
		this.workflowBundleDir = workflowBundleDir;
	}
	
	public Job createJavaSeqwareModuleJob(String algo, String cp, String module) {
		AbstractJob job = new JavaSeqwareModuleJob(algo, cp, module);
		this.jobs.add(job);
		return job;
	}
	
	public Job createJavaJob(String algo, String cp, String mainclass) {
		AbstractJob job = new JavaJob(algo,cp,mainclass);
		this.jobs.add(job);
		return job;
	}
	
	public Job createBashJob(String algo) {
		AbstractJob job = new BashJob(algo);
		this.jobs.add(job);
		return job;
	}
	
	public Job createPerlJob(String algo, String script) {
		AbstractJob job = new PerlJob(algo, "", script);
		this.jobs.add(job);
		return job;
	}

	/**
	 * add a test command for the workflow
	 * @param value
	 */
	public void addTest(String value) {
		this.tests.add(value);
	}
	
	/**
	 * @return all test commands
	 */
	public Collection getTests() {
		return this.tests;
=======
    /**
     * 

Constructor for Workflow.

*/ public Workflow() { this.jobs = new LinkedHashMap(); } /** *

Constructor for Workflow.

* * @param properties a {@link java.util.Map} object. */ public Workflow(Map properties) { this.properties = properties; this.jobs = new LinkedHashMap(); } /** *

Setter for the field name.

* * @param name a {@link java.lang.String} object. */ public void setName(String name) { this.name = name; } /** *

Getter for the field name.

* * @return a {@link java.lang.String} object. */ @XmlAttribute public String getName() { return this.name; } /** *

Setter for the field version.

* * @param version a {@link java.lang.String} object. */ public void setVersion(String version) { this.version = version; } /** *

Getter for the field version.

* * @return a {@link java.lang.String} object. */ @XmlAttribute public String getVersion() { return this.version; } /** *

Getter for the field jobs.

* * @return a {@link java.util.Collection} object. */ @XmlElementWrapper(name = "Jobs") @XmlElement(name = "Job") public Collection getJobs() { return this.jobs.values(); } /** *

Setter for the field jobs.

* * @param jobs a {@link java.util.Collection} object. */ public void setJobs(Collection jobs) { for (Job job : jobs) { this.jobs.put(job.getName(), job); } } /** *

addJob.

* * @param job a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Job} object. */ public void addJob(Job job) { int count = this.jobs.size(); job.setId("" + count); this.jobs.put(job.getId(), job); } /** *

getJobById.

* * @param id a {@link java.lang.String} object. * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Job} object. */ public Job getJobById(String id) { return this.jobs.get(id); } /** *

Setter for the field finalDestination.

* * @param input a {@link java.lang.String} object. */ public void setFinalDestination(String input) { this.finalDestination = input; } /** *

Getter for the field finalDestination.

* * @return a {@link java.lang.String} object. */ public String getFinalDestination() { return this.finalDestination; } /** *

getProperty.

* * @param key a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public String getProperty(String key) { return this.properties.get(key); } /** *

getBundleDir.

* * @return a {@link java.lang.String} object. */ public String getBundleDir() { return this.properties.get("workflow_bundle_dir") + System.getProperty("file.separator") + "Workflow_Bundle_" + this.properties.get("workflow_name") + System.getProperty("file.separator") + this.properties.get("workflow_version"); } /** *

Getter for the field properties.

* * @return a {@link java.util.Map} object. */ public Map getProperties() { return this.properties; } /** *

createJavaJob.

* * @param algo a {@link java.lang.String} object. * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Job} object. */ public Job createJavaJob(String algo) { Job job = new JavaJob(algo); this.addJob(job); return job; } /** *

createSeqwareModuleJob.

* * @param algo a {@link java.lang.String} object. * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.SeqwareModuleJob} object. */ public SeqwareModuleJob createSeqwareModuleJob(String algo) { return this.createSeqwareModuleJob(algo, Module.GenericCommandRunner, false); } /** *

createSeqwareModuleJob.

* * @param algo a {@link java.lang.String} object. * @param local a boolean. * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.SeqwareModuleJob} object. */ public SeqwareModuleJob createSeqwareModuleJob(String algo, boolean local) { return this.createSeqwareModuleJob(algo, Module.GenericCommandRunner, local); } /** *

createSeqwareModuleJob.

* * @param algo a {@link java.lang.String} object. * @param module a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Module} object. * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.SeqwareModuleJob} object. */ public SeqwareModuleJob createSeqwareModuleJob(String algo, Module module) { return this.createSeqwareModuleJob(algo, module, false); } /** *

createSeqwareModuleJob.

* * @param algo a {@link java.lang.String} object. * @param module a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Module} object. * @param local a boolean. * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.SeqwareModuleJob} object. */ public SeqwareModuleJob createSeqwareModuleJob(String algo, Module module, boolean local) { SeqwareModuleJob job = new SeqwareModuleJob(algo, module, local); this.addJob(job); return job; } /** *

getJobsByAlgo.

* * @param algo a {@link java.lang.String} object. * @return a {@link java.util.Collection} object. */ public Collection getJobsByAlgo(String algo) { List res = new ArrayList(); for (Job job : this.jobs.values()) { if (job.getAlgorithm().equals(algo)) { res.add(job); } >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302 }
Solution content
	private List jobs;

	
	public Workflow() {
		this.jobs = new ArrayList();
		this.tests = new ArrayList();
	}
	
	/**
	* get all jobs in current workflow
	* @return
	*/
	public List getJobs() {
		return jobs;
	}
	
	/**
	* add job to the workflow
	* @param job
	*/
	public void addJobs(AbstractJob job) {
		this.jobs.add(job);
	}
	
	/**
	*
	* @return the workflowbundle diretory
	*/
	public String getWorkflowBundleDir() {
		return workflowBundleDir;
	}
	/**
	* set the workflowBundle directory
	* @param workflowBundleDir
	*/
	public void setWorkflowBundleDir(String workflowBundleDir) {
		this.workflowBundleDir = workflowBundleDir;
	}
	
	public Job createJavaSeqwareModuleJob(String algo, String cp, String module) {
		AbstractJob job = new JavaSeqwareModuleJob(algo, cp, module);
		this.jobs.add(job);
		return job;
	}
	
	public Job createJavaJob(String algo, String cp, String mainclass) {
		AbstractJob job = new JavaJob(algo,cp,mainclass);
		this.jobs.add(job);
		return job;
	}
	
	public Job createBashJob(String algo) {
		AbstractJob job = new BashJob(algo);
		this.jobs.add(job);
		return job;
	}
	
	public Job createPerlJob(String algo, String script) {
		AbstractJob job = new PerlJob(algo, "", script);
		this.jobs.add(job);
		return job;
	}
	
	/**
	* add a test command for the workflow
	* @param value
	*/
	public void addTest(String value) {
		this.tests.add(value);
	}
	
	/**
	* @return all test commands
	*/
	public Collection getTests() {
		return this.tests;
	}
	
File
Workflow.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Comment
For statement
If statement
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
	}
	

<<<<<<< HEAD
}
=======
    /**
     * 

createJob.

* * @param algo a {@link java.lang.String} object. * @return a {@link net.sourceforge.seqware.pipeline.workflowV2.model.Job} object. */ public Job createJob(String algo) { Job job = new Job(algo); this.addJob(job); return job; } } >>>>>>> 8fc9b1c8b283aac2d27081c898e8fa3427d3f302
Solution content
	}
	

}

File
Workflow.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration