public static BPELBooleanExpression createBooleanExpressionFromStartAndFinalCounterValue(final ForEach forEach, final BPELProcess process, final Logger logger) throws XPathExpressionException { final BPELBooleanExpression res = new BPELBooleanExpressionImpl(new TExpression(), forEach); String condition = ""; condition = forEach.getStartCounterValue().getContent() + " <= " + "$" + forEach.getCounterName() + " and " + "$" + forEach.getCounterName() + " <= " + forEach.getFinalCounterValue().getContent(); res.setContent(condition); if(logger != null) { res.setLog(logger); } return res; }
"topScope4foarEach_" + forEach_.getName() + "_" + UUID.randomUUID(), scope); final Scope topScope = (Scope) topScopeNode.getComponent() .createElement(); counter.setQName(new QName(defaultSchema.getTargetNamespace(), forEach_.getCounterName())); counter.setType(SchemaFactory.getDefaultSchema().getTypeInt()); defaultSchema.addElement(counter); copyAI.setTo(toAI); fromAI.getContent().add( forEach_.getStartCounterValue().getContent()); fromAI .setExpressionLanguage("urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"); toAI.getContent().add("$" + forEach_.getCounterName()); toAI .setExpressionLanguage("urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"); if (forEach_.getScope().getName() == null) { forEach_.getScope().setName( "underScopeInForEach_" + forEach_.getName() + "_" + UUID.randomUUID()); .getScope(), bpelprocess); } else { throw new CoreException("Impossible to generate activity: " + forEach_.getScope());
public static BPELVariable findVariableRecursively(final QName name, final BPELElement parent) { BPELVariable res = null; if((name != null) && (parent != null)) { if(parent instanceof BPELProcess) { res = ((BPELProcess)parent).findVariable(name); } else if(parent instanceof Scope) { res = ((Scope)parent).findVariable(name); } else if(parent instanceof ForEach) { final ForEach forEach = (ForEach)parent; if(forEach.getCounterName().equals(name.getLocalPart())) { final TVariable tvar = new TVariable(); tvar.setName(name.getLocalPart()); tvar.setType(DefaultSchemaImpl.getInstance().getTypeInt().getQName()); final TVariables tvars = new TVariables(); tvars.getVariable().add(tvar); final BPELVariable<Integer> var = new BPELIntVariableImpl(tvar, tvars, parent); res = var; } } if(res == null) { res = ScopeImpl.findVariableRecursively(name, (BPELElement) ((AbstractSchemaElementImpl)parent).getParent()); } } return res; }
res.addAll(findActivityRecursively(clazz, fe.getScope().getActivity()));