airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject [08/20] git commit: introducing workflow support in airavata api + other related modules
Date Wed, 23 Jul 2014 16:48:22 GMT
introducing workflow support in airavata api + other related modules


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a8974b7c
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a8974b7c
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a8974b7c

Branch: refs/heads/master
Commit: a8974b7cbad93b57b109b270e3e7c07794a8a338
Parents: dfe99b8
Author: Saminda Wijeratne <samindaw@gmail.com>
Authored: Fri Jul 11 21:52:23 2014 -0400
Committer: Saminda Wijeratne <samindaw@gmail.com>
Committed: Fri Jul 11 21:52:23 2014 -0400

----------------------------------------------------------------------
 airavata-api/airavata-api-server/pom.xml        |    5 +
 .../server/handler/AiravataServerHandler.java   |   70 +-
 .../server/handler/WorkflowServerHandler.java   |   69 +-
 .../api/client/AiravataClientFactory.java       |    9 +-
 .../client/samples/CreateLaunchExperiment.java  |   10 +-
 modules/distribution/server/pom.xml             |    5 +
 .../server/src/main/assembly/bin-assembly.xml   |    1 +
 .../orchestrator/core/ValidatorTest.java        |  224 +--
 modules/workflow-model/pom.xml                  |    6 +-
 modules/workflow-model/workflow-engine/pom.xml  |  328 ++++
 .../workflow/catalog/WorkflowCatalog.java       |   53 +
 .../catalog/WorkflowCatalogException.java       |   17 +
 .../catalog/WorkflowCatalogFactory.java         |   33 +
 .../workflow/catalog/WorkflowCatalogImpl.java   |  173 +++
 .../engine/concurrent/PredicatedExecutable.java |   33 +
 .../engine/concurrent/PredicatedTaskRunner.java |  153 ++
 .../engine/core/amazon/AmazonCredential.java    |   79 +
 .../engine/core/amazon/EC2InstanceResult.java   |   95 ++
 .../engine/core/generators/XmlBeansFiler.java   |   71 +
 .../core/workflow/ParameterListModel.java       |   88 ++
 .../engine/datadriven/WorkflowHarvester.java    |  191 +++
 .../engine/file/XBayaPathConstants.java         |   64 +
 .../engine/gfac/GFacRegistryClient.java         |  169 +++
 .../workflow/engine/gfac/SimpleWSClient.java    |  134 ++
 .../engine/globus/FileTransferConstants.java    |   38 +
 .../globus/GridFTPFileTransferClient.java       |  239 +++
 .../engine/graph/controller/NodeController.java |  200 +++
 .../engine/interpretor/DoWhileHandler.java      |  249 ++++
 .../engine/interpretor/ExperimentTemplate.java  |   37 +
 .../engine/interpretor/HeaderConstants.java     |   33 +
 .../SSWorkflowInterpreterInteractorImpl.java    |  115 ++
 .../interpretor/SystemComponentInvoker.java     |  114 ++
 .../WorkFlowInterpreterException.java           |   37 +
 .../interpretor/WorkflowExecutionMessage.java   |   40 +
 .../interpretor/WorkflowExecutionTemplate.java  |   51 +
 .../engine/interpretor/WorkflowInterpreter.java | 1408 ++++++++++++++++++
 .../WorkflowInterpreterConfiguration.java       |   78 +
 .../WorkflowInterpreterInteractor.java          |   94 ++
 .../interpretor/WorkflowInterpreterInvoker.java |   66 +
 .../WorkflowInterpreterSkeleton2.java           |  498 +++++++
 .../engine/invoker/AsynchronousInvoker.java     |  118 ++
 .../workflow/engine/invoker/DynamicInvoker.java |  167 +++
 .../workflow/engine/invoker/Invoker.java        |  105 ++
 .../invoker/MsgBoxWsaResponsesCorrelator.java   |  140 ++
 .../workflow/engine/invoker/SimpleInvoker.java  |  260 ++++
 .../engine/invoker/WorkflowInputUtil.java       |   52 +
 .../workflow/engine/util/AmazonUtil.java        |  150 ++
 .../airavata/workflow/engine/util/Data.java     |   70 +
 .../workflow/engine/util/GOConstants.java       |   30 +
 .../workflow/engine/util/GlobusOnlineUtils.java |  246 +++
 .../workflow/engine/util/InterpreterUtil.java   |  308 ++++
 .../workflow/engine/util/RegistryConstants.java |   30 +
 .../workflow/engine/util/TransferFile.java      |  170 +++
 .../workflow/engine/util/XBayaUtil.java         |  218 +++
 .../workflow/WorkflowEngineException.java       |   42 +
 .../engine/workflow/proxy/ProxyWSDL.java        |   87 ++
 .../engine/workflow/proxy/WorkflowClient.java   |   35 +
 .../engine/workflow/proxy/WorkflowContext.java  |   42 +
 .../workflow/proxy/WorkflowProxyException.java  |   64 +
 .../src/main/resources/WorkflowInterpretor.wsdl |   72 +
 .../src/main/resources/images/airavata-2.png    |  Bin 0 -> 5582 bytes
 .../main/resources/images/airavata-config.png   |  Bin 0 -> 1297 bytes
 .../src/main/resources/images/airavata-icon.png |  Bin 0 -> 584 bytes
 .../main/resources/images/airavata-icon2.png    |  Bin 0 -> 981 bytes
 .../src/main/resources/images/airavata-name.png |  Bin 0 -> 8261 bytes
 .../resources/images/airavata-title-text.png    |  Bin 0 -> 16438 bytes
 .../src/main/resources/images/airavata.png      |  Bin 0 -> 17280 bytes
 .../src/main/resources/images/application.png   |  Bin 0 -> 894 bytes
 .../src/main/resources/images/applications.png  |  Bin 0 -> 657 bytes
 .../src/main/resources/images/closed.gif        |  Bin 0 -> 923 bytes
 .../src/main/resources/images/cloud.png         |  Bin 0 -> 573 bytes
 .../src/main/resources/images/experiment.png    |  Bin 0 -> 543 bytes
 .../src/main/resources/images/experiments.png   |  Bin 0 -> 1142 bytes
 .../src/main/resources/images/gfac_url.png      |  Bin 0 -> 739 bytes
 .../src/main/resources/images/gfac_urls.png     |  Bin 0 -> 816 bytes
 .../src/main/resources/images/host.png          |  Bin 0 -> 652 bytes
 .../src/main/resources/images/hosts.png         |  Bin 0 -> 671 bytes
 .../src/main/resources/images/input_para.png    |  Bin 0 -> 428 bytes
 .../src/main/resources/images/jcr-repo.png      |  Bin 0 -> 1010 bytes
 .../src/main/resources/images/leaf.gif          |  Bin 0 -> 906 bytes
 .../src/main/resources/images/menu/jcr.png      |  Bin 0 -> 1158 bytes
 .../src/main/resources/images/menu/new2.png     |  Bin 0 -> 1175 bytes
 .../src/main/resources/images/menu/open1.png    |  Bin 0 -> 925 bytes
 .../src/main/resources/images/menu/open2.png    |  Bin 0 -> 964 bytes
 .../src/main/resources/images/menu/open_dir.png |  Bin 0 -> 749 bytes
 .../src/main/resources/images/menu/pause1.png   |  Bin 0 -> 1101 bytes
 .../resources/images/menu/pause_monitor1.png    |  Bin 0 -> 873 bytes
 .../src/main/resources/images/menu/play3.png    |  Bin 0 -> 1192 bytes
 .../src/main/resources/images/menu/play4.png    |  Bin 0 -> 765 bytes
 .../images/menu/resume_monitoring1.png          |  Bin 0 -> 957 bytes
 .../src/main/resources/images/menu/save1.png    |  Bin 0 -> 1200 bytes
 .../src/main/resources/images/menu/stop.png     |  Bin 0 -> 316 bytes
 .../src/main/resources/images/opened.gif        |  Bin 0 -> 917 bytes
 .../src/main/resources/images/output_para.png   |  Bin 0 -> 490 bytes
 .../src/main/resources/images/parameter.png     |  Bin 0 -> 544 bytes
 .../src/main/resources/images/pause.jpeg        |  Bin 0 -> 458 bytes
 .../src/main/resources/images/play.jpeg         |  Bin 0 -> 471 bytes
 .../src/main/resources/images/registry.png      |  Bin 0 -> 3419 bytes
 .../src/main/resources/images/service.png       |  Bin 0 -> 871 bytes
 .../src/main/resources/images/services.png      |  Bin 0 -> 899 bytes
 .../src/main/resources/images/step.gif          |  Bin 0 -> 211 bytes
 .../src/main/resources/images/stop.jpeg         |  Bin 0 -> 497 bytes
 .../src/main/resources/images/workflow.png      |  Bin 0 -> 601 bytes
 .../resources/images/workflow_templates.png     |  Bin 0 -> 710 bytes
 .../src/main/resources/images/workflows.png     |  Bin 0 -> 778 bytes
 .../src/main/resources/services.xml             |   30 +
 .../resources/wsdls/TestCMD_Example1_AWSDL.xml  |   56 +
 .../src/main/resources/wsdls/adder-awsdl.xml    |   63 +
 .../src/main/resources/wsdls/eventing.wsdl      |  332 +++++
 .../interpreter/ComplexForEachWorkflowTest.java |   73 +
 .../xbaya/interpreter/ComplexMathService.java   |   40 +
 .../interpreter/ComplexMathWorkflowTest.java    |   71 +
 .../interpreter/CrossProductWorkflowTest.java   |   71 +
 .../airavata/xbaya/interpreter/EchoService.java |   28 +
 .../xbaya/interpreter/ForEachWorkflowTest.java  |   73 +
 .../interpreter/LevenshteinDistanceService.java |   48 +
 .../airavata/xbaya/interpreter/Listener.java    |   31 +
 .../xbaya/interpreter/NotificationSender.java   |  204 +++
 .../xbaya/interpreter/RegistryServiceTest.java  |  105 ++
 .../interpreter/SimpleForEachWorkflowTest.java  |   72 +
 .../interpreter/SimpleMathWorkflowTest.java     |   73 +
 .../xbaya/interpreter/WorkflowTest.java         |   74 +
 .../xbaya/interpreter/WorkflowTrackingTest.java |  105 ++
 .../xbaya/interpreter/XBayaClientTest.java      |   80 +
 .../interpreter/XBayaConsolidatedTestSuite.java |   67 +
 .../xbaya/interpreter/utils/ConfigKeys.java     |   34 +
 .../xbaya/interpreter/utils/TestUtilServer.java |  243 +++
 .../interpreter/utils/WorkflowTestUtils.java    |   97 ++
 .../workflow-engine/src/test/java/test.xwf      |  251 ++++
 .../src/test/resources/axis2_default.xml        |  278 ++++
 .../workflow-model-component/pom.xml            |  104 ++
 .../registry/JCRComponentReference.java         |   66 +
 .../registry/JCRComponentRegistry.java          |   78 +
 .../workflow-model/workflow-model-core/pom.xml  |    5 +
 .../component/system/SubWorkflowComponent.java  |    2 +-
 .../component/web/WebComponentRegistry.java     |    3 -
 .../model/component/ws/WSComponent.java         |  329 +---
 .../model/component/ws/WSComponentFactory.java  |  108 +-
 .../model/component/ws/WSComponentPort.java     |   24 +-
 .../model/component/ws/WSComponentRegistry.java |    5 +-
 .../model/component/ws/WorkflowComponent.java   |   31 +-
 .../airavata/workflow/model/gpel/DSCUtil.java   |   24 +-
 .../model/gpel/script/WorkflowWSDL.java         |    5 +-
 .../workflow/model/graph/util/GraphUtil.java    |    4 +-
 .../workflow/model/graph/ws/WSNode.java         |   16 +-
 .../airavata/workflow/model/wf/Workflow.java    |   91 +-
 modules/xbaya-gui/pom.xml                       |    5 +
 .../ui/dialogs/registry/RegistryWindow.java     |    4 +-
 .../WorkflowInterpreterLaunchWindow.java        |   48 +-
 pom.xml                                         |    1 +
 150 files changed, 10653 insertions(+), 682 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/airavata-api/airavata-api-server/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/pom.xml b/airavata-api/airavata-api-server/pom.xml
index c585408..5f8adc7 100644
--- a/airavata-api/airavata-api-server/pom.xml
+++ b/airavata-api/airavata-api-server/pom.xml
@@ -67,6 +67,11 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-engine</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.thrift</groupId>
             <artifactId>libthrift</artifactId>
             <version>${thrift.version}</version>

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 683848a..9831431 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -33,6 +33,7 @@ import java.util.Random;
 import org.airavata.appcatalog.cpi.AppCatalog;
 import org.airavata.appcatalog.cpi.AppCatalogException;
 import org.airavata.appcatalog.cpi.ApplicationDeployment;
+import org.airavata.appcatalog.cpi.ApplicationInterface;
 import org.airavata.appcatalog.cpi.ComputeResource;
 import org.airavata.appcatalog.cpi.GwyResourceProfile;
 import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
@@ -87,6 +88,8 @@ import org.apache.airavata.registry.cpi.RegistryModelType;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.TaskDetailConstants;
 import org.apache.airavata.registry.cpi.utils.Constants.FieldConstants.WorkflowNodeConstants;
+import org.apache.airavata.workflow.catalog.WorkflowCatalogException;
+import org.apache.airavata.workflow.catalog.WorkflowCatalogFactory;
 import org.apache.thrift.TException;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
@@ -1018,26 +1021,65 @@ public class AiravataServerHandler implements Airavata.Iface, Watcher {
 	            throw exception;
 		}
 
-    	final OrchestratorService.Client orchestratorClient = getOrchestratorClient();
         final String expID = airavataExperimentId;
         final String token = airavataCredStoreToken;
         synchronized (this) {
-            if (orchestratorClient.validateExperiment(expID)) {
-                (new Thread() {
-                    public void run() {
-                        try {
-                            launchSingleAppExperiment(expID, token, orchestratorClient);
-                        } catch (TException e) {
-                            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                        }
-                    }
-                }).start();
-            } else {
-                throw new InvalidRequestException("Experiment Validation Failed, please check the configuration");
-            }
+        	try {
+				ApplicationInterface applicationInterface = AppCatalogFactory.getAppCatalog().getApplicationInterface();
+				List<String> allApplicationInterfaceIds = applicationInterface.getAllApplicationInterfaceIds();
+				Experiment experiment = getExperiment(expID);
+				String applicationId = experiment.getApplicationId();
+				Thread thread = null;
+				if (allApplicationInterfaceIds.contains(applicationId)){
+					//its an single application execution experiment
+			    	final OrchestratorService.Client orchestratorClient = getOrchestratorClient();
+					if (orchestratorClient.validateExperiment(expID)) {
+						thread = new Thread() {
+		                    public void run() {
+		                        try {
+	                        		launchSingleAppExperiment(expID, token, orchestratorClient);
+		                        } catch (TException e) {
+		                            e.printStackTrace();  
+								}
+		                    }
+		                };	
+		            } else {
+		                throw new InvalidRequestException("Experiment Validation Failed, please check the configuration");
+		            }
+	                
+				} else {
+					List<String> allWorkflows = WorkflowCatalogFactory.getWorkflowCatalog().getAllWorkflows();
+					if (allWorkflows.contains(applicationId)){
+						//its a workflow execution experiment
+						thread = new Thread() {
+		                    public void run() {
+		                        try {
+	                        		launchWorkflowExperiment(expID, token);
+		                        } catch (TException e) {
+		                            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+								}
+		                    }
+		                };
+					} else {
+						throw new InvalidRequestException("Experiment '"+expID+"' launch failed. Unable to locate an application or a workflow with the id "+applicationId);
+					}
+				}
+				thread.start();
+			} catch (AppCatalogException e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			} catch (WorkflowCatalogException e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+            
         }
     }
 
+    private boolean launchWorkflowExperiment(String experimentId, String airavataCredStoreToken) throws TException {
+    	return true;
+    }
+    
     private boolean launchSingleAppExperiment(String experimentId, String airavataCredStoreToken, OrchestratorService.Client orchestratorClient) throws TException {
         Experiment experiment = null;
         try {

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
index 1999618..8cb57d6 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/WorkflowServerHandler.java
@@ -24,17 +24,14 @@ package org.apache.airavata.api.server.handler;
 import java.util.List;
 
 import org.apache.airavata.api.workflow.Workflow.Iface;
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.model.Workflow;
 import org.apache.airavata.model.error.AiravataClientException;
 import org.apache.airavata.model.error.AiravataErrorType;
 import org.apache.airavata.model.error.AiravataSystemException;
 import org.apache.airavata.model.error.InvalidRequestException;
+import org.apache.airavata.workflow.catalog.WorkflowCatalog;
+import org.apache.airavata.workflow.catalog.WorkflowCatalogException;
+import org.apache.airavata.workflow.catalog.WorkflowCatalogFactory;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,14 +39,14 @@ import org.slf4j.LoggerFactory;
 public class WorkflowServerHandler implements Iface {
     private static final Logger log = LoggerFactory.getLogger(WorkflowServerHandler.class);
 
-	private AiravataAPI airavataAPI;
+	private WorkflowCatalog workflowCatalog;
 
 	@Override
 	public List<String> getAllWorkflows() throws InvalidRequestException,
 			AiravataClientException, AiravataSystemException, TException {
 		try {
-			return getAiravataAPI().getWorkflowManager().getWorkflowTemplateIds();
-		} catch (AiravataAPIInvocationException e) {
+			return getWorkflowCatalog().getAllWorkflows();
+		} catch (WorkflowCatalogException e) {
 			String msg = "Error in retrieving all workflow template Ids.";
 			log.error(msg, e);
 			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -63,13 +60,8 @@ public class WorkflowServerHandler implements Iface {
 			throws InvalidRequestException, AiravataClientException,
 			AiravataSystemException, TException {
 		try {
-			org.apache.airavata.workflow.model.wf.Workflow w = getAiravataAPI().getWorkflowManager().getWorkflow(workflowTemplateId);
-			Workflow workflow = new Workflow();
-			workflow.setTemplateId(workflowTemplateId);
-			workflow.setGraph(XMLUtil.xmlElementToString(w.toXML()));
-			workflow.setName(w.getName());
-			return workflow;
-		} catch (AiravataAPIInvocationException e) {
+			return getWorkflowCatalog().getWorkflow(workflowTemplateId);
+		} catch (WorkflowCatalogException e) {
 			String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
 			log.error(msg, e);
 			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -83,8 +75,8 @@ public class WorkflowServerHandler implements Iface {
 			throws InvalidRequestException, AiravataClientException,
 			AiravataSystemException, TException {
 		try {
-			getAiravataAPI().getWorkflowManager().deleteWorkflow(workflowTemplateId);
-		} catch (AiravataAPIInvocationException e) {
+			getWorkflowCatalog().deleteWorkflow(workflowTemplateId);
+		} catch (WorkflowCatalogException e) {
 			String msg = "Error in deleting the workflow "+workflowTemplateId+".";
 			log.error(msg, e);
 			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -98,9 +90,8 @@ public class WorkflowServerHandler implements Iface {
 			throws InvalidRequestException, AiravataClientException,
 			AiravataSystemException, TException {
 		try {
-			getAiravataAPI().getWorkflowManager().addWorkflow(workflow.getGraph());
-			return workflow.getName();
-		} catch (AiravataAPIInvocationException e) {
+			return getWorkflowCatalog().registerWorkflow(workflow);
+		} catch (WorkflowCatalogException e) {
 			String msg = "Error in registering the workflow "+workflow.getName()+".";
 			log.error(msg, e);
 			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -114,8 +105,8 @@ public class WorkflowServerHandler implements Iface {
 			throws InvalidRequestException, AiravataClientException,
 			AiravataSystemException, TException {
 		try {
-			getAiravataAPI().getWorkflowManager().updateWorkflow(workflowTemplateId, workflow.getGraph());
-		} catch (AiravataAPIInvocationException e) {
+			getWorkflowCatalog().updateWorkflow(workflowTemplateId, workflow);
+		} catch (WorkflowCatalogException e) {
 			String msg = "Error in updating the workflow "+workflow.getName()+".";
 			log.error(msg, e);
 			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -129,13 +120,8 @@ public class WorkflowServerHandler implements Iface {
 			throws InvalidRequestException, AiravataClientException,
 			AiravataSystemException, TException {
 		try {
-			if (getAiravataAPI().getWorkflowManager().isWorkflowExists(workflowName)){
-				return workflowName;
-			}
-			AiravataClientException airavataClientException = new AiravataClientException(AiravataErrorType.UNKNOWN);
-			airavataClientException.setParameter("No worklfow exists with the name "+workflowName);
-			throw airavataClientException;
-		} catch (AiravataAPIInvocationException e) {
+			return getWorkflowCatalog().getWorkflowTemplateId(workflowName);
+		} catch (WorkflowCatalogException e) {
 			String msg = "Error in retrieving the workflow template id for "+workflowName+".";
 			log.error(msg, e);
 			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -149,8 +135,8 @@ public class WorkflowServerHandler implements Iface {
 			throws InvalidRequestException, AiravataClientException,
 			AiravataSystemException, TException {
 		try {
-			return getAiravataAPI().getWorkflowManager().isWorkflowExists(workflowName);
-		} catch (AiravataAPIInvocationException e) {
+			return getWorkflowCatalog().isWorkflowExistWithName(workflowName);
+		} catch (WorkflowCatalogException e) {
 			String msg = "Error in veriying the workflow for workflow name "+workflowName+".";
 			log.error(msg, e);
 			AiravataSystemException exception = new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
@@ -158,24 +144,15 @@ public class WorkflowServerHandler implements Iface {
             throw exception;
 		}
 	}
-	
-	private String getAiravataUserName() throws ApplicationSettingsException {
-		return ServerSettings.getDefaultUserGateway();
-	}
-
-	private String getGatewayName() throws ApplicationSettingsException {
-		return ServerSettings.getDefaultUser();
-	}
 
-	private AiravataAPI getAiravataAPI() {
-		if (airavataAPI == null) {
+	private WorkflowCatalog getWorkflowCatalog() {
+		if (workflowCatalog == null) {
 			try {
-				airavataAPI = AiravataAPIFactory.getAPI(getGatewayName(),
-						getAiravataUserName());
+				workflowCatalog = WorkflowCatalogFactory.getWorkflowCatalog();
 			} catch (Exception e) {
-				log.error("Unable to create Airavata API", e);
+				log.error("Unable to create Workflow Catalog", e);
 			}
 		}
-		return airavataAPI;
+		return workflowCatalog;
 	}
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
index bc8cde5..dc6b6e1 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/client/AiravataClientFactory.java
@@ -21,13 +21,11 @@
 
 package org.apache.airavata.api.client;
 
-import java.lang.reflect.InvocationTargetException;
-
 import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.workflow.Workflow;
 //import org.apache.airavata.api.appcatalog.ApplicationCatalogAPI;
 import org.apache.airavata.model.error.AiravataClientConnectException;
 import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TMultiplexedProtocol;
 import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
@@ -51,18 +49,19 @@ public class AiravataClientFactory {
         }
     }
     
-    /*public static ApplicationCatalogAPI.Client createApplicationCatalogClient(String serverHost, int serverPort) throws AiravataClientConnectException{
+    public static Workflow.Client createWorkflowClient(String serverHost, int serverPort) throws AiravataClientConnectException{
         try {
             TTransport transport = new TSocket(serverHost, serverPort);
             transport.open();
             TProtocol protocol = new TBinaryProtocol(transport);
 //            TMultiplexedProtocol mp = new TMultiplexedProtocol(protocol, "AppCatalog");
-            return new ApplicationCatalogAPI.Client(protocol);
+            return new Workflow.Client(protocol);
         } catch (TTransportException e) {
             throw new AiravataClientConnectException("Unable to connect to the server at "+serverHost+":"+serverPort);
         }
     }
     
+    /*
     public static <T extends org.apache.thrift.TServiceClient> T createApplicationCatalogClient(String serverHost, int serverPort, Class<T> type) throws Exception{
         try {
             TTransport transport = new TSocket(serverHost, serverPort);

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index d812ff0..fa29da2 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -77,19 +77,19 @@ public class CreateLaunchExperiment {
             AiravataUtils.setExecutionAsClient();
             client = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
             System.out.println("API version is " + client.getAPIVersion());
-//            addDescriptors();
+            addDescriptors();
 
 //            final String expId = createExperimentForSSHHost(airavata);
 //            final String expId = createExperimentForTrestles(client);
 //            final String expId = createExperimentForStampede(client);
-//            final String expId = createExperimentForLocalHost(client);
+            final String expId = createExperimentForLocalHost(client);
 //            final String expId = createExperimentForLonestar(airavata);
 //            final String expId = createExperimentWRFTrestles(client);
 //            final String expId = createExperimentForBR2(client);
 //            final String expId = createExperimentForBR2Amber(client);
 //            final String expId = createExperimentWRFStampede(client);
 //            final String expId = createExperimentForStampedeAmber(client);
-            final String expId = createExperimentForTrestlesAmber(client);
+//            final String expId = createExperimentForTrestlesAmber(client);
 
             System.out.println("Experiment ID : " + expId);
 //            updateExperiment(airavata, expId);
@@ -106,7 +106,7 @@ public class CreateLaunchExperiment {
         try {
             DocumentCreatorNew documentCreator = new DocumentCreatorNew(client);
 //            DocumentCreator documentCreator = new DocumentCreator(getAiravataAPI());
-//            localHostAppId = documentCreator.createLocalHostDocs();
+            localHostAppId = documentCreator.createLocalHostDocs();
 //            sshHostAppId = documentCreator.createSSHHostDocs();
 //            documentCreator.createGramDocs();
 //            pbsEchoAppId =documentCreator.createPBSDocsForOGCE_Echo();
@@ -118,7 +118,7 @@ public class CreateLaunchExperiment {
 //            slurmWRFAppId = documentCreator.createSlumWRFDocs();
 //            br2AmberAppId = documentCreator.createBigRedAmberDocs();
 //            slurmAmberAppId = documentCreator.createStampedeAmberDocs();
-            trestlesAmberAppId = documentCreator.createTrestlesAmberDocs();
+//            trestlesAmberAppId = documentCreator.createTrestlesAmberDocs();
             System.out.printf(localHostAppId);
             System.out.println(sshHostAppId);
             System.out.println(pbsEchoAppId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/distribution/server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/server/pom.xml b/modules/distribution/server/pom.xml
index fcc4ec4..e7ccde2 100644
--- a/modules/distribution/server/pom.xml
+++ b/modules/distribution/server/pom.xml
@@ -387,6 +387,11 @@
             <artifactId>airavata-model-utils</artifactId>
             <version>${project.version}</version>
         </dependency>
+	<dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-engine</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-api-server</artifactId>

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/distribution/server/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/server/src/main/assembly/bin-assembly.xml b/modules/distribution/server/src/main/assembly/bin-assembly.xml
index dcfa0a1..39ebbbb 100644
--- a/modules/distribution/server/src/main/assembly/bin-assembly.xml
+++ b/modules/distribution/server/src/main/assembly/bin-assembly.xml
@@ -221,6 +221,7 @@
                 <include>org.apache.airavata:airavata-messenger-commons:jar</include>
                 <include>org.apache.airavata:airavata-messenger-client:jar</include>
                 <include>org.apache.airavata:airavata-workflow-tracking:jar</include>
+                <include>org.apache.airavata:airavata-workflow-engine:jar</include>
                 <include>org.apache.airavata:gsissh:jar</include>
                 <include>org.apache.airavata:airavata-model-utils:jar</include>
                 <include>org.apache.airavata:airavata-api-server:jar</include>

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/ValidatorTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/ValidatorTest.java b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/ValidatorTest.java
index e00853b..dcf1c6e 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/ValidatorTest.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/ValidatorTest.java
@@ -1,112 +1,112 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.orchestrator.core;
-
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.model.error.LaunchValidationException;
-import org.apache.airavata.model.util.ExperimentModelUtil;
-import org.apache.airavata.model.workspace.experiment.*;
-import org.apache.airavata.orchestrator.core.utils.OrchestratorConstants;
-import org.apache.airavata.orchestrator.cpi.Orchestrator;
-import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
-import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.ParentDataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.junit.Assert;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ValidatorTest extends BaseOrchestratorTest {
-    private static final Logger log = LoggerFactory.getLogger(NewOrchestratorTest.class);
-
-    private Orchestrator orchestrator;
-    private List<TaskDetails> tasks;
-
-    @BeforeTest
-    public void setUp() throws Exception {
-        AiravataUtils.setExecutionAsServer();
-        super.setUp();
-        System.setProperty(OrchestratorConstants.JOB_VALIDATOR,"org.apache.airavata.orchestrator.core.util.TestValidator,org.apache.airavata.orchestrator.core.util.SecondValidator");
-        System.setProperty("enable.validation", "true");
-        orchestrator = new SimpleOrchestratorImpl();
-    }
-
-
-
-    @Test
-    public void testValidator() throws Exception {
-          // creating host description
-        List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
-        DataObjectType input = new DataObjectType();
-        input.setKey("echo_input");
-        input.setType(DataType.STRING);
-        input.setValue("echo_output=Hello World");
-        exInputs.add(input);
-
-        List<DataObjectType> exOut = new ArrayList<DataObjectType>();
-        DataObjectType output = new DataObjectType();
-        output.setKey("echo_output");
-        output.setType(DataType.STRING);
-        output.setValue("");
-        exOut.add(output);
-
-        Experiment simpleExperiment =
-                ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho0", "SimpleEcho0", exInputs);
-        simpleExperiment.setExperimentOutputs(exOut);
-
-        WorkflowNodeDetails test = ExperimentModelUtil.createWorkflowNode("test", null);
-        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0, 1, "sds128");
-        scheduling.setResourceHostId("localhost");
-        UserConfigurationData userConfigurationData = new UserConfigurationData();
-        userConfigurationData.setAiravataAutoSchedule(false);
-        userConfigurationData.setOverrideManualScheduledParams(false);
-        userConfigurationData.setComputationalResourceScheduling(scheduling);
-        simpleExperiment.setUserConfigurationData(userConfigurationData);
-
-        Registry defaultRegistry = RegistryFactory.getDefaultRegistry();
-        String experimentId = (String)defaultRegistry.add(ParentDataType.EXPERIMENT, simpleExperiment);
-
-        simpleExperiment.setExperimentID(experimentId);
-        tasks = orchestrator.createTasks(experimentId);
-
-        Assert.assertTrue(orchestrator.validateExperiment(simpleExperiment, test, tasks.get(0)).isValidationState());
-
-        simpleExperiment.setExperimentID(null);
-
-        try {
-            orchestrator.validateExperiment(simpleExperiment, test, tasks.get(0)).isValidationState();
-        }catch(LaunchValidationException e){
-            Assert.assertTrue(true);
-        }
-        tasks.get(0).setTaskID(null);
-        try {
-            orchestrator.validateExperiment(simpleExperiment, test, tasks.get(0));
-        }catch (LaunchValidationException e){
-            Assert.assertTrue(true);
-        }
-    }
-
-}
+///*
+// *
+// * Licensed to the Apache Software Foundation (ASF) under one
+// * or more contributor license agreements.  See the NOTICE file
+// * distributed with this work for additional information
+// * regarding copyright ownership.  The ASF licenses this file
+// * to you under the Apache License, Version 2.0 (the
+// * "License"); you may not use this file except in compliance
+// * with the License.  You may obtain a copy of the License at
+// *
+// *   http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing,
+// * software distributed under the License is distributed on an
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// * KIND, either express or implied.  See the License for the
+// * specific language governing permissions and limitations
+// * under the License.
+// *
+//*/
+//package org.apache.airavata.orchestrator.core;
+//
+//import org.apache.airavata.common.utils.AiravataUtils;
+//import org.apache.airavata.model.error.LaunchValidationException;
+//import org.apache.airavata.model.util.ExperimentModelUtil;
+//import org.apache.airavata.model.workspace.experiment.*;
+//import org.apache.airavata.orchestrator.core.utils.OrchestratorConstants;
+//import org.apache.airavata.orchestrator.cpi.Orchestrator;
+//import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
+//import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
+//import org.apache.airavata.registry.cpi.ParentDataType;
+//import org.apache.airavata.registry.cpi.Registry;
+//import org.junit.Assert;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.testng.annotations.BeforeTest;
+//import org.testng.annotations.Test;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//
+//public class ValidatorTest extends BaseOrchestratorTest {
+//    private static final Logger log = LoggerFactory.getLogger(NewOrchestratorTest.class);
+//
+//    private Orchestrator orchestrator;
+//    private List<TaskDetails> tasks;
+//
+//    @BeforeTest
+//    public void setUp() throws Exception {
+//        AiravataUtils.setExecutionAsServer();
+//        super.setUp();
+//        System.setProperty(OrchestratorConstants.JOB_VALIDATOR,"org.apache.airavata.orchestrator.core.util.TestValidator,org.apache.airavata.orchestrator.core.util.SecondValidator");
+//        System.setProperty("enable.validation", "true");
+//        orchestrator = new SimpleOrchestratorImpl();
+//    }
+//
+//
+//
+//    @Test
+//    public void testValidator() throws Exception {
+//          // creating host description
+//        List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
+//        DataObjectType input = new DataObjectType();
+//        input.setKey("echo_input");
+//        input.setType(DataType.STRING);
+//        input.setValue("echo_output=Hello World");
+//        exInputs.add(input);
+//
+//        List<DataObjectType> exOut = new ArrayList<DataObjectType>();
+//        DataObjectType output = new DataObjectType();
+//        output.setKey("echo_output");
+//        output.setType(DataType.STRING);
+//        output.setValue("");
+//        exOut.add(output);
+//
+//        Experiment simpleExperiment =
+//                ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho0", "SimpleEcho0", exInputs);
+//        simpleExperiment.setExperimentOutputs(exOut);
+//
+//        WorkflowNodeDetails test = ExperimentModelUtil.createWorkflowNode("test", null);
+//        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0, 1, "sds128");
+//        scheduling.setResourceHostId("localhost");
+//        UserConfigurationData userConfigurationData = new UserConfigurationData();
+//        userConfigurationData.setAiravataAutoSchedule(false);
+//        userConfigurationData.setOverrideManualScheduledParams(false);
+//        userConfigurationData.setComputationalResourceScheduling(scheduling);
+//        simpleExperiment.setUserConfigurationData(userConfigurationData);
+//
+//        Registry defaultRegistry = RegistryFactory.getDefaultRegistry();
+//        String experimentId = (String)defaultRegistry.add(ParentDataType.EXPERIMENT, simpleExperiment);
+//
+//        simpleExperiment.setExperimentID(experimentId);
+//        tasks = orchestrator.createTasks(experimentId);
+//
+//        Assert.assertTrue(orchestrator.validateExperiment(simpleExperiment, test, tasks.get(0)).isValidationState());
+//
+//        simpleExperiment.setExperimentID(null);
+//
+//        try {
+//            orchestrator.validateExperiment(simpleExperiment, test, tasks.get(0)).isValidationState();
+//        }catch(LaunchValidationException e){
+//            Assert.assertTrue(true);
+//        }
+//        tasks.get(0).setTaskID(null);
+//        try {
+//            orchestrator.validateExperiment(simpleExperiment, test, tasks.get(0));
+//        }catch (LaunchValidationException e){
+//            Assert.assertTrue(true);
+//        }
+//    }
+//
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/pom.xml b/modules/workflow-model/pom.xml
index d9d1554..f91882b 100644
--- a/modules/workflow-model/pom.xml
+++ b/modules/workflow-model/pom.xml
@@ -25,8 +25,8 @@
 
 	<modules>
 		<module>workflow-model-core</module>
-		<!--module>workflow-model-component</module>
-		<module>workflow-model-component-node</module-->
-		<!--module>workflow-engine</module-->
+		<module>workflow-model-component</module>
+		<!--module>workflow-model-component-node</module-->
+		<module>workflow-engine</module>
 	</modules>
 </project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/pom.xml b/modules/workflow-model/workflow-engine/pom.xml
new file mode 100644
index 0000000..fcdfd87
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/pom.xml
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+    the Apache License, Version 2.0 (theƏ "License"); you may not use this file except in compliance with the License. You may 
+    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+    the License. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata-workflow-model-parent</artifactId>
+        <version>0.13-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>airavata-workflow-engine</artifactId>
+    <packaging>jar</packaging>
+    <name>Airavata Workflow Engine</name>
+    <url>http://airavata.apache.org/</url>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>restore-persistence</id>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            <tasks>
+                                <copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
+                                <copy file="src/main/resources/WorkflowInterpretor.wsdl" tofile="${project.build.outputDirectory}/META-INF/service.wsdl" />
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/jnlp/lib</outputDirectory>
+                            <overWriteReleases>false</overWriteReleases>
+                            <overWriteSnapshots>true</overWriteSnapshots>
+                            <excludeTransitive>false</excludeTransitive>
+                        </configuration>
+                    </execution>
+                    <!--execution>
+                        <id>unpack-dependencies</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.airavata</groupId>
+                                    <artifactId>apache-airavata-samples</artifactId>
+                                    <type>zip</type>
+                                    <outputDirectory>${project.build.directory}/samples</outputDirectory>
+                                </artifactItem>
+	                        </artifactItems>
+                        </configuration>
+                    </execution-->
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <!--dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>apache-airavata-samples</artifactId>
+            <version>${project.version}</version>
+	    <type>zip</type>
+	    <optional>true</optional>
+        </dependency-->
+
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>xpp3</artifactId>
+            <version>${xpp3.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>xpp5</artifactId>
+            <version>${xpp5.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>xsul</artifactId>
+            <version>${xsul.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>gpel-client</artifactId>
+            <version>${gpel.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>atomixmiser</artifactId>
+            <version>${atomixmiser.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.python</groupId>
+            <artifactId>jython</artifactId>
+            <version>${jython.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.xmlbeans</groupId>
+            <artifactId>xmlbeans</artifactId>
+            <version>${xmlbeans.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-adb</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>1.2.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>1.2.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-dom</artifactId>
+            <version>1.2.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.schema</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.neethi</groupId>
+            <artifactId>neethi</artifactId>
+            <version>2.0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-local</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-http</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+
+        <!-- AMAZON STUFFS -->
+        <dependency>
+            <groupId>com.amazonaws</groupId>
+            <artifactId>aws-java-sdk</artifactId>
+            <version>1.3.20</version>
+        </dependency>
+        <dependency>
+            <groupId>net.java.dev.jets3t</groupId>
+            <artifactId>jets3t</artifactId>
+            <version>0.8.0</version>
+        </dependency>
+
+        <!-- AIRAVATA modules -->
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-model-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-model-component</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-message-monitor</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-model-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-orchestrator-service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-client-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-tracking</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-jpa-registry</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-registry-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- JCR Support -->
+        <!-- TODO need clean up -->
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-gfac-schema-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-gfac-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-gfac-ec2</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>${jcr.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-execution-context</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!--dependency> <groupId>org.apache.airavata</groupId> <artifactId>airavata-jpa-registry</artifactId> <version>${project.version}</version> 
+            </dependency -->
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <version>${derby.version}</version>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.globusonline</groupId>-->
+            <!--<artifactId>transfer-api-client-java</artifactId>-->
+            <!--<version>0.10.8</version>-->
+        <!--</dependency>-->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.3</version>
+        </dependency>
+	<dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-client-configuration</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+	<dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-server-configuration</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalog.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalog.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalog.java
new file mode 100644
index 0000000..9d825e8
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalog.java
@@ -0,0 +1,53 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.workflow.catalog;
+
+import java.util.List;
+
+import org.apache.airavata.model.Workflow;
+import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.error.AiravataSystemException;
+import org.apache.airavata.model.error.InvalidRequestException;
+import org.apache.thrift.TException;
+
+public interface WorkflowCatalog {
+	public List<String> getAllWorkflows() throws WorkflowCatalogException;
+
+	public Workflow getWorkflow(String workflowTemplateId)
+			throws WorkflowCatalogException;
+
+	public void deleteWorkflow(String workflowTemplateId)
+			throws WorkflowCatalogException;
+
+	public String registerWorkflow(Workflow workflow)
+			throws WorkflowCatalogException;
+
+	public void updateWorkflow(String workflowTemplateId, Workflow workflow)
+			throws WorkflowCatalogException;
+
+	public String getWorkflowTemplateId(String workflowName)
+			throws WorkflowCatalogException;
+
+	public boolean isWorkflowExistWithName(String workflowName)
+			throws WorkflowCatalogException;
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogException.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogException.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogException.java
new file mode 100644
index 0000000..b6caa5f
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogException.java
@@ -0,0 +1,17 @@
+package org.apache.airavata.workflow.catalog;
+
+public class WorkflowCatalogException extends Exception{
+    private static final long serialVersionUID = -2849422320139467602L;
+
+    public WorkflowCatalogException(Throwable e) {
+        super(e);
+    }
+
+    public WorkflowCatalogException(String message) {
+        super(message, null);
+    }
+
+    public WorkflowCatalogException(String message, Throwable e) {
+        super(message, e);
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogFactory.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogFactory.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogFactory.java
new file mode 100644
index 0000000..9156282
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogFactory.java
@@ -0,0 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.workflow.catalog;
+
+public class WorkflowCatalogFactory {
+	private static WorkflowCatalogImpl workflowCatalog;
+	
+	public static WorkflowCatalog getWorkflowCatalog(){
+		if (workflowCatalog==null) {
+			workflowCatalog = new WorkflowCatalogImpl();
+		}
+		return workflowCatalog;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogImpl.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogImpl.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogImpl.java
new file mode 100644
index 0000000..4a3dcf1
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/catalog/WorkflowCatalogImpl.java
@@ -0,0 +1,173 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.workflow.catalog;
+
+import java.util.List;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.model.Workflow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowCatalogImpl implements WorkflowCatalog {
+    private static final Logger log = LoggerFactory.getLogger(WorkflowCatalogImpl.class);
+
+	private AiravataAPI airavataAPI;
+	
+	public List<String> getAllWorkflows() throws WorkflowCatalogException{
+		try {
+			return getAiravataAPI().getWorkflowManager()
+					.getWorkflowTemplateIds();
+		} catch (AiravataAPIInvocationException e) {
+			String msg = "Error in retrieving all workflow template Ids.";
+			log.error(msg, e);
+			WorkflowCatalogException exception = new WorkflowCatalogException(msg + " More info : " + e.getMessage());
+			throw exception;
+		}
+	}
+
+	@Override
+	public Workflow getWorkflow(String workflowTemplateId)
+			throws WorkflowCatalogException{
+		try {
+			org.apache.airavata.workflow.model.wf.Workflow w = getAiravataAPI()
+					.getWorkflowManager().getWorkflow(workflowTemplateId);
+			Workflow workflow = new Workflow();
+			workflow.setTemplateId(workflowTemplateId);
+			workflow.setGraph(XMLUtil.xmlElementToString(w.toXML()));
+			workflow.setName(w.getName());
+			return workflow;
+		} catch (AiravataAPIInvocationException e) {
+			String msg = "Error in retrieving the workflow "
+					+ workflowTemplateId + ".";
+			log.error(msg, e);
+			WorkflowCatalogException exception = new WorkflowCatalogException(msg + " More info : " + e.getMessage());
+			throw exception;
+		}
+	}
+
+	@Override
+	public void deleteWorkflow(String workflowTemplateId)
+			throws WorkflowCatalogException{
+		try {
+			getAiravataAPI().getWorkflowManager().deleteWorkflow(
+					workflowTemplateId);
+		} catch (AiravataAPIInvocationException e) {
+			String msg = "Error in deleting the workflow " + workflowTemplateId
+					+ ".";
+			log.error(msg, e);
+			WorkflowCatalogException exception = new WorkflowCatalogException(msg + " More info : " + e.getMessage());
+			throw exception;
+		}
+	}
+
+	@Override
+	public String registerWorkflow(Workflow workflow)
+			throws WorkflowCatalogException {
+		try {
+			getAiravataAPI().getWorkflowManager().addWorkflow(
+					workflow.getGraph());
+			return workflow.getName();
+		} catch (AiravataAPIInvocationException e) {
+			String msg = "Error in registering the workflow "
+					+ workflow.getName() + ".";
+			log.error(msg, e);
+			WorkflowCatalogException exception = new WorkflowCatalogException(msg + " More info : " + e.getMessage());
+			throw exception;
+		}
+	}
+
+	@Override
+	public void updateWorkflow(String workflowTemplateId, Workflow workflow)
+			throws WorkflowCatalogException {
+		try {
+			getAiravataAPI().getWorkflowManager().updateWorkflow(
+					workflowTemplateId, workflow.getGraph());
+		} catch (AiravataAPIInvocationException e) {
+			String msg = "Error in updating the workflow " + workflow.getName()
+					+ ".";
+			log.error(msg, e);
+			WorkflowCatalogException exception = new WorkflowCatalogException(msg + " More info : " + e.getMessage());
+			throw exception;
+		}
+	}
+
+	@Override
+	public String getWorkflowTemplateId(String workflowName)
+			throws WorkflowCatalogException {
+		try {
+			if (getAiravataAPI().getWorkflowManager().isWorkflowExists(
+					workflowName)) {
+				return workflowName;
+			}
+			WorkflowCatalogException airavataClientException = new WorkflowCatalogException("No worklfow exists with the name "
+							+ workflowName);
+			throw airavataClientException;
+		} catch (AiravataAPIInvocationException e) {
+			String msg = "Error in retrieving the workflow template id for "
+					+ workflowName + ".";
+			log.error(msg, e);
+			WorkflowCatalogException exception = new WorkflowCatalogException(msg + " More info : " + e.getMessage());
+			throw exception;
+		}
+	}
+
+	@Override
+	public boolean isWorkflowExistWithName(String workflowName)
+			throws WorkflowCatalogException {
+		try {
+			return getAiravataAPI().getWorkflowManager().isWorkflowExists(
+					workflowName);
+		} catch (AiravataAPIInvocationException e) {
+			String msg = "Error in veriying the workflow for workflow name "
+					+ workflowName + ".";
+			log.error(msg, e);
+			WorkflowCatalogException exception = new WorkflowCatalogException(msg + " More info : " + e.getMessage());
+			throw exception;
+		}
+	}
+
+	private String getAiravataUserName() throws ApplicationSettingsException {
+		return ServerSettings.getDefaultUserGateway();
+	}
+
+	private String getGatewayName() throws ApplicationSettingsException {
+		return ServerSettings.getDefaultUser();
+	}
+
+	private AiravataAPI getAiravataAPI() {
+		if (airavataAPI == null) {
+			try {
+				airavataAPI = AiravataAPIFactory.getAPI(getGatewayName(),
+						getAiravataUserName());
+			} catch (Exception e) {
+				log.error("Unable to create Airavata API", e);
+			}
+		}
+		return airavataAPI;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedExecutable.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedExecutable.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedExecutable.java
new file mode 100644
index 0000000..060ef55
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedExecutable.java
@@ -0,0 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.workflow.engine.concurrent;
+
+/**
+ * Intended for jobs that are runnable; Way of determining
+ * whether a given job is ready to be executed
+ *
+ * @author Chathura Herath
+ */
+public interface PredicatedExecutable extends Runnable{
+
+	public boolean isReady();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedTaskRunner.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedTaskRunner.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedTaskRunner.java
new file mode 100644
index 0000000..89557ab
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/concurrent/PredicatedTaskRunner.java
@@ -0,0 +1,153 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.workflow.engine.concurrent;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * Used to run jobs that need to be started after a predicate is
+ *
+ * @author Chathura Herath
+ */
+public class PredicatedTaskRunner {
+
+	protected volatile ConcurrentLinkedQueue<PredicatedExecutable> jobQueue = new ConcurrentLinkedQueue<PredicatedExecutable>();
+
+	protected ExecutorService threadPool;
+
+	protected volatile boolean stop = false;
+
+	public PredicatedTaskRunner(int numberOfThreads) {
+		this.threadPool = Executors.newFixedThreadPool(numberOfThreads);
+		addIdleTask();
+		startCheckThread();
+
+	}
+
+	private void addIdleTask() {
+		PredicatedExecutable sleepTask = new PredicatedExecutable() {
+
+			@Override
+			public void run() {
+				synchronized (jobQueue) {
+					if (jobQueue.size() == 1) {
+						try {
+							jobQueue.wait();
+						} catch (InterruptedException e) {
+							Thread.currentThread().interrupt();
+						}
+					} else if (allTasksAreWaiting(jobQueue)) {
+						try {
+							Thread.sleep(50);
+						} catch (InterruptedException e) {
+							Thread.currentThread().interrupt();
+						}
+					}
+				}
+
+			}
+
+			private boolean allTasksAreWaiting(
+					ConcurrentLinkedQueue<PredicatedExecutable> jobQueue) {
+				for (PredicatedExecutable predicatedExecutable : jobQueue) {
+					if (predicatedExecutable.isReady()) {
+						return false;
+					}
+				}
+				return true;
+
+			}
+
+			@Override
+			public boolean isReady() {
+				// TODO Auto-generated method stub
+				return true;
+			}
+		};
+
+		this.jobQueue.add(sleepTask);
+	}
+
+	private void startCheckThread() {
+		new Thread(new Runnable() {
+
+			@Override
+			public void run() {
+
+				while (!stop) {
+					try {
+
+
+						synchronized (jobQueue) {
+							while(jobQueue.size() == 0 || allTasksAreWaiting(jobQueue)){
+								jobQueue.wait(50);
+							}
+						}
+
+						PredicatedExecutable job = jobQueue.remove();
+						if (job.isReady()) {
+							// remove from front and execute and you are done
+							threadPool.execute(job);
+						} else {
+							// add to end if not ready to run
+							jobQueue.add(job);
+						}
+
+
+
+					} catch (Throwable e) {
+						// we go on no matter what
+						e.printStackTrace();
+					}
+				}
+
+			}
+		}).start();
+	}
+
+	private  boolean allTasksAreWaiting(
+			ConcurrentLinkedQueue<PredicatedExecutable> jobQueue) {
+		for (PredicatedExecutable predicatedExecutable : jobQueue) {
+			if (predicatedExecutable.isReady()) {
+				return false;
+			}
+		}
+		return true;
+
+	}
+
+	public void scedule(PredicatedExecutable job) {
+
+		synchronized (jobQueue) {
+			this.jobQueue.add(job);
+			this.jobQueue.notifyAll();
+		}
+
+	}
+
+	public void shutDown() {
+		this.threadPool.shutdown();
+		this.stop = true;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/AmazonCredential.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/AmazonCredential.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/AmazonCredential.java
new file mode 100644
index 0000000..62b5452
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/AmazonCredential.java
@@ -0,0 +1,79 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.workflow.engine.core.amazon;
+
+public class AmazonCredential {
+    private static AmazonCredential instance;
+    private String awsAccesskey;
+    private String awsSecretAccessKey;
+
+    private AmazonCredential() {
+        this.awsAccesskey = "";
+        this.awsSecretAccessKey = "";
+    }
+
+    /**
+     * 
+     * @return AmazonCredential
+     */
+    public static AmazonCredential getInstance() {
+        if (instance == null) {
+            instance = new AmazonCredential();
+        }
+        return instance;
+    }
+
+    /**
+     * 
+     * @param accesskey
+     */
+    public void setAwsAccessKeyId(String accesskey) {
+        this.awsAccesskey = accesskey;
+    }
+
+    /**
+     * 
+     * @param secretAccessKey
+     */
+    public void setAwsSecretAccessKey(String secretAccessKey) {
+        this.awsSecretAccessKey = secretAccessKey;
+    }
+
+    /**
+     * 
+     * @param accesskey
+     * @return
+     */
+    public String getAwsAccessKeyId() {
+        return this.awsAccesskey;
+    }
+
+    /**
+     * 
+     * @param secretAccessKey
+     * @return
+     */
+    public String getAwsSecretAccessKey() {
+        return this.awsSecretAccessKey;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/EC2InstanceResult.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/EC2InstanceResult.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/EC2InstanceResult.java
new file mode 100644
index 0000000..dc838f5
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/amazon/EC2InstanceResult.java
@@ -0,0 +1,95 @@
+package org.apache.airavata.workflow.engine.core.amazon;
+///*
+// *
+// * Licensed to the Apache Software Foundation (ASF) under one
+// * or more contributor license agreements.  See the NOTICE file
+// * distributed with this work for additional information
+// * regarding copyright ownership.  The ASF licenses this file
+// * to you under the Apache License, Version 2.0 (the
+// * "License"); you may not use this file except in compliance
+// * with the License.  You may obtain a copy of the License at
+// *
+// *   http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing,
+// * software distributed under the License is distributed on an
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// * KIND, either express or implied.  See the License for the
+// * specific language governing permissions and limitations
+// * under the License.
+// *
+// */
+//
+//package org.apache.airavata.xbaya.core.amazon;
+//
+//import org.apache.airavata.xbaya.ui.widgets.TableRenderable;
+//
+//import com.amazonaws.services.ec2.model.Instance;
+//
+//public class EC2InstanceResult implements TableRenderable {
+//
+//    private static String[] columnName = { "Instance", "AMI ID", "Root Device", "Type", "Status", "Key Pair Name",
+//            "Monitoring", "Virtualization", "Placement Group" };
+//
+//    private Instance instance;
+//
+//    /**
+//     * 
+//     * Constructs a EC2InstancesResult.
+//     * 
+//     * @param ins
+//     */
+//    public EC2InstanceResult(Instance ins) {
+//        this.instance = ins;
+//    }
+//
+//    public Instance getInstance() {
+//        return this.instance;
+//    }
+//
+//    /**
+//     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnCount()
+//     */
+//    @Override
+//    public int getColumnCount() {
+//        return 8;
+//    }
+//
+//    /**
+//     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnTitle(int)
+//     */
+//    @Override
+//    public String getColumnTitle(int index) {
+//        return columnName[index];
+//    }
+//
+//    /**
+//     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getValue(int)
+//     */
+//    @Override
+//    public Object getValue(int index) {
+//        switch (index) {
+//        case 0:
+//            return this.instance.getInstanceId();
+//        case 1:
+//            return this.instance.getImageId();
+//        case 2:
+//            return this.instance.getRootDeviceType();
+//        case 3:
+//            return this.instance.getInstanceType();
+//        case 4:
+//            return this.instance.getState().getName();
+//        case 5:
+//            return this.instance.getKeyName();
+//        case 6:
+//            return this.instance.getMonitoring().getState();
+//        case 7:
+//            return this.instance.getVirtualizationType();
+//        case 8:
+//            return this.instance.getPlacement().getGroupName();
+//        default:
+//            return null;
+//        }
+//    }
+//
+//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/generators/XmlBeansFiler.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/generators/XmlBeansFiler.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/generators/XmlBeansFiler.java
new file mode 100644
index 0000000..e78adcf
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/generators/XmlBeansFiler.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.workflow.engine.core.generators;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.LinkedList;
+import java.util.List;
+
+public class XmlBeansFiler /* implements Filer */{
+
+    private String path;
+
+    private List<File> javaFilePaths = new LinkedList<File>();
+
+    /**
+     * Constructs a XmlBeansFiler.
+     * 
+     * @param file
+     */
+    public XmlBeansFiler(String path) {
+        this.path = path + "/generated";
+    }
+
+    /**
+     * @see org.apache.xmlbeans.Filer#createBinaryFile(java.lang.String)
+     */
+    public OutputStream createBinaryFile(String name) throws IOException {
+        name = name.replace('.', File.separatorChar);
+        String binPath = this.path + File.separatorChar + name;
+        File srcFile = new File(binPath);
+        srcFile.getParentFile().mkdirs();
+        return new FileOutputStream(new File(binPath));
+    }
+
+    /**
+     * @see org.apache.xmlbeans.Filer#createSourceFile(java.lang.String)
+     */
+    public Writer createSourceFile(String name) throws IOException {
+        name = name.replace('.', File.separatorChar);
+        String srcPath = this.path + File.separatorChar + name + ".java";
+        File srcFile = new File(srcPath);
+        srcFile.getParentFile().mkdirs();
+        javaFilePaths.add(new File(srcFile.getCanonicalPath()));
+        return new FileWriter(srcFile);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/workflow/ParameterListModel.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/workflow/ParameterListModel.java b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/workflow/ParameterListModel.java
new file mode 100644
index 0000000..b9ae5b6
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/java/org/apache/airavata/workflow/engine/core/workflow/ParameterListModel.java
@@ -0,0 +1,88 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.workflow.engine.core.workflow;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.swing.AbstractListModel;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.system.ParameterNode;
+
+public class ParameterListModel extends AbstractListModel {
+
+    private List<? extends ParameterNode> parameterNodes;
+
+    /**
+     * Constructs a ParameterListModel.
+     * 
+     * @param parameterNodes
+     * @param nodes
+     */
+    public ParameterListModel(List<? extends ParameterNode> parameterNodes) {
+        this.parameterNodes = parameterNodes;
+    }
+
+    /**
+     * @see javax.swing.ListModel#getElementAt(int)
+     */
+    public Object getElementAt(int index) {
+        return this.parameterNodes.get(index).getName();
+    }
+
+    /**
+     * @see javax.swing.ListModel#getSize()
+     */
+    public int getSize() {
+        return this.parameterNodes.size();
+    }
+
+    /**
+     * Moves the node at the index up.
+     * 
+     * @param index
+     */
+    public void up(int index) {
+        if (index < 1 || index >= this.parameterNodes.size()) {
+            throw new WorkflowRuntimeException("Illegal index: " + index);
+        }
+        swap(index - 1, index);
+    }
+
+    /**
+     * Moves the node at the index down.
+     * 
+     * @param index
+     */
+    public void down(int index) {
+        if (index < 0 || index >= this.parameterNodes.size() - 1) {
+            throw new WorkflowRuntimeException("Illegal index: " + index);
+        }
+        swap(index, index + 1);
+    }
+
+    private void swap(int index0, int index1) {
+        Collections.swap(this.parameterNodes, index0, index1);
+        fireContentsChanged(this, index0, index1);
+    }
+}
\ No newline at end of file


Mime
View raw message