public AbstractDataAssociation createDataInputAssociation(BpmnParse bpmnParse, DataAssociation dataAssociationElement) {
if (dataAssociationElement.getAssignments().isEmpty()) {
return new MessageImplicitDataInputAssociation(dataAssociationElement.getSourceRef(), dataAssociationElement.getTargetRef());
} else {
SimpleDataInputAssociation dataAssociation = new SimpleDataInputAssociation(
dataAssociationElement.getSourceRef(), dataAssociationElement.getTargetRef());
for (org.activiti.bpmn.model.Assignment assigmentElement : dataAssociationElement.getAssignments()) {
if (StringUtils.isNotEmpty(assigmentElement.getFrom()) && StringUtils.isNotEmpty(assigmentElement.getTo())) {
Expression from = bpmnParse.getExpressionManager().createExpression(assigmentElement.getFrom());
Expression to = bpmnParse.getExpressionManager().createExpression(assigmentElement.getTo());
Assignment assignment = new Assignment(from, to);
dataAssociation.addAssignment(assignment);
}
}
return dataAssociation;
}
}