private void handleException(String errMsg) throws FaultException { log.error(errMsg); throw new FaultException(BAMPublisherConstants.BAM_FAULT, errMsg); }
private void handleException(String errMsg, Throwable t) throws FaultException { log.error(errMsg, t); throw new FaultException(AnalyticsPublisherConstants.ANALYTICS_FAULT, errMsg, t); }
private void handleException(String errMsg, Throwable t) throws FaultException { log.error(errMsg, t); throw new FaultException(BAMPublisherConstants.BAM_FAULT, errMsg, t); }
private void handleException(String errMsg) throws FaultException { log.error(errMsg); throw new FaultException(AnalyticsPublisherConstants.ANALYTICS_FAULT, errMsg); }
public Object evaluate(List args) throws XPathFunctionException { if (args.size() != 1) throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getLinkStatusInvalidSource"), "Illegal Arguments")); OLink olink = _oxpath.links.get(args.get(0)); try { return _ectx.isLinkActive(olink) ? Boolean.TRUE : Boolean.FALSE; } catch (FaultException e) { throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getLinkStatusInvalidSource"), e)); } } }
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); }
public Object evaluate(List args) throws XPathFunctionException { if (args.size() != 2) { throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getVariablePropertyInvalidSource"), "Missing required arguments")); } OScope.Variable var = _oxpath.vars.get(args.get(0)); OProcess.OProperty property = _oxpath.properties.get(args.get(1)); if (__log.isDebugEnabled()) { __log.debug("function call:'bpws:getVariableProperty(" + var + "," + property + ")'"); } try { return _ectx.readMessageProperty(var, property); } catch (FaultException e) { throw new XPathFunctionException(e); } } }
@Override Node fetchVariableData(VariableInstance variable, boolean forWriting) throws FaultException { try { return super.fetchVariableData(variable, forWriting); } catch (FaultException fe) { if (forWriting) { fe = new FaultException(fe.getQName(), fe.getMessage(), new Throwable("throwUninitializedToVariable")); } throw fe; } }
/** * Evaluate expression and return a node * * @param cexp cexp * @param ctx ctx * * @return type * * @throws FaultException FaultException * @throws EvaluationException EvaluationException */ 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); }
public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException { List retVal = evaluate(cexp, ctx); if (retVal.size() == 0 || retVal.size() > 1) { StringBuffer msg = new StringBuffer((retVal.size() == 0) ? "No results for expression: '" : "Multiple results for expression: '"); if (cexp instanceof OXPath10Expression) { msg.append(((OXPath10Expression)cexp).xpath); } else { msg.append(cexp.toString()); } msg.append('\''); if (ctx.getRootNode() != null) { msg.append(" against '"); msg.append(DOMUtils.domToString(ctx.getRootNode())); msg.append('\''); } if (retVal.size() == 0) throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, msg.toString(), new Throwable("ignoreMissingFromData")); if (retVal.size() > 1) throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, msg.toString()); } return (Node) retVal.get(0); }
public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException { String literal = this.evaluateAsString(cexp, context); try { Duration duration = new org.apache.ode.utils.xsd.Duration(literal); return duration; } catch (Exception ex) { String errmsg = "Invalid duration: " + literal; __log.error(errmsg, ex); throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue, errmsg); } }
public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException { String literal = evaluateAsString(cexp, context); 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); } }
public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException { String literal = this.evaluateAsString(cexp, context); 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); } }
private int evaluateCondition(OExpression condition) throws FaultException { try { return getBpelRuntimeContext().getExpLangRuntime(). evaluateAsNumber(condition, getEvaluationContext()).intValue(); } catch (EvaluationException e) { String msg; msg = "ForEach counter value couldn't be evaluated as xs:unsignedInt."; __log.error(msg, e); throw new FaultException(_oforEach.getOwner().constants.qnForEachCounterError,msg); } }
public void reply(final PartnerLinkInstance plinkInstnace, final String opName, final String mexId, Element msg, QName fault) throws FaultException { String mexRef = _imaManager.release(plinkInstnace, opName, mexId); if (mexRef == null) { throw new FaultException(_bpelProcess.getOProcess().constants.qnMissingRequest); } reply2(plinkInstnace, opName, mexId, msg, fault, false, mexRef); }
/** * This method is exposed to the JS environment and allows users to * throw BPEL faults. * * @throws FaultException */ public static void throwFault(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws FaultException { if (args.length != 3) { Context.reportError("throwFault expects the following parameters: throwFault(namespace, localname, faultMessage)"); } String ns = Context.toString(args[0]); String localname = Context.toString(args[1]); String msg = Context.toString(args[2]); throw new FaultException(new QName(ns, localname), msg); }
/** * Evaluate expression and return duration * * @param cexp cexp * @param context context * * @return type * * @throws FaultException FaultException * @throws EvaluationException EvaluationException */ public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException { String literal = this.evaluateAsString(cexp, context); 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); } }
public Element fetchPartnerRoleEndpointReferenceData(PartnerLinkInstance pLink) throws FaultException { PartnerLinkDAO pl = fetchPartnerLinkDAO(pLink); Element epr = pl.getPartnerEPR(); if (epr == null) { EndpointReference e = _bpelProcess.getInitialPartnerRoleEPR(pLink.partnerLink); if (e != null) epr = e.toXML().getDocumentElement(); } if (epr == null) { throw new FaultException(_bpelProcess.getOProcess().constants.qnUninitializedPartnerRole); } return epr; }
public void processOutstandingRequest(PartnerLinkInstance partnerLink, String opName, String bpelMexId, String odeMexId) throws FaultException { String mexRef = _imaManager.processOutstandingRequest(partnerLink, opName, bpelMexId, odeMexId); if (mexRef != null) { reply2(partnerLink, opName, bpelMexId, null, _bpelProcess.getOProcess().constants.qnConflictingRequest, false, mexRef); throw new FaultException(_bpelProcess.getOProcess().constants.qnConflictingRequest); } }
@Override public void reply(PartnerLinkInstance plinkInstnace, String opName, String mexId, Element msg, QName fault) throws FaultException { String mexRef = _imaManager.release(plinkInstnace, opName, mexId); if (mexRef == null) { throw new FaultException(_bpelProcess.getOProcess().constants.qnMissingRequest); } MessageExchangeDAO mex = _dao.getConnection().getMessageExchange(mexRef); String pipedId = mex.getPipedMessageExchangeId(); if (pipedId != null) { __log.debug("instance replied for live communication:" + mexRef + " " + DOMUtils.domToString(msg)); super.reply2(plinkInstnace, opName, mexId, msg, fault, false, mexRef); } else { MessageDAO message = mex.createMessage(plinkInstnace.partnerLink.getMyRoleOperation(opName).getOutput().getMessage().getQName()); buildOutgoingMessage(message, msg); __log.debug("instance replied mexRef:" + mexRef + " " + DOMUtils.domToString(msg)); mex.setResponse(message); mex.setStatus(Status.RESPONSE.toString()); } }