String businessKeyExpression = inElement.attribute("businessKey");
if ((source != null || sourceExpression != null) && target == null) {
addError("Missing attribute 'target' when attribute source or sourceExpression is set", inElement);
}
else if (sourceExpression != null) {
Expression expression = expressionManager.createExpression(sourceExpression.trim());
callActivityBehaviour.addDataInputAssociation(new DataAssociation(expression, target));
} else if (variables != null && ("all").equals(variables)) {
callActivityBehaviour.addDataInputAssociation(new DataAssociation(variables));
} else if (businessKeyExpression != null) {
Expression expression = expressionManager.createExpression(businessKeyExpression.trim());
callActivityBehaviour.addDataInputAssociation(new DataAssociation(expression));
} else {
callActivityBehaviour.addDataInputAssociation(new DataAssociation(source, target));
}
}
// output data elements
for (Element outElement : extensionsElement.elementsNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "out")) {
String source = outElement.attribute("source");
String sourceExpression = outElement.attribute("sourceExpression");
String target = outElement.attribute("target");
String variables = outElement.attribute("variables");
if ((source != null || sourceExpression != null) && target == null) {
addError("Missing attribute 'target' when attribute source or sourceExpression is set", outElement);
}
else if (sourceExpression != null) {
Expression expression = expressionManager.createExpression(sourceExpression.trim());
callActivityBehaviour.addDataOutputAssociation(new DataAssociation(expression, target));
} else if (variables != null && ("all").equals(variables)) {
callActivityBehaviour.addDataOutputAssociation(new DataAssociation(variables));
} else {
callActivityBehaviour.addDataOutputAssociation(new DataAssociation(source, target));