Commit 39ee8c0f authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent 7cf6ed5b
......@@ -201,21 +201,27 @@ class JFlowServer (object):
@cherrypy.expose
@jsonify
def run_workflow(self, **kwargs):
try:
kwargs_modified = {}
for key in kwargs.keys():
parts = key.split(JFlowServer.MULTIPLE_TYPE_SPLITER)
if len(parts) == 1:
kwargs_modified[key] = kwargs[key]
elif len(parts) == 2:
if kwargs_modified.has_key(parts[0]):
kwargs_modified[parts[0]].append((parts[1], kwargs[key]))
else:
kwargs_modified[parts[0]] = [(parts[1], kwargs[key])]
workflow = self.wfmanager.run_workflow(kwargs_modified["workflow_class"], kwargs_modified)
return { "status" : 0, "content" : self.jsonify_workflow_status(workflow, True) }
except Exception as err:
return { "status" : 1, "content" : str(err) }
try:
kwargs_modified = {}
for key in kwargs.keys():
parts = key.split(JFlowServer.MULTIPLE_TYPE_SPLITER)
# if this is a classic Parameter
if len(parts) == 1:
kwargs_modified[key] = kwargs[key]
# if this is a MultiParameter
elif len(parts) == 2:
if kwargs_modified.has_key(parts[0]):
kwargs_modified[parts[0]].append((parts[1], kwargs[key]))
else:
kwargs_modified[parts[0]] = [(parts[1], kwargs[key])]
# if this is a MultiParameterList
# TODO: du cote interface faire qq chose du genre: key.sub_key.1 ... donc si len == 3
# l'objectif etant d'avoir une structure de type: [[(sub_key1: val), (sub_key2: val)], [(sub_key1: val2), (sub_key2: val2)]]
workflow = self.wfmanager.run_workflow(kwargs_modified["workflow_class"], kwargs_modified)
return { "status" : 0, "content" : self.jsonify_workflow_status(workflow, True) }
except Exception as err:
return { "status" : 1, "content" : str(err) }
@cherrypy.expose
@jsonify
......
Supports Markdown
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