當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageCorrelationBuilder類代碼示例

本文整理匯總了Java中org.camunda.bpm.engine.runtime.MessageCorrelationBuilder的典型用法代碼示例。如果您正苦於以下問題:Java MessageCorrelationBuilder類的具體用法?Java MessageCorrelationBuilder怎麽用?Java MessageCorrelationBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MessageCorrelationBuilder類屬於org.camunda.bpm.engine.runtime包,在下文中一共展示了MessageCorrelationBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
@Override
public void execute(DelegateExecution execution) throws Exception {

    String message = getMessageName(execution);
    notNull(message, () -> new BadArgument("message"));

    RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();

    MessageCorrelationBuilder correlation = runtimeService.createMessageCorrelation(message);

    if (variableName != null) {
        correlation.setVariable(variableName, variableValue);
    }

    if (correlateName != null) {
        correlation.processInstanceVariableEquals(correlateName, correlateValue);
    }

    correlation.correlateWithResult();
}
 
開發者ID:LIBCAS,項目名稱:ARCLib,代碼行數:21,代碼來源:SimpleMessageThrowDelegate.java

示例2: execute

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
@Override
public void execute(DelegateExecution execution) throws Exception {

    String message = getMessageName(execution);
    notNull(message, () -> new BadArgument("message"));

    RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();

    MessageCorrelationBuilder correlation = runtimeService.createMessageCorrelation(message);

    if (variables != null) {
        correlation.setVariables((Map<String, Object>) variables.getValue(execution));
    }

    if (correlateName != null) {
        correlation.processInstanceVariableEquals((String) correlateName.getValue(execution), correlateValue.getValue(execution));
    }

    correlation.correlateWithResult();
}
 
開發者ID:LIBCAS,項目名稱:ARCLib,代碼行數:21,代碼來源:MapMessageThrowDelegate.java

示例3: setupMocks

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
@Before
public void setupMocks() {
  runtimeServiceMock = mock(RuntimeService.class);
  when(processEngine.getRuntimeService()).thenReturn(runtimeServiceMock);

  messageCorrelationBuilderMock = mock(MessageCorrelationBuilder.class);

  when(runtimeServiceMock.createMessageCorrelation(anyString())).thenReturn(messageCorrelationBuilderMock);
  when(messageCorrelationBuilderMock.processInstanceId(anyString())).thenReturn(messageCorrelationBuilderMock);
  when(messageCorrelationBuilderMock.processInstanceBusinessKey(anyString())).thenReturn(messageCorrelationBuilderMock);
  when(messageCorrelationBuilderMock.processInstanceVariableEquals(anyString(), any())).thenReturn(messageCorrelationBuilderMock);
  when(messageCorrelationBuilderMock.setVariables(Matchers.<Map<String,Object>>any())).thenReturn(messageCorrelationBuilderMock);
  when(messageCorrelationBuilderMock.setVariable(anyString(), any())).thenReturn(messageCorrelationBuilderMock);

  executionResult = MockProvider.createMessageCorrelationResult(MessageCorrelationResultType.Execution);
  procInstanceResult = MockProvider.createMessageCorrelationResult(MessageCorrelationResultType.ProcessDefinition);
  executionResultList = MockProvider.createMessageCorrelationResultList(MessageCorrelationResultType.Execution);
  procInstanceResultList = MockProvider.createMessageCorrelationResultList(MessageCorrelationResultType.ProcessDefinition);
  mixedResultList = new ArrayList<MessageCorrelationResult>(executionResultList);
  mixedResultList.addAll(procInstanceResultList);

}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:23,代碼來源:MessageRestServiceTest.java

示例4: signalMessage

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
/**
 * Signals a BPMN Message to a running process instance.
 *
 * todo: describe what will happen if non existing message is signalized.
 *
 * @param id Id of a process instance
 * @param messageName Message name to signalize
 */
public void signalMessage(String id, String messageName, Map<String, Object> variables) {
    eq(processExists(id), true, () -> new MissingObject(Task.class, id));

    MessageCorrelationBuilder correlation = runtimeService.createMessageCorrelation(messageName);

    if (variables != null) {
        correlation.setVariables(variables);
    }

    correlation.processInstanceId(id).correlateAll();
}
 
開發者ID:LIBCAS,項目名稱:ARCLib,代碼行數:20,代碼來源:ProcessList.java

示例5: processInstanceVariableEquals

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder processInstanceVariableEquals(String variableName, Object variableValue) {
  ensureNotNull("variableName", variableName);
  ensureCorrelationProcessInstanceVariablesInitialized();

  correlationProcessInstanceVariables.put(variableName, variableValue);
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:8,代碼來源:MessageCorrelationBuilderImpl.java

示例6: processInstanceVariablesEqual

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder processInstanceVariablesEqual(Map<String, Object> variables) {
  ensureNotNull("variables", variables);
  ensureCorrelationProcessInstanceVariablesInitialized();

  correlationProcessInstanceVariables.putAll(variables);
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:8,代碼來源:MessageCorrelationBuilderImpl.java

示例7: localVariableEquals

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder localVariableEquals(String variableName, Object variableValue) {
  ensureNotNull("variableName", variableName);
  ensureCorrelationLocalVariablesInitialized();

  correlationLocalVariables.put(variableName, variableValue);
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:8,代碼來源:MessageCorrelationBuilderImpl.java

示例8: localVariablesEqual

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder localVariablesEqual(Map<String, Object> variables) {
  ensureNotNull("variables", variables);
  ensureCorrelationLocalVariablesInitialized();

  correlationLocalVariables.putAll(variables);
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:8,代碼來源:MessageCorrelationBuilderImpl.java

示例9: setVariables

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder setVariables(Map<String, Object> variables) {
  if (variables != null) {
    ensurePayloadProcessInstanceVariablesInitialized();
    payloadProcessInstanceVariables.putAll(variables);
  }
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:8,代碼來源:MessageCorrelationBuilderImpl.java

示例10: createMessageCorrelationBuilderMock

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
private void createMessageCorrelationBuilderMock() {
  mockMessageCorrelationBuilder = mock(MessageCorrelationBuilder.class);
  mockMessageCorrelationResult = mock(MessageCorrelationResult.class);

  when(mockRuntimeService.createMessageCorrelation(anyString())).thenReturn(mockMessageCorrelationBuilder);
  when(mockMessageCorrelationBuilder.correlateWithResult()).thenReturn(mockMessageCorrelationResult);
  when(mockMessageCorrelationBuilder.processInstanceId(anyString())).thenReturn(mockMessageCorrelationBuilder);
  when(mockMessageCorrelationBuilder.processInstanceBusinessKey(anyString())).thenReturn(mockMessageCorrelationBuilder);
  when(mockMessageCorrelationBuilder.processInstanceVariableEquals(anyString(), any())).thenReturn(mockMessageCorrelationBuilder);
  when(mockMessageCorrelationBuilder.setVariables(Matchers.<Map<String,Object>>any())).thenReturn(mockMessageCorrelationBuilder);
  when(mockMessageCorrelationBuilder.setVariable(anyString(), any())).thenReturn(mockMessageCorrelationBuilder);

}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:14,代碼來源:ProcessEngineRestServiceTest.java

示例11: handleEvent

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
@Override
public boolean handleEvent(String type, String eventName, String transactionId, JsonObject event) {
  if ("Event".equals(type) && "OrderPlaced".equals(eventName)) {
    // Currently special handling to also persist the order

    Order order = parseOrder(event.getJsonObject("order"));
    // "Persist" order
    orderRepository.persistOrder(order);

    VariableMap variables = Variables.createVariables();
    variables.put("orderId", order.getId());
    variables.put("transactionId", transactionId);      
    engine.getRuntimeService().startProcessInstanceByKey("order", transactionId, variables);
    
    return true;
  } else {

    // Currently the transaction is NOT used for correlation, as we can assume
    // to hit some legacy system some time which is not able to handle it
    // That's why we only use it for tracking / monitoring purposes

    // Correlate by possible ids in this priority
    VariableMap correlationKeys = getCorrelationKeys(event);
  
    MessageCorrelationBuilder correlation = engine.getRuntimeService().createMessageCorrelation(eventName);
    ExecutionQuery query = engine.getRuntimeService().createExecutionQuery().messageEventSubscriptionName(eventName);
    
    for (String key : correlationKeys.keySet()) {
      correlation.processInstanceVariableEquals(key, correlationKeys.get(key));
      query.processVariableValueEquals(key, correlationKeys.get(key));
    }
    
    // if nobody waits for this event we consider it not to be for us
    if (query.count()==0) {
      return false;
    }

    // otherwise correlate it

    // add all possible additional correlation keys as variables to the flow
    VariableMap newVariables = getNewVariables(event);
    correlation.setVariables(newVariables);
    
    correlation.correlateWithResult();
    return true;      
  }
}
 
開發者ID:flowing,項目名稱:flowing-retail-old,代碼行數:48,代碼來源:CamundaBpmnOrderEventHandler.java

示例12: processInstanceBusinessKey

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder processInstanceBusinessKey(String businessKey) {
  ensureNotNull("businessKey", businessKey);
  this.businessKey = businessKey;
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:6,代碼來源:MessageCorrelationBuilderImpl.java

示例13: processInstanceId

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder processInstanceId(String id) {
  ensureNotNull("processInstanceId", id);
  this.processInstanceId = id;
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:6,代碼來源:MessageCorrelationBuilderImpl.java

示例14: setVariable

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder setVariable(String variableName, Object variableValue) {
  ensureNotNull("variableName", variableName);
  ensurePayloadProcessInstanceVariablesInitialized();
  payloadProcessInstanceVariables.put(variableName, variableValue);
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:7,代碼來源:MessageCorrelationBuilderImpl.java

示例15: withoutTenantId

import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; //導入依賴的package包/類
public MessageCorrelationBuilder withoutTenantId() {
  isTenantIdSet = true;
  tenantId = null;
  return this;
}
 
開發者ID:camunda,項目名稱:camunda-bpm-platform,代碼行數:6,代碼來源:MessageCorrelationBuilderImpl.java


注:本文中的org.camunda.bpm.engine.runtime.MessageCorrelationBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。