{
List<String> errors = new ArrayList<String>();
if(! consistent(errors))
throw new InconsistentWorkflowException(errors);
for(List<Object> reference : references)
{
String moduleName = (String) reference.get(0),
inputName = (String) reference.get(1),
description = (String) reference.get(2),
refModuleName = (String) reference.get(3),
refOutputName = (String) reference.get(4);
DataType type = (DataType) reference.get(5);
boolean print = (Boolean) reference.get(6);
ModuleImpl module = workflow.modules.get(moduleName),
refModule = workflow.modules.get(refModuleName);
Output refOutput = refModule.output(refOutputName);
Domain inputDomain = module.domain();
DataType outputType = refOutput.dataType();
module.addRefInput(inputName, description, refOutput, type, false, print);
if(inputDomain.typeMatches(refOutput, module.input(inputName))){
// Single reference input case
((ReferenceInput) module.input(inputName)).setMultiValue(false);
} else
if(isList(outputType)){
((ReferenceInput) module.input(inputName)).setMultiValue(true);
} else
throw new InconsistentWorkflowException("Input type of "+moduleName + "."+inputName+" ("+module.input(inputName).dataType()+") and output type "+refModuleName+"."+refOutputName+" ("+outputType+") does not match ");
}
for(List<Object> multiRef : multiReferences){
String moduleName = (String) multiRef.get(0),