Examples of MessageService


Examples of org.jbpm.msg.MessageService

    }
  }

  void resumeMessages() {
    // notify the message service of this resuming
    MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE, false);
    if (messageService!=null) {
      messageService.resumeMessages(this);
    }
  }
View Full Code Here

Examples of org.jbpm.msg.MessageService

    Services services = new Services(serviceFactories);
    assertSame(loggingService, services.getLoggingService());
  }
  public void testMessageService() {
    Map serviceFactories = new HashMap();
    MessageService messageService = new MessageService(){
      private static final long serialVersionUID = 1L;
      public void send(Message message) {}
      public void suspendMessages(Token token) {}
      public void resumeMessages(Token token) {}
      public void close() {}
View Full Code Here

Examples of org.jbpm.msg.MessageService

       
        if (isDebugEnabled)
        {
            logger.debug("Sending " + (token.isSuspended() ? "suspended " : "") +"signal task to message service for token id " + tokenId + " from process instance " + processInstanceId) ;
        }
        final MessageService messageService = (MessageService)Services.getCurrentService(Services.SERVICENAME_MESSAGE, true) ;
        messageService.send(signalJob) ;
        if (isDebugEnabled)
        {
            logger.debug("Sent signal task to message service for token id " + tokenId + " from process instance " + processInstanceId) ;
        }
       
View Full Code Here

Examples of org.jbpm.msg.MessageService

    executionContext.setTransitionSource(null);

    // execute the node
    if (isAsync) {
      ExecuteNodeJob job = createAsyncContinuationJob(token);
      MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
      messageService.send(job);
      token.lock(job.toString());
    } else {
      execute(executionContext);
    }
  }
View Full Code Here

Examples of org.jbpm.msg.MessageService

        if ( action.acceptsPropagatedEvents()
             || (!isPropagated)
           ) {
          if (action.isAsync()) {
            ExecuteActionJob job = createAsyncActionExecutionJob(executionContext.getToken(), action);
            MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
            messageService.send(job);
          } else {
            executeAction(action, executionContext);
          }
        }
      }
View Full Code Here

Examples of org.jbpm.msg.MessageService

    executionContext.setTransitionSource(null);

    // execute the node
    if (isAsync) {
      ExecuteNodeJob job = createAsyncContinuationJob(token);
      MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
      messageService.send(job);
      token.lock(job.toString());
    } else {
      execute(executionContext);
    }
  }
View Full Code Here

Examples of org.jbpm.msg.MessageService

        if ( action.acceptsPropagatedEvents()
             || (!isPropagated)
           ) {
          if (action.isAsync()) {
            ExecuteActionJob job = createAsyncActionExecutionJob(executionContext.getToken(), action);
            MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
            messageService.send(job);
          } else {
            executeAction(action, executionContext);
          }
        }
      }
View Full Code Here

Examples of org.kuali.rice.krad.messages.MessageService

  @Test
  /**
   * tests that {@link MartinlawConstants.MessageKeys.ERROR_NOT_ASSIGNED} is found
   */
  public void testNotAssigneeMsg() {
    MessageService messageService = KRADServiceLocatorWeb.getMessageService();
        // find message by key
        String message = messageService.getMessageText(MartinlawConstants.MODULE_NAMESPACE_CODE, null,
            MartinlawConstants.MessageKeys.ERROR_NOT_ASSIGNED);
        assertFalse("message should not be null", StringUtils.isEmpty(message));
  }
View Full Code Here

Examples of org.kuali.rice.krad.messages.MessageService

  @Test
  /**
   * tests that {@link RiceKeyConstants.ERROR_EXISTENCE} is found
   */
  public void testNotExistingMsg() {
    MessageService messageService = KRADServiceLocatorWeb.getMessageService();
        // find message by key
        String message = messageService.getMessageText(MartinlawConstants.MODULE_NAMESPACE_CODE, null,
            RiceKeyConstants.ERROR_EXISTENCE);
        assertFalse("message should not be null", StringUtils.isEmpty(message));
  }
View Full Code Here

Examples of org.mule.module.bpm.MessageService

        perform(execution);
    }

    public void perform(OpenExecution execution) throws Exception
    {
        MessageService mule = EnvironmentImpl.getCurrent().get(MuleMessageService.class);
        if (mule == null)
        {
            throw new JbpmException("The Mule MessageService is not available from the ProcessEngine, you may need to add it to your jbpm.cfg.xml file");
        }

        if (payloadExpression == null)
        {
            payloadObject = execution.getVariable(Process.PROCESS_VARIABLE_DATA);
            if (payloadObject == null)
            {
                payloadObject = execution.getVariable(Process.PROCESS_VARIABLE_INCOMING);
            }
        }
        else
        {
            // The payloadSource may be specified using an expression (e.g.,
            // #{myObject.myStuff.myField} would first retrieve the process
            // variable "myObject" and then call .getMyStuff().getMyField()
            payloadObject = ScriptManager.getScriptManager().evaluateExpression(payloadExpression, null);
        }
        if (payloadObject == null)
        {
            throw new IllegalArgumentException("Payload for message is null.  Payload source is \""
                                               + payloadExpression + "\"");
        }

        Map props = new HashMap();

        props.put(Process.PROPERTY_PROCESS_TYPE, ((ExecutionImpl) execution).getProcessDefinition().getName());
        props.put(Process.PROPERTY_PROCESS_ID, execution.getId());
        String state = Jbpm.getState(execution.getProcessInstance());
        props.put("MULE_BPM_PROCESS_STATE", state);
        log.debug("process state: " + state);       

        // Set process vars as properties on outgoing Mule messages.
        for (Entry<String, ?> var : execution.getVariables().entrySet())
        {
            if (!var.getKey().startsWith(MuleProperties.PROPERTY_PREFIX))
            {
                log.debug("process var: " + var.getKey() + " = " + var.getValue());
                props.put(var.getKey(), var.getValue());
            }
        }

        // Just in case the endpoint itself is an expression
        endpoint = (String) ScriptManager.getScriptManager().evaluateExpression(endpoint, null);
        MuleMessage response = mule.generateMessage(endpoint, payloadObject, props, mep);

        if (mep.hasResponse() && response != null)
        {
            Object responsePayload = response.getPayload();
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.