Package org.apache.ode.bpel.common

Examples of org.apache.ode.bpel.common.FaultException


            OMessageVarType.Part part = partName == null ? null : ((OMessageVarType)variable.type).parts.get(partName);

            try{
                Node variableNode = _ectx.readVariable(variable, part);
                if (variableNode == null)
                    throw new FaultException(variable.getOwner().constants.qnSelectionFailure,
                            "Unknown variable " + variableName.getLocalPart());
                if (_ectx.narrowTypes()) {
                    if (variable.type instanceof OXsdTypeVarType && ((OXsdTypeVarType)variable.type).simple)
                        return getSimpleContent(variableNode,((OXsdTypeVarType)variable.type).xsdType);
                    if (part != null && part.type instanceof OXsdTypeVarType && ((OXsdTypeVarType)part.type).simple)
View Full Code Here


    }

    public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
        List retVal = evaluate(cexp, ctx);
        if (retVal.size() == 0)
            throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, "No results for expression: " + cexp);
        if (retVal.size() > 1)
            throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, "Multiple results for expression: " + cexp);
        return (Node) retVal.get(0);
    }
View Full Code Here

            try{
                Node variableNode = _xpathEvalCtx.readVariable(variable, part);
                if (variableNode == null)
                    throw new WrappedFaultException.JaxenUnresolvableException(
                            new FaultException(variable.getOwner().constants.qnSelectionFailure,
                                    "Unknown variable " + localName));
                OVarType type = variable.type;
                if (type instanceof OMessageVarType) {
                    OMessageVarType.Part typePart = ((OMessageVarType)type).parts.get(partName);
                    if (typePart == null) {
                        throw new WrappedFaultException.JaxenUnresolvableException(
                                new FaultException(variable.getOwner().constants.qnSelectionFailure,
                                        "Unknown part " + partName + " for variable " + localName));
                    }
                    type = typePart.type;
                }
View Full Code Here

        try {
            return ISO8601DateParser.parseCal(literal);
        } catch (Exception ex) {
            String errmsg = "Invalid date: " + literal;
            __log.error(errmsg, ex);
            throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,errmsg);
        }
    }
View Full Code Here

        try {
            return new Duration(literal);
        } catch (Exception ex) {
            String errmsg = "Invalid duration: " + literal;
            __log.error(errmsg, ex);
            throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,errmsg);
        }
    }
View Full Code Here

            Element varElmt;
            try {
                if (args.get(1) instanceof List) {
                    List elmts = (List)args.get(1);
                    if (elmts.size() != 1) throw new WrappedFaultException.JaxenFunctionException(
                            new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
                                    "Second parameter of the bpws:doXslTransform function MUST point to a single " +
                                            "element node."));
                    varElmt = (Element) elmts.get(0);
                } else {
                    if (args.get(1) instanceof NodeWrapper)
                        varElmt = (Element) ((NodeWrapper)args.get(1)).getUnderlyingNode();
                    else varElmt = (Element) args.get(1);
                   
//                    varElmt = (Element) args.get(1);
                }
            } catch (ClassCastException e) {
                throw new WrappedFaultException.JaxenFunctionException(
                        new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
                                "Second parameter of the bpws:doXslTransform function MUST point to a single " +
                                        "element node."));
            }

            URI xslUri;
            try {
                xslUri = new URI((String) args.get(0));
            } catch (URISyntaxException use) {
                // Shouldn't happen, checked at compilation time
                throw new FunctionCallException("First parameter of the bpws:doXslTransform isn't a valid URI!", use);
            }
            OXslSheet xslSheet = _oxpath.xslSheets.get(xslUri);
            // Shouldn't happen, checked at compilation time
            if (xslSheet == null) throw new FunctionCallException("Couldn't find the XSL sheet " + args.get(0)
                    + ", process compilation or deployment was probably incomplete!");

            if (!(varElmt instanceof Element)) {
                throw new WrappedFaultException.JaxenFunctionException(
                        new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
                                "Second parameter of the bpws:doXslTransform function MUST point to a single " +
                                        "element node."));
            }

            HashMap<QName, Object> parametersMap = null;
            if (args.size() > 2) {
                parametersMap = new HashMap<QName, Object>();
                for (int idx = 2; idx < args.size(); idx+=2) {
                    QName keyQName = _oxpath.namespaceCtx.derefQName((String) args.get(idx));
                    parametersMap.put(keyQName, args.get(idx + 1));
                }
            }

            Document varDoc = DOMUtils.newDocument();
            varDoc.appendChild(varDoc.importNode(varElmt, true));

            DOMSource source = new DOMSource(varDoc);
            // Using a StreamResult as a DOMResult doesn't behaves properly when the result
            // of the transformation is just a string.
            StringWriter writerResult = new StringWriter();
            StreamResult result = new StreamResult(writerResult);
            XslRuntimeUriResolver resolver = new XslRuntimeUriResolver(_oxpath);
            XslTransformHandler.getInstance().cacheXSLSheet(xslUri, xslSheet.sheetBody, resolver);
            try {
                XslTransformHandler.getInstance().transform(xslUri, source, result, parametersMap, resolver);
            } catch (Exception e) {
                throw new WrappedFaultException.JaxenFunctionException(
                        new FaultException(_oxpath.getOwner().constants.qnSubLanguageExecutionFault,
                                e.toString()));
            }
            writerResult.flush();

            String output = writerResult.toString();
View Full Code Here

                    if (!getBpelRuntimeContext().isCorrelationInitialized(
                            _scopeFrame.resolve(onMessage.matchCorrelation))) {
                        // the following should really test if this is a "join"
                        // type correlation...
                        if (!_opick.createInstanceFlag)
                            throw new FaultException(_opick.getOwner().constants.qnCorrelationViolation,
                                    "Correlation not initialized.");
                    } else {

                        key = getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(onMessage.matchCorrelation));
View Full Code Here

            correlators.add(processDao.getCorrelator(correlatorId));
        }

        int conflict = _outstandingRequests.findConflict(selectors);
        if (conflict != -1)
            throw new FaultException(_bpelProcess.getOProcess().constants.qnConflictingReceive, selectors[conflict]
                    .toString());

        _outstandingRequests.register(pickResponseChannelStr, selectors);

        // TODO - ODE-58
View Full Code Here

            if (e != null)
                epr = e.toXML().getDocumentElement();
        }

        if (epr == null) {
            throw new FaultException(_bpelProcess.getOProcess().constants.qnUninitializedPartnerRole);
        }

        return epr;
    }
View Full Code Here

    public void reply(final PartnerLinkInstance plinkInstnace, final String opName, final String mexId, Element msg,
                      QName fault) throws FaultException {
        String mexRef = _outstandingRequests.release(plinkInstnace, opName, mexId);

        if (mexRef == null) {
            throw new FaultException(_bpelProcess.getOProcess().constants.qnMissingRequest);
        }

        // prepare event
        ProcessMessageExchangeEvent evt = new ProcessMessageExchangeEvent();
        evt.setMexId(mexId);
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.common.FaultException

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.