@Override public void bind(SequenceFlowEditorModel watchedModel, SequenceFlowBean modelToBind) { IExpressionBean exp = new ExpressionBean(); exp.setContent(watchedModel.getConditionnalExpression()); modelToBind.setExpression(exp); }
private static ExpressionBean adaptExpression(Expression exp) { ExpressionBean expb = new ExpressionBean(exp.getId()); expb.setContent(exp.getTextContent()); //setDocumentation(expb, exp); return expb; }
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()); }
public void bindSyntaxModel(IModelElement diagramElementSyntaxModel, IEditorModel editorModel, IDiagramElement diagramElement) { SequenceFlowBean bean = (SequenceFlowBean) diagramElementSyntaxModel; SequenceFlowEditorModel eModel = (SequenceFlowEditorModel) editorModel; bean.setName(eModel.getName()); bean.setDocumentation(eModel.getDocumentation()); if (eModel.getConditionnalExpression()!=null){ ExpressionBean exp = new ExpressionBean(IdGenerator.createUniqueId()); exp.setContent(eModel.getConditionnalExpression()); bean.setExpression(exp); } //set target and source IBPMNEdge sequenceFlowEdge = (IBPMNEdge) diagramElement; IBPMNShape source = (IBPMNShape) sequenceFlowEdge.getSource(); IBPMNShape target = (IBPMNShape) sequenceFlowEdge.getTarget(); if (source!=null){ if (source.getModelElement() instanceof IFlowElementBean) bean.setSourceNode((IFlowElementBean) source.getModelElement()); } if (target!=null){ if (target.getModelElement() instanceof IFlowElementBean) bean.setTargetNode((IFlowElementBean) target.getModelElement()); } }
sf3.setSourceNode(gateway); sf3.setTargetNode(task3); ExpressionBean exp = new ExpressionBean(createUniqueId()); exp.setContent("Real Alert"); sf3.setExpression(exp); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); exp2.setContent("Unimportant Alert"); sf4.setExpression(exp2);
sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean expsf4 = new ExpressionBean(createUniqueId()); expsf4.setContent("Initial idea accepted"); sf4.setExpression(expsf4); sf5.setTargetNode(task5); sf5.setName("Comments"); ExpressionBean expsf5 = new ExpressionBean(createUniqueId()); expsf5.setContent("Initial idea rejected"); sf5.setExpression(expsf5);
ExpressionBean exp = new ExpressionBean(createUniqueId()); exp.setContent("Mistakes Exists"); sf3.setExpression(exp); sf4.setSourceNode(gateway); sf4.setTargetNode(task4); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); exp2.setContent("No Mistakes"); sf4.setExpression(exp2);
sf7.setSourceNode(gateway); sf7.setTargetNode(task6); ExpressionBean expsf7 = new ExpressionBean(createUniqueId()); expsf7.setContent("Initial idea accepted"); sf7.setExpression(expsf7); sf8.setSourceNode(gateway); sf8.setTargetNode(task7); ExpressionBean expsf8 = new ExpressionBean(createUniqueId()); expsf8.setContent("Initial idea rejected"); sf8.setExpression(expsf8);
sf6.setSourceNode(gateway); sf6.setTargetNode(task); ExpressionBean exp = new ExpressionBean(createUniqueId()); exp.setContent("Alert confirmed"); sf6.setExpression(exp); sf7.setSourceNode(gateway); sf7.setTargetNode(task5); ExpressionBean exp2 = new ExpressionBean(createUniqueId()); exp2.setContent("Alert cancelled"); sf7.setExpression(exp2);
ExpressionBean expSF4 = new ExpressionBean(IdGenerator.createUniqueId()); expSF4.setContent("Rejected"); sf4.setExpression(expSF4); ExpressionBean expSF5 = new ExpressionBean(IdGenerator.createUniqueId()); expSF5.setContent("Approved"); sf5.setExpression(expSF5);