Commit 974b8145 authored by Zdralovic Edim's avatar Zdralovic Edim

Saved returned yaml into corresponding object

parent 571dd2ec
......@@ -62,11 +62,6 @@ class CWLRestAPI(FlaskView):
route_base = '/' #flask_classful specific, class variable
def __init__(self):
self.baseDir = './workflows/' #for developing only
#self.testCWL = './data/ex2.cwl' #for developing only
#self.testYML = './data/ex2.yml' #for developing only
#self.mirzaCWL = '/home/cuhoni66/MIRZAG/mirzag_seed.cwl'
#self.mirzaYML = '/home/cuhoni66/MIRZAG/job.yml'
self.__WorkflowIDCounter = 0
self.__wfManager = WorkflowManager()
############################################################
#Section: Routed Methods
......@@ -107,8 +102,7 @@ class CWLRestAPI(FlaskView):
byteData = request.data
data = json.loads(byteData.decode("utf-8"))
#wf = WorkflowWrapper(data["usertoken"], self.baseDir, data["yaml"], data["cwl"], data["workflowName"])
return json.dumps(self.__wfManager.startWorkflow(data["workflowName"]))
return json.dumps(self.__wfManager.startWorkflow(data["workflowName"], data["yaml"]))
@route('/workflows', methods=['GET'])
def getAllWorkflows(self):
......@@ -220,14 +214,10 @@ class WorkflowManager:
This method recieves the incoming workflow from the API and starts it in a thread.
"""
self.workflowList.append(wf)
#wf.start()
#while not wf.workflowID:
# pass
return {"yaml":wf.yamlStream}
def startWorkflow(self, wfName):
def startWorkflow(self, wfName, yamlStream):
"""
This method recieves the incoming workflow from the API and starts it in a thread.
"""
......@@ -237,7 +227,7 @@ class WorkflowManager:
if i.workflowName == wfName:
wf = i
break
wf.yamlStream = yamlStream
wf.start()
while not wf.workflowID:
......@@ -251,7 +241,6 @@ class WorkflowManager:
If the pipeline was stopped by the user and the workflow has been edited, the workflow
has to start from scratch to actually apply these changes.
"""
#TODO: Restarting workflow, thread has to be started again (initializing new object, copying doesn't work)
wfToRestart = None
for i in self.workflowList:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment