Package org.jbpm.db

Examples of org.jbpm.db.MessagingSession


  void handleProcessingException(MessageProcessingException e) {
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(jbpmContextName);
    try {
      // get the message session from the context
      DbMessageService dbMessageSessionImpl = (DbMessageService) jbpmContext.getServices().getMessageService();
      MessagingSession messageSession = dbMessageSessionImpl.getMessagingSession();

      // get the problematic command message from the exception
      Message message = e.message;

      // remove the problematic message from the queue
      dbMessageSessionImpl.receiveByIdNoWait(message.getId());
     
      message = Message.createCopy(message);

      // update the message with the stack trace
      StringWriter sw = new StringWriter();
      e.printStackTrace(new PrintWriter(sw));
      message.setException(sw.toString());

      // update the message with the jbpm-error-queue destination
      message.setDestination(errorDestination);
     
      // resend
      messageSession.save(message);

    } finally {
      jbpmContext.close();
    }
  }
View Full Code Here


  }
  public MessagingSession getMessagingSession() {
    if (messagingSession==null) {
      Session session = getSession();
      if (session!=null) {
        messagingSession = new MessagingSession(session);
      }
    }
    return messagingSession;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.db.MessagingSession

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.