org.camunda.bpm.engine.runtime
Interface MessageCorrelationBuilder

All Known Implementing Classes:
MessageCorrelationBuilderImpl

public interface MessageCorrelationBuilder

A fluent builder for defining message correlation

Author:
Daniel Meyer

Method Summary
 void correlate()
          Executes the message correlation.
 void correlateAll()
          Executes the message correlation for multiple messages.
 MessageCorrelationBuilder processInstanceBusinessKey(String businessKey)
          Correlate the message such that the process instance has a business with the given name and value.
 MessageCorrelationBuilder processInstanceId(String id)
          Correlate the message such that a process instance with the given id is selected.
 MessageCorrelationBuilder processInstanceVariableEquals(String variableName, Object variableValue)
          Correlate the message such that the process instance has a variable with the given name and value.
 MessageCorrelationBuilder setVariable(String variableName, Object variableValue)
          Pass a variable to the execution waiting on the message.
 MessageCorrelationBuilder setVariables(Map<String,Object> variables)
          Pass a map of variables to the execution waiting on the message.
 

Method Detail

processInstanceBusinessKey

MessageCorrelationBuilder processInstanceBusinessKey(String businessKey)

Correlate the message such that the process instance has a business with the given name and value.

Parameters:
businessKey - the businessKey to correlate on.
Returns:
the builder

processInstanceVariableEquals

MessageCorrelationBuilder processInstanceVariableEquals(String variableName,
                                                        Object variableValue)

Correlate the message such that the process instance has a variable with the given name and value.

Parameters:
variableName - the name of the process instance variable to correlate on.
variableValue - the value of the process instance variable to correlate on.
Returns:
the builder

processInstanceId

MessageCorrelationBuilder processInstanceId(String id)

Correlate the message such that a process instance with the given id is selected.

Parameters:
id - the id of the process instance to correlate on.
Returns:
the builder

setVariable

MessageCorrelationBuilder setVariable(String variableName,
                                      Object variableValue)

Pass a variable to the execution waiting on the message. Use this method for passing the message's payload.

Invoking this method multiple times allows passing multiple variables.

Parameters:
variableName - the name of the variable to set
variableValue - the value of the variable to set
Returns:
the builder

setVariables

MessageCorrelationBuilder setVariables(Map<String,Object> variables)

Pass a map of variables to the execution waiting on the message. Use this method for passing the message's payload

Parameters:
variables - the map of variables
Returns:
the builder

correlate

void correlate()
Executes the message correlation.

This will result in either:

Throws:
MismatchingMessageCorrelationException - if none or more than one execution or process definition is matched by the correlation
AuthorizationException - if one execution is matched and the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION. if one process definition is matched and the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.

correlateAll

void correlateAll()
Executes the message correlation for multiple messages.

This will result in any number of the following:

Throws:
AuthorizationException - if at least one execution is matched and the user has no Permissions.UPDATE permission on Resources.PROCESS_INSTANCE or no Permissions.UPDATE_INSTANCE permission on Resources.PROCESS_DEFINITION. if one process definition is matched and the user has no Permissions.CREATE permission on Resources.PROCESS_INSTANCE and no Permissions.CREATE_INSTANCE permission on Resources.PROCESS_DEFINITION.


Copyright © 2015 camunda services GmbH. All rights reserved.