本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity.eventReceived方法的典型用法代码示例。如果您正苦于以下问题:Java SignalEventSubscriptionEntity.eventReceived方法的具体用法?Java SignalEventSubscriptionEntity.eventReceived怎么用?Java SignalEventSubscriptionEntity.eventReceived使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity
的用法示例。
在下文中一共展示了SignalEventSubscriptionEntity.eventReceived方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity; //导入方法依赖的package包/类
public Void execute(CommandContext commandContext) {
List<SignalEventSubscriptionEntity> signalEvents = null;
if(executionId == null) {
signalEvents = commandContext.getEventSubscriptionManager()
.findSignalEventSubscriptionsByEventName(eventName);
} else {
signalEvents = commandContext.getEventSubscriptionManager()
.findSignalEventSubscriptionsByNameAndExecution(eventName, executionId);
if(signalEvents.isEmpty()) {
throw new ActivitiException("Execution '"+executionId+"' has not subscribed to a signal event with name '"+eventName+"'.");
}
}
HashMap<String, Object> payload = null;
if(variables != null) {
payload = new HashMap<String, Object>(variables);
}
for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : signalEvents) {
signalEventSubscriptionEntity.eventReceived(payload, false);
}
return null;
}
示例2: execute
import org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity; //导入方法依赖的package包/类
public void execute(ActivityExecution execution) throws Exception {
CommandContext commandContext = Context.getCommandContext();
List<SignalEventSubscriptionEntity> subscriptionEntities = null;
if (processInstanceScope) {
subscriptionEntities = commandContext
.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByProcessInstanceAndEventName(execution.getProcessInstanceId(), signalDefinition.getEventName());
} else {
subscriptionEntities = commandContext
.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByEventName(signalDefinition.getEventName());
}
for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : subscriptionEntities) {
signalEventSubscriptionEntity.eventReceived(null, signalDefinition.isAsync());
}
leave(execution);
}
示例3: execute
import org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity; //导入方法依赖的package包/类
@Override
public Void execute(CommandContext commandContext) {
List<SignalEventSubscriptionEntity> signalEvents = null;
if (executionId == null) {
signalEvents = commandContext.getEventSubscriptionEntityManager().findSignalEventSubscriptionsByEventName(eventName, tenantId);
} else {
ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(executionId);
if (execution == null) {
throw new ActivitiObjectNotFoundException("Cannot find execution with id '" + executionId + "'", Execution.class);
}
if (execution.isSuspended()) {
throw new ActivitiException("Cannot throw signal event '" + eventName
+ "' because execution '" + executionId + "' is suspended");
}
signalEvents = commandContext.getEventSubscriptionEntityManager().findSignalEventSubscriptionsByNameAndExecution(eventName, executionId);
if (signalEvents.isEmpty()) {
throw new ActivitiException("Execution '" + executionId + "' has not subscribed to a signal event with name '" + eventName + "'.");
}
}
for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : signalEvents) {
// We only throw the event to globally scoped signals.
// Process instance scoped signals must be thrown within the process itself
if (signalEventSubscriptionEntity.isGlobalScoped()) {
signalEventSubscriptionEntity.eventReceived(payload, async);
}
}
return null;
}
示例4: onEvent
import org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity; //导入方法依赖的package包/类
@Override
public void onEvent(FlowableEvent event) {
if (isValidEvent(event) && event instanceof FlowableEngineEvent) {
FlowableEngineEvent engineEvent = (FlowableEngineEvent) event;
if (engineEvent.getProcessInstanceId() == null && processInstanceScope) {
throw new ActivitiIllegalArgumentException(
"Cannot throw process-instance scoped signal, since the dispatched event is not part of an ongoing process instance");
}
CommandContext commandContext = Context.getCommandContext();
List<SignalEventSubscriptionEntity> subscriptionEntities = null;
if (processInstanceScope) {
subscriptionEntities = commandContext.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByProcessInstanceAndEventName(engineEvent.getProcessInstanceId(), signalName);
} else {
String tenantId = null;
if (engineEvent.getProcessDefinitionId() != null) {
ProcessDefinition processDefinition = commandContext.getProcessEngineConfiguration()
.getDeploymentManager().findDeployedProcessDefinitionById(engineEvent.getProcessDefinitionId());
tenantId = processDefinition.getTenantId();
}
subscriptionEntities = commandContext.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByEventName(signalName, tenantId);
}
for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : subscriptionEntities) {
signalEventSubscriptionEntity.eventReceived(null, false);
}
}
}
示例5: execute
import org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
CommandContext commandContext = Context.getCommandContext();
List<SignalEventSubscriptionEntity> subscriptionEntities = null;
if (processInstanceScope) {
subscriptionEntities = commandContext
.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByProcessInstanceAndEventName(execution.getProcessInstanceId(), signalDefinition.getEventName());
} else {
subscriptionEntities = commandContext
.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByEventName(signalDefinition.getEventName(), execution.getTenantId());
}
for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : subscriptionEntities) {
ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(signalEventSubscriptionEntity.getProcessDefinitionId());
if (Flowable5Util.isVersion5Tag(processDefinition.getEngineVersion())) {
signalEventSubscriptionEntity.eventReceived(null, signalDefinition.isAsync());
} else {
org.flowable.engine.ProcessEngineConfiguration flowable6ProcessEngineConfiguration = commandContext.getProcessEngineConfiguration()
.getFlowable5CompatibilityHandler()
.getFlowable6ProcessEngineConfiguration();
org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl flowable6ProcessEngineConfigurationImpl = (org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl) flowable6ProcessEngineConfiguration;
EventSubscriptionEntityManager eventSubScriptionEntityManager = flowable6ProcessEngineConfigurationImpl.getEventSubscriptionEntityManager();
EventSubscriptionEntity flowable6EventSubscription = eventSubScriptionEntityManager.findById(signalEventSubscriptionEntity.getId());
eventSubScriptionEntityManager.eventReceived(flowable6EventSubscription, null, signalDefinition.isAsync());
}
}
ActivityExecution activityExecution = (ActivityExecution) execution;
if (activityExecution.getActivity() != null) { // don't continue if process has already finished
leave(activityExecution);
}
}
示例6: execute
import org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity; //导入方法依赖的package包/类
public void execute(ActivityExecution execution) throws Exception {
CommandContext commandContext = Context.getCommandContext();
List<SignalEventSubscriptionEntity> findSignalEventSubscriptionsByEventName = commandContext
.getEventSubscriptionManager()
.findSignalEventSubscriptionsByEventName(signalDefinition.getSignalName());
for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : findSignalEventSubscriptionsByEventName) {
signalEventSubscriptionEntity.eventReceived(null, signalDefinition.isAsync());
}
leave(execution);
}
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:15,代码来源:IntermediateThrowSignalEventActivityBehavior.java
示例7: execute
import org.activiti.engine.impl.persistence.entity.SignalEventSubscriptionEntity; //导入方法依赖的package包/类
public Void execute(CommandContext commandContext) {
List<SignalEventSubscriptionEntity> signalEvents = null;
if(executionId == null) {
signalEvents = commandContext.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByEventName(eventName);
} else {
ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(executionId);
if (execution == null) {
throw new ActivitiObjectNotFoundException("Cannot find execution with id '" + executionId + "'", Execution.class);
}
if (execution.isSuspended()) {
throw new ActivitiException("Cannot throw signal event '" + eventName
+ "' because execution '" + executionId + "' is suspended");
}
signalEvents = commandContext.getEventSubscriptionEntityManager()
.findSignalEventSubscriptionsByNameAndExecution(eventName, executionId);
if(signalEvents.isEmpty()) {
throw new ActivitiException("Execution '"+executionId+"' has not subscribed to a signal event with name '"+eventName+"'.");
}
}
HashMap<String, Object> payload = null;
if(variables != null) {
payload = new HashMap<String, Object>(variables);
}
for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : signalEvents) {
// We only throw the event to globally scoped signals.
// Process instance scoped signals must be thrown within the process itself
if (signalEventSubscriptionEntity.isGlobalScoped()) {
signalEventSubscriptionEntity.eventReceived(payload, false);
}
}
return null;
}