Package org.apache.ode.bpel.iapi.MessageExchange

Examples of org.apache.ode.bpel.iapi.MessageExchange.Status


            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            if(true) {
                Status status = mex.getStatus();
                Element invocationResponse = mex.getResponse().getMessage();

                System.out.println(">>>Invocation status:" + status.name());
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
            }
            //process the method invocation result
            response = processResponse(mex.getResponse().getMessage());
View Full Code Here


            txMgr.begin();
            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            Status status = mex.getStatus();

            switch (status) {
            case FAULT:
                if (__log.isDebugEnabled())
                    __log.debug("Fault response message: " + mex.getFault());
View Full Code Here

                txMgr.begin();
                // Reloading the mex in the current transaction, otherwise we can't be sure we have
                // the "freshest" one.
                mex = (MyRoleMessageExchange) odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

                Status status = mex.getStatus();
                System.out.println("Status: " + status.name());
                Element response = mex.getResponse().getMessage();
                System.out.println("Response: " + DOMUtils.domToString(response));
                txMgr.commit();
                // end of transaction two
            } catch (Exception e) {
View Full Code Here

            txMgr.begin();
            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            Status status = mex.getStatus();
            System.out.println("Status: " + status.name());
            Element invocationResponse = mex.getResponse().getMessage();
            System.out.println("Response: " + DOMUtils.domToString(invocationResponse));
           
            //process the method invocation result
            response = processResponse(invocationResponse);
View Full Code Here

    }

    public void onAsyncReply(MyRoleMessageExchange myRoleMex)
            throws BpelEngineException {
        Status mStat = myRoleMex.getStatus();
        if ( mStat == Status.RESPONSE ) {
            currentResponse = myRoleMex.getResponse();
        }
        myRoleMex.complete();
    }
View Full Code Here

                        Message request = mex[0].createMessage(_invocation.requestType);
                        request.setMessage(_invocation.request);
                        _invocation.invokeTime = System.currentTimeMillis();
                        running[0] = mex[0].invoke(request);

                        Status status = mex[0].getStatus();
                        CorrelationStatus cstatus = mex[0].getCorrelationStatus();
                        if (_invocation.expectedStatus != null && !status.equals(_invocation.expectedStatus))
                            failure(_invocation, "Unexpected message exchange status", _invocation.expectedStatus, status);

                        if (_invocation.expectedCorrelationStatus != null && !cstatus.equals(_invocation.expectedCorrelationStatus))
                            failure(_invocation, "Unexpected correlation status", _invocation.expectedCorrelationStatus, cstatus);
                        return null;

                    } catch (Exception ex) {
                        if (_invocation.expectedInvokeException == null)
                            failure(_invocation, "Unexpected invocation exception.", ex);
                        else if (_invocation.expectedInvokeException.isAssignableFrom(ex.getClass()))
                            failure(_invocation, "Unexpected invocation exception.", _invocation.expectedInvokeException, ex.getClass());

                        return null;
                    }
                }
            });

            if (isFailed())
                return;

            try {
                running[0].get(_invocation.maximumWaitMs, TimeUnit.MILLISECONDS);
            } catch (Exception ex) {
                failure(_invocation, "Exception on future object.", ex);
                return;
            }

            long ctime = System.currentTimeMillis();
            long itime = ctime - _invocation.invokeTime;
            if (_invocation.minimumWaitMs != null && _invocation.minimumWaitMs >= itime)
                failure(_invocation, "Response received too soon.", _invocation.minimumWaitMs, itime);

            if (_invocation.maximumWaitMs <= itime)
                failure(_invocation, "Response took too long.", _invocation.maximumWaitMs, itime);

            if (isFailed())
                return;

            if (_invocation.expectedResponsePattern != null) {
                scheduler.execTransaction(new Callable<Void>() {
                    public Void call() throws Exception {
                        Status finalstat = mex[0].getStatus();
                        if (_invocation.expectedFinalStatus != null && !_invocation.expectedFinalStatus.equals(finalstat))
                            if (finalstat.equals(Status.FAULT)) {
                                failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, "FAULT: "
                                        + mex[0].getFault() + " | " + mex[0].getFaultExplanation());
                            } else {
                                failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, finalstat);
                            }
View Full Code Here

                e.setIn(XmlObject.Factory.parse(mexDao.getRequest().getData()));
            } catch (XmlException e1) {
                __log.error("", e1);
            }
            try {
                Status status = Status.valueOf(mexDao.getStatus());
                if (status == Status.FAULT) {
                    FaultType f = e.addNewFault();
                    f.setType(mexDao.getFault());
                    f.setExplanation(mexDao.getFaultExplanation());
                    if (mexDao.getResponse() != null) {
View Full Code Here

            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            if(true) {
                Status status = mex.getStatus();
                Element invocationResponse = mex.getResponse().getMessage();

                System.out.println(">>>Invocation status:" + status.name());
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
                System.out.println(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
            }
            //process the method invocation result
            response = processResponse(mex.getResponse().getMessage());
View Full Code Here

                e.setIn(XmlObject.Factory.parse(mexDao.getRequest().getData()));
            } catch (XmlException e1) {
                __log.error("", e1);
            }
            try {
                Status status = Status.valueOf(mexDao.getStatus());
                if (status == Status.FAULT) {
                    FaultType f = e.addNewFault();
                    f.setType(mexDao.getFault());
                    f.setExplanation(mexDao.getFaultExplanation());
                    if (mexDao.getResponse() != null) {
View Full Code Here

  }

  public void onAsyncReply(MyRoleMessageExchange myRoleMex)
      throws BpelEngineException {
    Status mStat = myRoleMex.getStatus();
        if ( mStat == Status.RESPONSE ) {
      currentResponse = myRoleMex.getResponse();
    }
    myRoleMex.complete();
  }
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.iapi.MessageExchange.Status

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.