当前位置: 首页>>代码示例>>Java>>正文


Java CommandContext.getEventSubscriptionManager方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.impl.interceptor.CommandContext.getEventSubscriptionManager方法的典型用法代码示例。如果您正苦于以下问题:Java CommandContext.getEventSubscriptionManager方法的具体用法?Java CommandContext.getEventSubscriptionManager怎么用?Java CommandContext.getEventSubscriptionManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.impl.interceptor.CommandContext的用法示例。


在下文中一共展示了CommandContext.getEventSubscriptionManager方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findMessageStartEventSubscriptions

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected List<EventSubscriptionEntity> findMessageStartEventSubscriptions(CommandContext commandContext, String messageName, CorrelationSet correlationSet) {
  EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager();

  if (correlationSet.isTenantIdSet) {
    EventSubscriptionEntity eventSubscription = eventSubscriptionManager.findMessageStartEventSubscriptionByNameAndTenantId(messageName, correlationSet.getTenantId());
    if (eventSubscription != null) {
      return Collections.singletonList(eventSubscription);
    } else {
      return Collections.emptyList();
    }

  } else {
    return eventSubscriptionManager.findMessageStartEventSubscriptionByName(messageName);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:16,代码来源:DefaultCorrelationHandler.java

示例2: findConditionalStartEventSubscriptions

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected List<EventSubscriptionEntity> findConditionalStartEventSubscriptions(CommandContext commandContext, ConditionSet conditionSet) {
  EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager();

  if (conditionSet.isTenantIdSet) {
    return eventSubscriptionManager.findConditionalStartEventSubscriptionByTenantId(conditionSet.getTenantId());
  } else {
    return eventSubscriptionManager.findConditionalStartEventSubscription();
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:DefaultConditionHandler.java

示例3: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public Void execute(CommandContext commandContext) {
  ensureNotNull("executionId", executionId);

  EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager();
  List<EventSubscriptionEntity> eventSubscriptions = null;
  if (messageName != null) {
    eventSubscriptions = eventSubscriptionManager.findEventSubscriptionsByNameAndExecution(
            EventType.MESSAGE.name(), messageName, executionId, exclusive);
  } else {
    eventSubscriptions = eventSubscriptionManager.findEventSubscriptionsByExecutionAndType(
        executionId, EventType.MESSAGE.name(), exclusive);
  }

  ensureNotEmpty("Execution with id '" + executionId + "' does not have a subscription to a message event with name '" + messageName + "'", "eventSubscriptions", eventSubscriptions);
  ensureNumberOfElements("More than one matching message subscription found for execution " + executionId, "eventSubscriptions", eventSubscriptions, 1);

  // there can be only one:
  EventSubscriptionEntity eventSubscriptionEntity = eventSubscriptions.get(0);

  // check authorization
  String processInstanceId = eventSubscriptionEntity.getProcessInstanceId();
  for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
    checker.checkUpdateProcessInstanceById(processInstanceId);
  }

  eventSubscriptionEntity.eventReceived(processVariables, false);

  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:31,代码来源:MessageEventReceivedCmd.java

示例4: findSignalEventSubscriptions

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected List<EventSubscriptionEntity> findSignalEventSubscriptions(CommandContext commandContext, String signalName) {
  EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager();

  if (builder.isTenantIdSet()) {
    return eventSubscriptionManager.findSignalEventSubscriptionsByEventNameAndTenantId(signalName, builder.getTenantId());

  } else {
    return eventSubscriptionManager.findSignalEventSubscriptionsByEventName(signalName);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:11,代码来源:SignalEventReceivedCmd.java

示例5: sendSignalToExecution

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected void sendSignalToExecution(CommandContext commandContext, String signalName, String executionId) {

    ExecutionManager executionManager = commandContext.getExecutionManager();
    ExecutionEntity execution = executionManager.findExecutionById(executionId);
    ensureNotNull("Cannot find execution with id '" + executionId + "'", "execution", execution);

    EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager();
    List<EventSubscriptionEntity> signalEvents = eventSubscriptionManager.findSignalEventSubscriptionsByNameAndExecution(signalName, executionId);
    ensureNotEmpty("Execution '" + executionId + "' has not subscribed to a signal event with name '" + signalName + "'.", signalEvents);

    checkAuthorizationOfCatchSignals(commandContext, signalEvents);
    notifyExecutions(signalEvents);
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:SignalEventReceivedCmd.java


注:本文中的org.camunda.bpm.engine.impl.interceptor.CommandContext.getEventSubscriptionManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。