Skip to content
Snippets Groups Projects
Commit 904c456a authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

SWS-6: workflows now start correctly with correct arguments

parent 62fbcca3
No related branches found
No related tags found
1 merge request!59SWS-6: workflows now start correctly with correct arguments
Pipeline #436 passed
......@@ -51,7 +51,7 @@ class CapabilityRestService:
def create(self):
# create a capability request for this ... request
req = self.request.json_body
request = self.request.capabilities.create_request(req["capability"])
request = self.request.capabilities.create_request(req["capability"], req["args"])
return request
@view_config(
......
......@@ -114,12 +114,15 @@ class CapabilitySequence(CapabilitySequenceIF):
class PrepareAndRunWorkflow(CapabilityStep):
def execute(self, engine: CapabilityEngineIF, execution: CapabilityExecutionIF):
workflow_name = self.step_value
workflow_args = self.step_args
parameters = execution.capability_request.parameters
# FIXME: Add support for files
files = []
if workflow_args is not None:
workflow_args = json.loads(workflow_args)
engine.submit_workflow_request(workflow_name, workflow_args, files)
if parameters is not None:
# convert to json string because json cares about single vs. double quotes.
# DO NOT TAKE THIS OUT! Python will yell at you.
parameters = json.dumps(parameters)
workflow_args = json.loads(parameters)
engine.submit_workflow_request(execution.id, workflow_name, workflow_args, files)
class AwaitQa(CapabilityStep):
......
  • Nice! this is a big help for what I'm working on.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment