当前位置: 首页>>代码示例>>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;未经允许,请勿转载。