public Expression affect(final Scope scope, final Expression left, final Expression right) throws CoreException { Variable v = null; try { this.log.finest("affect " + right + " in " + left); final Element leftSide = null; final Element rightSide = null; if(!(left instanceof To)) { throw new BPELException("Incorrect affectation !!!"); } if(!(right instanceof From)) { throw new BPELException("Incorrect affectation !!!"); } final To to = (To)left; final From from = (From)right; if((to.getKind() == To.Kind.PARTNERLINK)||(from.getKind() == From.Kind.PARTNERLINK)) { v = this.affectPartner(scope, leftSide, rightSide, to, from); } else { v = this.affectVariable(scope, leftSide, rightSide, to, from); } } catch (final BPELException e) { throw new CoreException(e); } return v; }
public BPELAssignementExpressionImpl(final Copy copy, final BPELProcess definition) { //super(((BPELElementImpl)copy).getTag(), null, (BPELElementImpl)copy); //this.assigner = new BPELAssigner(definition); this.copy = copy; this.bpelDefinition = definition; this.left = (BPELExpression) this.copy.getTo().copypaste(); this.right = (BPELExpression) this.copy.getFrom().copypaste(); }
public void addAssign(Activity a, String assignName, String fromXPath, String toXPath) throws Exception{ Assign assign1 = new AssignImpl(new TAssign(),a); Copy c = new CopyImpl(new TCopy(), assign1); From from = new FromImpl(new TFrom(), c); from.setContent(fromXPath); from.setExpressionLanguage(URI.create("http://www.w3.org/TR/xpath20/")); To to = new ToImpl(new TTo(), c); to.setExpressionLanguage(URI.create("http://www.w3.org/TR/xpath20/")); to.setContent(toXPath); c.setFrom(from); c.setTo(to); assign1.addCopy(c); assign1.setName(assignName); if(a instanceof Sequence){ ((Sequence) a).addActivity(assign1); }else{ throw new Exception("addActivity not yet implemented for "+a.getClass().getName()+" activity"); } }
if(from.getKind() == From.Kind.LITERAL) { if(from.getLiteral().getElementContent() != null) { rightSide = (Element) from.getLiteral().getElementContent().detach(); } else if(from.getLiteral().getStringContent() != null) { rightSide = new Element("literal"); final Document doc = new Document(rightSide); rightSide.setText(from.getLiteral().getStringContent().trim()); } else if((from.getKind() == From.Kind.EXPRESSION)||(from.getKind() == From.Kind.VARIABLE_PART)) { if(from.getKind() == From.Kind.EXPRESSION) { expression = from.getContent().trim(); } else if(from.getKind() == From.Kind.VARIABLE_PART) { expression = ExpressionUtil.convertVariable2Expression(from.getVariablePart()); } else if(from.getKind() == From.Kind.VARIABLE_PART) { throw new NotImplementedException("Affectation using variable not implemented: Use affectation by expression"); } else {
if(definition.getFrom().getKind() == From.Kind.EXPRESSION) { final String value = definition.getFrom().getContent(); rightSide.setText(value); } else if(definition.getFrom().getKind() == From.Kind.LITERAL) { if(definition.getFrom().getLiteral().getElementContent() != null) { rightSide.addContent(definition.getFrom().getLiteral().getElementContent().detach()); } else if(definition.getFrom().getLiteral().getStringContent() != null) { rightSide.setText(definition.getFrom().getLiteral().getStringContent());
new TFrom(), null); from .setKind(From.Kind.VARIABLE_PROPERTY);
if(from.getKind() == From.Kind.LITERAL) { if(from.getLiteral().getElementContent() != null) { this.log.finest("litteral content = " + from.getLiteral().getElementContent()); } else { this.log.finest("litteral content = " + from.getLiteral().getStringContent()); if(from.getLiteral().getElementContent() != null) { eprFrom = this.getEpr((Element) ((Element)from.getLiteral().getElementContent().getChildren().get(0)).detach()); } else if(from.getLiteral().getStringContent() != null) { final Document doc = builder.build(new ByteArrayInputStream(from.getLiteral().getStringContent().getBytes())); root = (Element) ((Element) doc.getRootElement().getChildren().get(0)).clone(); eprFrom = this.getEpr(root); } else if((from.getKind() == From.Kind.EXPRESSION)||(from.getKind() == From.Kind.VARIABLE_PART)) { final ExpressionAnalyzer expressionAnalyzer = new ExpressionAnalyzer(""); if(from.getKind() == From.Kind.EXPRESSION) { expression = from.getContent(); } else if(from.getKind() == From.Kind.VARIABLE_PART) { expression = ExpressionUtil.convertVariable2Expression(from.getVariablePart()); } else if(from.getKind() == From.Kind.PARTNERLINK) { final PartnerLink partnerFrom = this.findPartner(scope, from.getPartnerLinkVar().getPartnerLink(), this.bpeldefinition); if(partnerFrom == null) { throw new CoreException("Impossible to find the partner");
if (definition.getFrom().getKind() == From.Kind.EXPRESSION) { final String value = definition.getFrom().getContent(); rightSide.setText(value); } else if (definition.getFrom().getKind() == From.Kind.LITERAL) { if (definition.getFrom().getLiteral().getElementContent() != null) { rightSide.addContent(definition.getFrom().getLiteral() .getElementContent().detach()); } else if (definition.getFrom().getLiteral() .getStringContent() != null) { rightSide.setText(definition.getFrom().getLiteral() .getStringContent());