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


Java SignalEventSubscriptionEntity.eventReceived方法代碼示例

本文整理匯總了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;
}
 
開發者ID:iotsap,項目名稱:FiWare-Template-Handler,代碼行數:26,代碼來源:SignalEventReceivedCmd.java

示例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);        
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:22,代碼來源:IntermediateThrowSignalEventActivityBehavior.java

示例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;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:39,代碼來源:SignalEventReceivedCmd.java

示例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);
        }
    }
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:32,代碼來源:SignalThrowingEventListener.java

示例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);
    }
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:39,代碼來源:IntermediateThrowSignalEventActivityBehavior.java

示例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;
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:43,代碼來源:SignalEventReceivedCmd.java


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