private void addDefaultAsssignmentExpressions(IDataAssociationBean dab) { if(dab.getAssignements().isEmpty()) return; IAssignmentBean a = dab.getAssignements().get(0); if(a.getFrom()==null || a.getFrom().getContent()==null || a.getFrom().getContent().isEmpty()) { IExpressionBean fromExp = new ExpressionBean(); String fromExpContent = "$"+dab.getSources().get(0).getId(); fromExp.setContent(fromExpContent); a.setFrom(fromExp); } if(a.getTo()==null || a.getTo().getContent()==null || a.getTo().getContent().isEmpty()) { IExpressionBean toExp = new ExpressionBean(); String toExpContent = "$"+dab.getTarget().getId(); toExp.setContent(toExpContent); a.setTo(toExp); } }
@Override public void visitDataInputAssociation(IDataAssociationBean diaBean, WithDataInputAssociationBean owner){ DataInputAssociation dia = newInstance(DataInputAssociation.class); setDocumentationAndExtensions(dia, diaBean); dia.setId(diaBean.getId()); if(diaBean.getTarget()!=null){ dataAssociationTargets.put(dia, diaBean.getTarget()); } if(diaBean.getSources()!=null){ dataAssociationSources.put(dia, diaBean.getSources()); } for(IAssignmentBean assignementBean : diaBean.getAssignements()){ Assignment assignement = newInstance(Assignment.class); setDocumentationAndExtensions(assignement, assignementBean); assignement.setId(assignementBean.getId()); buildExpression(assignement, assignementBean); dia.addAssignment(assignement); } if(diaBean.getTransformation()!=null){ dia.setTransformation(buildExpression(diaBean.getTransformation().getContent(), diaBean.getTransformation().getId())); } currentDataInputAssociationOwner.addDataInputAssociation(dia); }
@Override public void visitDataOutputAssociation(IDataAssociationBean doaBean, WithDataOutputAssociationBean owner){ DataOutputAssociation doa = newInstance(DataOutputAssociation.class); setDocumentationAndExtensions(doa, doaBean); doa.setId(doaBean.getId()); if(doaBean.getTarget()!=null){ dataAssociationTargets.put(doa, doaBean.getTarget()); } if(doaBean.getSources()!=null){ dataAssociationSources.put(doa, doaBean.getSources()); } for(IAssignmentBean ab : doaBean.getAssignements()){ Assignment a = newInstance(Assignment.class); setDocumentationAndExtensions(a, ab); a.setId(ab.getId()); buildExpression(a, ab); doa.addAssignment(a); } if(doaBean.getTransformation()!=null){ doa.setTransformation(buildExpression(doaBean.getTransformation().getContent(), doaBean.getTransformation().getId())); } currentDataOutputAssociationOwner.addDataOutputAssociation(doa); }