@Override public void bind(SequenceFlowEditorModel watchedModel, SequenceFlowBean modelToBind) { IExpressionBean exp = new ExpressionBean(); exp.setContent(watchedModel.getConditionnalExpression()); modelToBind.setExpression(exp); }
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 bind(DataAssociationEditorModel watchedModel, DataAssociationBean modelToBind) { // 1 - binding of 'to' and 'from' fields of the editor model //add an assignment with the 'to' and 'from' expressions modelToBind.getAssignements().clear(); IAssignmentBean a = new AssignmentBean(); modelToBind.addAssignement(a); IExpressionBean from = new ExpressionBean(); from.setContent(watchedModel.getFrom()); a.setFrom(from); IExpressionBean to = new ExpressionBean(); to.setContent(watchedModel.getTo()); a.setTo(to); // 2 - binding of 'itemDef' property of the editor model //set targetItem and sourceItem to the editor model value // the builder will use one of them depending if the data association // is a datainputassociation or a dataoutputassociation modelToBind.setTargetItem(watchedModel.getItemDef()); modelToBind.setSourceItem(watchedModel.getItemDef()); }