本文整理汇总了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);
}
}
示例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();
}
}
示例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;
}
示例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);
}
}
示例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);
}