Package org.apache.ode.bpel.compiler.api

Examples of org.apache.ode.bpel.compiler.api.CompilationException


                gen.setContext(this);
                return gen;
            }
        }

        throw new CompilationException(__cmsgs.errUnknownActivity(actClass.getName()).setSource(source));
    }
View Full Code Here


    }

    private ExpressionCompiler findExpLangCompiler(String expLang) {
        ExpressionCompiler compiler = _expLanguageCompilers.get(expLang);
        if (compiler == null) {
            throw new CompilationException(__cmsgs.errUnknownExpressionLanguage(expLang));
        }
        return compiler;
    }
View Full Code Here

        OExtVar oextvar = new OExtVar(_oprocess);
        oextvar.externalVariableId = src.getExternalId();
        oextvar.debugInfo = createDebugInfo(src, null);

        if (src.getExternalId() == null)
          throw new CompilationException(__cmsgs.errMustSpecifyExternalVariableId(src.getName()));
         
        if (src.getRelated() == null)
          throw new CompilationException(__cmsgs.errMustSpecifyRelatedVariable(src.getName()));
        oextvar.related = resolveVariable(src.getRelated());
       
        return oextvar;
    }
View Full Code Here


    public class GetVariableProperty implements XPathFunction {
        public Object evaluate(List params) throws XPathFunctionException {
            if (params.size() != 2) {
                throw new CompilationException(
                        __msgs.errInvalidNumberOfArguments(Constants.EXT_FUNCTION_GETVARIABLEPROPRTY));
            }
            String varName = (String) params.get(0);
            OScope.Variable v = _cctx.resolveVariable(varName);
            _out.vars.put(varName, v);

            String propName = (String) params.get(1);
            QName qname = _nsContext.derefQName(propName);

            if (qname == null)
                throw new CompilationException(
                        __msgs.errInvalidQName(propName));

            OProcess.OProperty property = _cctx.resolveProperty(qname);
            // Make sure we can...
            _cctx.resolvePropertyAlias(v, qname);
View Full Code Here

            ocopy.keepSrcElementName = scopy.isKeepSrcElement();
            ocopy.debugInfo = new DebugInfo(_context.getSourceLocation(), scopy.getLineNo(),
                    source.getExtensibilityElements());
            try {
                if (scopy.getFrom() == null)
                    throw new CompilationException(__cmsgs.errMissingFromSpec().setSource(scopy));
                ocopy.from = compileFrom(scopy.getFrom());
                if (scopy.getTo() == null)
                    throw new CompilationException(__cmsgs.errMissingToSpec().setSource(scopy));
                ocopy.to = compileTo(scopy.getTo());

                verifyCopy(ocopy);
                oassign.copy.add(ocopy);
View Full Code Here

            String rvar = ((OAssign.VariableRef) ocopy.from).variable.name;
            QName tlvalue = ((OMessageVarType) ((OAssign.VariableRef) ocopy.to).variable.type).messageType;
            QName trvalue = ((OMessageVarType) ((OAssign.VariableRef) ocopy.from).variable.type).messageType;

            if (!tlvalue.equals(trvalue))
                throw new CompilationException(__cmsgs.errMismatchedMessageAssignment(lvar, tlvalue, rvar, trvalue));

        }

        // If Message->Non-Message copy
        else if (ocopy.from instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.from).isMessageRef()
                && (!(ocopy.to instanceof OAssign.VariableRef) || !((OAssign.VariableRef) ocopy.to).isMessageRef())) {
            String rval = ((OAssign.VariableRef) ocopy.from).variable.name;
            throw new CompilationException(__cmsgs.errCopyFromMessageToNonMessage(rval));

        }

        // If Non-Message->Message copy
        else if (ocopy.to instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.to).isMessageRef()
                && (!(ocopy.from instanceof OAssign.VariableRef) || !((OAssign.VariableRef) ocopy.from).isMessageRef())) {

            String lval = ((OAssign.VariableRef) ocopy.to).variable.name;
            throw new CompilationException(__cmsgs.errCopyToMessageFromNonMessage(lval));
        }

        // If *->Partner Link copy
        else if (ocopy.to instanceof OAssign.PartnerLinkRef
                && !((OAssign.PartnerLinkRef) ocopy.to).partnerLink.hasPartnerRole()) {
            String lval = ((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName();
            throw new CompilationException(__cmsgs.errCopyToUndeclaredPartnerRole(lval));
        }

        // If Partner Link->* copy
        else if (ocopy.from instanceof OAssign.PartnerLinkRef) {
            if (((OAssign.PartnerLinkRef) ocopy.from).isMyEndpointReference
                    && !((OAssign.PartnerLinkRef) ocopy.from).partnerLink.hasMyRole()) {
                String lval = ((OAssign.PartnerLinkRef) ocopy.from).partnerLink.getName();
                throw new CompilationException(__cmsgs.errCopyFromUndeclaredPartnerRole(lval, "myRole"));
            }
            if (!((OAssign.PartnerLinkRef) ocopy.from).isMyEndpointReference
                    && !((OAssign.PartnerLinkRef) ocopy.from).partnerLink.hasPartnerRole()) {
                String lval = ((OAssign.PartnerLinkRef) ocopy.from).partnerLink.getName();
                throw new CompilationException(__cmsgs.errCopyFromUndeclaredPartnerRole(lval, "partnerRole"));
            }
        }

        __log.debug("Copy verified OK: " + ocopy);
    }
View Full Code Here

                return plref;
            } else if (from.getAsExpression() != null) {
                return new OAssign.Expression(_context.getOProcess(), _context.compileExpr(from.getAsExpression()));
            }

            throw new CompilationException(__cmsgs.errUnkownFromSpec().setSource(from));

        } catch (CompilationException ce) {
            if (ce.getCompilationMessage().source == null)
                ce.getCompilationMessage().source = from;
            throw ce;
View Full Code Here

            } else if (to.getAsExpression() != null){
                return new OAssign.LValueExpression(_context.getOProcess(), _context
                        .compileLValueExpr(to.getAsExpression()));
            }

            throw new CompilationException(__cmsgs.errUnknownToSpec().setSource(to));
        } catch (CompilationException ce) {
            if (ce.getCompilationMessage().source == null)
                ce.getCompilationMessage().source = to;
            throw ce;
        }
View Full Code Here

        if (__log.isDebugEnabled()) __log.debug("Adding the forEach counter variable to inner scope.");
        Scope s = forEach.getChild().getScope();
        // Checking if a variable using the same name as our counter is already defined.
        // The spec requires a static analysis error to be thrown in that case.
        if (s.getVariableDecl(forEach.getCounterName()) != null)
            throw new CompilationException(__cmsgs.errForEachAndScopeVariableRedundant(forEach.getCounterName()).setSource(src));

        OXsdTypeVarType counterVarType = new OXsdTypeVarType(_context.getOProcess());
        counterVarType.xsdType = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "unsignedInt");
        OScope.Variable countervar = new OScope.Variable(_context.getOProcess(),counterVarType);
       
View Full Code Here

                // The assumption here is that if the definition is not set on the
                // import object then there was some problem parsing the thing,
                // although it would have been nice to actually get the parse
                // error.
                if (importDef == null) {
                    CompilationException ce = new CompilationException(
                            __cmsgs.errWsdlImportNotFound(im.getNamespaceURI(),
                                    im.getLocationURI()).setSource(new SourceLocationImpl(defuri)));
                    if (_ctx == null)
                        throw ce;
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.compiler.api.CompilationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.