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

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


        boolean previousAtomicScope = _atomicScope;
        if (src.getAtomicScope() != null) {
            boolean newValue = src.getAtomicScope().booleanValue();
            if (_atomicScope)
                throw new CompilationException(__cmsgs.errAtomicScopeNesting(newValue));
           
            oscope.atomicScope = _atomicScope = newValue;
        }
        try {
            compile(oscope, src, new Runnable() {
View Full Code Here


        if (onAlarm.getFor() != null && onAlarm.getUntil() == null) {
            oalarm.forExpr = compileExpr(onAlarm.getFor());
        } else if (onAlarm.getFor() == null && onAlarm.getUntil() != null) {
            oalarm.untilExpr = compileExpr(onAlarm.getUntil());
        } else if (onAlarm.getFor() != null && onAlarm.getUntil() != null) {
            throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm));
        } else if (onAlarm.getRepeatEvery() == null) {
            throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm));
        }

        if (onAlarm.getRepeatEvery() != null)
            oalarm.repeatExpr = compileExpr(onAlarm.getRepeatEvery());

        oalarm.activity = compile(onAlarm.getActivity());

        // Check links crossing restrictions.
        for (OLink link : oalarm.incomingLinks)
            try {
                throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm));
            } catch (CompilationException ce) {
                recoveredFromError(onAlarm, ce);
            }

        for (OLink link : oalarm.outgoingLinks)
            try {
                throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm));
            } catch (CompilationException ce) {
                recoveredFromError(onAlarm, ce);
            }

        oscope.eventHandler.onAlarms.add(oalarm);
View Full Code Here

                    oevent.variable = resolveMessageVariable(onEvent.getVariable());
                    break;
                case BPEL20_DRAFT:
                case BPEL20:
                    if (onEvent.getMessageType() == null && onEvent.getElementType() == null)
                        throw new CompilationException(__cmsgs.errVariableDeclMissingType(onEvent.getVariable())
                                .setSource(onEvent));
                    if (onEvent.getMessageType() != null && onEvent.getElementType() != null)
                        throw new CompilationException(__cmsgs.errVariableDeclInvalid(onEvent.getVariable()).setSource(
                                onEvent));

                    OVarType varType;
                    if (onEvent.getMessageType() != null)
                        varType = resolveMessageType(onEvent.getMessageType());
                    else if (onEvent.getElement() != null)
                        varType = resolveElementType(onEvent.getElementType());
                    else
                        throw new CompilationException(__cmsgs
                                .errUnrecognizedVariableDeclaration(onEvent.getVariable()));

                    oevent.variable = new OScope.Variable(_oprocess, varType);
                    oevent.variable.name = onEvent.getVariable();
                    oevent.variable.declaringScope = _structureStack.topScope();

                    oevent.addLocalVariable(oevent.variable);
                    break;
                default:
                    throw new AssertionError("Unexpected BPEL VERSION constatnt: " + _processDef.getBpelVersion());
                }

                oevent.partnerLink = resolvePartnerLink(onEvent.getPartnerLink());
                oevent.operation = resolveMyRoleOperation(oevent.partnerLink, onEvent.getOperation());
                oevent.messageExchangeId = onEvent.getMessageExchangeId();

                if (onEvent.getPortType() != null
                        && !onEvent.getPortType().equals(oevent.partnerLink.myRolePortType.getQName()))
                    throw new CompilationException(__cmsgs.errPortTypeMismatch(onEvent.getPortType(),
                            oevent.partnerLink.myRolePortType.getQName()));

                for (Correlation correlation : onEvent.getCorrelations()) {
                    OScope.CorrelationSet cset = resolveCorrelationSet(correlation.getCorrelationSet());

                    switch (correlation.getInitiate()) {
                    case UNSET:
                    case NO:
                        if (oevent.matchCorrelation != null)
                            throw new CompilationException(__cmsgs.errTODO("Matching multiple correlations sets."));
                        oevent.matchCorrelation = cset;
                        oevent.partnerLink.addCorrelationSetForOperation(oevent.operation, cset);
                        break;
                    case YES:
                        oevent.initCorrelations.add(cset);
                        break;
                    case JOIN:
                        throw new CompilationException(__cmsgs.errTODO("Rendezvous."));
                    }

                    for (OProcess.OProperty property : cset.properties) {
                        // Force resolution of alias, to make sure that we have
                        // one for this variable-property pair.
                        resolvePropertyAlias(oevent.variable, property.name);
                    }

                }

                oevent.activity = compile(onEvent.getActivity());
            }
        });

        // Check links crossing restrictions.
        for (OLink link : oevent.incomingLinks)
            try {
                throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name));
            } catch (CompilationException ce) {
                recoveredFromError(onEvent, ce);
            }

        for (OLink link : oevent.outgoingLinks)
            try {
                throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name));
            } catch (CompilationException ce) {
                recoveredFromError(onEvent, ce);
            }

        oscope.eventHandler.onMessages.add(oevent);
View Full Code Here

    private void compile(final Variable src) {
        final OScope oscope = _structureStack.topScope();

        if (src.getKind() == null)
            throw new CompilationException(__cmsgs.errVariableDeclMissingType(src.getName()).setSource(src));

        if (oscope.getLocalVariable(src.getName()) != null)
            throw new CompilationException(__cmsgs.errDuplicateVariableDecl(src.getName()).setSource(src));

        if (src.getTypeName() == null) throw new CompilationException(__cmsgs.errUnrecognizedVariableDeclaration(src.getName()));
        OVarType varType;
        switch (src.getKind()) {
        case ELEMENT:
            varType = resolveElementType(src.getTypeName());
            break;
        case MESSAGE:
            varType = resolveMessageType(src.getTypeName());
            break;
        case SCHEMA:
            varType = resolveXsdType(src.getTypeName());
            break;
        default:
            throw new CompilationException(__cmsgs.errUnrecognizedVariableDeclaration(src.getName()));
        }

        OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
        ovar.name = src.getName();
        ovar.declaringScope = oscope;
View Full Code Here

                                OScope.Variable faultVar;
                                switch (_processDef.getBpelVersion()) {
                                case BPEL11:
                                    faultVar = resolveVariable(catchSrc.getFaultVariable());
                                    if (!(faultVar.type instanceof OMessageVarType))
                                        throw new CompilationException(__cmsgs.errMessageVariableRequired(
                                                catchSrc.getFaultVariable()).setSource(catchSrc));
                                    break;
                                case BPEL20_DRAFT:
                                case BPEL20:
                                    if (catchSrc.getFaultVariableMessageType() == null
                                            && catchSrc.getFaultVariableElementType() == null)
                                        throw new CompilationException(__cmsgs.errVariableDeclMissingType(
                                                catchSrc.getFaultVariable()).setSource(catchSrc));
                                    if (catchSrc.getFaultVariableMessageType() != null
                                            && catchSrc.getFaultVariableElementType() != null)
                                        throw new CompilationException(__cmsgs.errVariableDeclMissingType(
                                                catchSrc.getFaultVariable()).setSource(catchSrc));

                                    OVarType faultVarType;
                                    if (catchSrc.getFaultVariableMessageType() != null)
                                        faultVarType = resolveMessageType(catchSrc.getFaultVariableMessageType());
                                    else if (catchSrc.getFaultVariableElementType() != null)
                                        faultVarType = resolveElementType(catchSrc.getFaultVariableElementType());
                                    else
                                        throw new CompilationException(__cmsgs
                                                .errUnrecognizedVariableDeclaration(catchSrc.getFaultVariable()));

                                    faultVar = new OScope.Variable(_oprocess, faultVarType);
                                    faultVar.name = catchSrc.getFaultVariable();
                                    faultVar.declaringScope = _structureStack.topScope();
View Full Code Here

    public OXslSheet compileXslt(String docStrUri) throws CompilationException {
        URI docUri;
        try {
            docUri = new URI(FileUtils.encodePath(docStrUri));
        } catch (URISyntaxException e) {
            throw new CompilationException(__cmsgs.errInvalidDocXsltUri(docStrUri));
        }
       
        String sheetBody = loadXsltSheet(_processURI.resolve(docUri));
        if (sheetBody == null) {
            throw new CompilationException(__cmsgs.errCantFindXslt(docStrUri));
        }

        OXslSheet oXslSheet = new OXslSheet(_oprocess);
        oXslSheet.uri = docUri;
        oXslSheet.sheetBody = sheetBody;
View Full Code Here

                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

            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

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.