private void compileGetLinkStatus(FunctionCallExpr c) throws CompilationException { List params = c.getParameters(); if (params.size() != 1) { throw new CompilationException(__msgs.errInvalidNumberOfArguments(c.getFunctionName())); } String linkName = getLiteralFromExpression((Expr)params.get(0)); OLink olink = _cctx.resolveLink(linkName); _out.links.put(linkName, olink); }
/** */ public void endFunction() { super.endFunction(); FunctionCallExpr c = (FunctionCallExpr)peekFrame() .getLast(); String prefix = c.getPrefix(); // empty string prefix should resolve to xpath namespace, NOT bpel if ((prefix == null) || "".equals(prefix)) { return; } String ns = _nsContext.getNamespaceURI(prefix); if (ns == null) { throw new CompilationException( __msgs.errUndeclaredFunctionPrefix(prefix,c.getFunctionName())); } else if (isBpelNamespace(ns)) { if (Constants.EXT_FUNCTION_GETVARIABLEDATA.equals(c.getFunctionName())) { compileGetVariableData(c); } else if (Constants.EXT_FUNCTION_GETVARIABLEPROPRTY.equals(c .getFunctionName())) { compileGetVariableProperty(c); } else if (Constants.EXT_FUNCTION_GETLINKSTATUS.equals(c.getFunctionName())) { compileGetLinkStatus(c); } else if (Constants.EXT_FUNCTION_DOXSLTRANSFORM.equals(c.getFunctionName())) { compileDoXslTransform(c); } else { throw new CompilationException(__msgs.errUnknownBpelFunction(c.getFunctionName())); } } }
/** * Compile a <code>bpws:getVariableData(...)</em> function call. Note that all arguments * to this call <em>must</em> be literal values. Therefore, we are able to "pre-compile" * all possible invocations of this call, and save ourselves the problem of compiling * query expressions at runtime. * @param c {@link FunctionCallExpr} for this invocation * @throws CompilationException */ private void compileGetVariableData(FunctionCallExpr c) throws CompilationException { List params = c.getParameters(); if (params.size() < 1 || params.size() > 3) { throw new CompilationException( __msgs.errInvalidNumberOfArguments(c.getFunctionName())); } String varname = getLiteralFromExpression((Expr)params.get(0)); String partname = params.size() > 1 ? getLiteralFromExpression((Expr)params.get(1)) : null; String locationstr = params.size() > 2 ? getLiteralFromExpression((Expr)params.get(2)) : null; OScope.Variable var = _cctx.resolveVariable(varname); OMessageVarType.Part part = partname != null ? _cctx.resolvePart(var,partname) : null; OExpression location = null; if (locationstr != null) { location = _cctx.compileExpr(locationstr,_nsContext); } _out.addGetVariableDataSig(varname, partname, locationstr, new OXPath10Expression.OSigGetVariableData(_cctx.getOProcess(),var, part,location)); }