Package org.jbpm.msg

Examples of org.jbpm.msg.Message


        Action action = (Action) iter.next();
        if ( action.acceptsPropagatedEvents()
             || (!isPropagated)
           ) {
          if (action.isAsync()) {
            Message continuationMsg = new ExecuteActionCommand(action, executionContext.getToken());
            MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
            messageService.send(continuationMsg);
          } else {
            executeAction(action, executionContext);
          }
View Full Code Here


  public boolean hasMessages(String destination) {
    return messagingSession.hasNextMessage(destination);
  }

  public Message receiveNoWait(String destination) {
    Message message = messagingSession.nextMessage(destination);
    if (message!=null) {
      log.trace("received msg '"+message+"'");
      messagingSession.delete(message);
    }
    return message;
View Full Code Here

    }
    return message;
  }

  public Message receiveByIdNoWait(long id) {
    Message message = messagingSession.loadMessage(id);
    log.trace("received msg by id '"+id+"' :"+message);
    if (message!=null) {
      messagingSession.delete(message);
    }
    return message;
View Full Code Here

    executionContext.setTransition(null);
    executionContext.setTransitionSource(null);

    // execute the node
    if (isAsync) {
      Message continuationMsg = new ExecuteNodeCommand(this, executionContext.getToken());
      MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
      messageService.send(continuationMsg);
    } else {
      execute(executionContext);
    }
View Full Code Here

    }
    return hasMessages;
  }

  public Message nextMessage(String destination) {
    Message message = null;
    if (nextMessage!=null) {
      message = nextMessage;
      nextMessage = null;
    } else {
      Iterator messageIterator = getMessageIterator(destination);
View Full Code Here

    }
  }

  public boolean executeCommand() throws Throwable {
    boolean checkForMoreMessages = false;
    Message message = null;
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(jbpmContextName);
    try {
      // get a command from the queue
      DbMessageService dbMessageService = null;
      try {
View Full Code Here

      // 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 {
View Full Code Here

TOP

Related Classes of org.jbpm.msg.Message

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.