Package org.camunda.bpm.engine

Examples of org.camunda.bpm.engine.MismatchingMessageCorrelationException


    // first try to correlate to execution
    List<MessageCorrelationResult> correlations = correlateMessageToExecutions(commandContext, messageName, correlationSet);

    if(correlations.size() > 1) {
      throw new MismatchingMessageCorrelationException(messageName, correlationSet.getBusinessKey(), correlationSet.getCorrelationKeys(),
          String.valueOf(correlations.size()) + " executions match the correlation keys. Should be one or zero.");
    }
    else if(!correlations.isEmpty()) {
      return correlations.get(0);
    }
View Full Code Here


    CorrelationSet correlationSet = new CorrelationSet(businessKey, processInstanceId, correlationKeys);
    MessageCorrelationResult correlationResult = correlationHandler.correlateMessage(commandContext, messageName, correlationSet);

    if (correlationResult == null) {
      throw new MismatchingMessageCorrelationException(messageName, "No process definition or execution matches the parameters");

    } else if (MessageCorrelationResult.TYPE_EXECUTION.equals(correlationResult.getResultType())) {
      triggerExecution(commandContext, correlationResult);

    } else {
View Full Code Here

  @Test
  public void testMismatchingCorrelation() {
    String messageName = "aMessage";

    doThrow(new MismatchingMessageCorrelationException(messageName, "Expected exception: cannot correlate"))
      .when(messageCorrelationBuilderMock).correlate();

    Map<String, Object> messageParameters = new HashMap<String, Object>();
    messageParameters.put("messageName", messageName);
    given().contentType(POST_JSON_CONTENT_TYPE).body(messageParameters)
View Full Code Here

    CorrelationSet correlationSet = new CorrelationSet(businessKey, processInstanceId, correlationKeys);
    MessageCorrelationResult correlationResult = correlationHandler.correlateMessage(commandContext, messageName, correlationSet);

    if (correlationResult == null) {
      throw new MismatchingMessageCorrelationException(messageName, "No process definition or execution matches the parameters");

    } else if (MessageCorrelationResult.TYPE_EXECUTION.equals(correlationResult.getResultType())) {
      triggerExecution(commandContext, correlationResult);

    } else {
View Full Code Here

    // first try to correlate to execution
    List<MessageCorrelationResult> correlations = correlateMessageToExecutions(commandContext, messageName, correlationSet);

    if(correlations.size() > 1) {
      throw new MismatchingMessageCorrelationException(messageName, correlationSet.getBusinessKey(), correlationSet.getCorrelationKeys(),
          String.valueOf(correlations.size()) + " executions match the correlation keys. Should be one or zero.");
    }
    else if(!correlations.isEmpty()) {
      return correlations.get(0);
    }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.MismatchingMessageCorrelationException

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.