*/
public String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs, String user, String metadata) throws Exception{
try {
List<WSComponentPort> ports = getWSComponentPortInputs(workflowTemplateId);
for (WorkflowInput input : inputs) {
WSComponentPort port = getWSComponentPort(input.getName(), ports);
if (port!=null){
port.setValue(input.getValue());
}
}
List<NameValue> inputValues=new ArrayList<NameValue>();
for (WSComponentPort port : ports) {
NameValue nameValue = new NameValue();
nameValue.setName(port.getName());
if (port.getValue()==null){
nameValue.setValue(port.getDefaultValue());
}else{
nameValue.setValue(port.getValue().toString());
}
inputValues.add(nameValue);
}
workflow=getWorkflowAsString(workflowTemplateId).getString();
String topic=workflowTemplateId+"_"+UUID.randomUUID();