Package org.activiti.engine.impl.persistence.entity

Examples of org.activiti.engine.impl.persistence.entity.MessageEventSubscriptionEntity


   
    if(messageName == null) {
      throw new ActivitiException("Cannot start process instance by message: message name is null");
    }
   
    MessageEventSubscriptionEntity messageEventSubscription = commandContext.getEventSubscriptionManager()
      .findMessageStartEventSubscriptionByName(messageName);
   
    if(messageEventSubscription == null) {
      throw new ActivitiException("Cannot start process instance by message: no subscription to message with name '"+messageName+"' found.");
    }
   
    String processDefinitionId = messageEventSubscription.getConfiguration();
    if(processDefinitionId == null) {
      throw new ActivitiException("Cannot start process instance by message: subscription to message with name '"+messageName+"' is not a message start event.");
    }
       
    DeploymentCache deploymentCache = Context
            .getProcessEngineConfiguration()
            .getDeploymentCache();
         
    ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
    if (processDefinition == null) {
        throw new ActivitiException("No process definition found for id '" + processDefinitionId + "'");
    }
 
    ActivityImpl startActivity = processDefinition.findActivity(messageEventSubscription.getActivityId());
    ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey, startActivity);

    if (processVariables != null) {
      processInstance.setVariables(processVariables);
    }
View Full Code Here


   
    processEngineConfiguration.getCommandExecutor()
      .execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity1 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity1.setEventName("messageName");       
          messageEventSubscriptionEntity1.setActivityId("someActivity");         
          messageEventSubscriptionEntity1.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity2 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity2.setEventName("messageName");
          messageEventSubscriptionEntity2.setActivityId("someActivity");
          messageEventSubscriptionEntity2.insert();
         
          SignalEventSubscriptionEntity signalEventSubscriptionEntity3 = new SignalEventSubscriptionEntity();
          signalEventSubscriptionEntity3.setEventName("messageName2");
          signalEventSubscriptionEntity3.setActivityId("someOtherActivity");
          signalEventSubscriptionEntity3.insert();
View Full Code Here

   
    processEngineConfiguration.getCommandExecutor()
      .execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity1 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity1.setEventName("messageName");
          messageEventSubscriptionEntity1.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity2 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity2.setEventName("messageName");
          messageEventSubscriptionEntity2.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity3 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity3.setEventName("messageName2");
          messageEventSubscriptionEntity3.insert();
         
          return null;
        }
      });
   
View Full Code Here

   
    processEngineConfiguration.getCommandExecutor()
      .execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity1 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity1.setEventName("messageName");         
          messageEventSubscriptionEntity1.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity2 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity2.setEventName("messageName");
          messageEventSubscriptionEntity2.insert();
         
          SignalEventSubscriptionEntity signalEventSubscriptionEntity3 = new SignalEventSubscriptionEntity();
          signalEventSubscriptionEntity3.setEventName("messageName2");
          signalEventSubscriptionEntity3.insert();
         
View Full Code Here

  }

  public EventSubscriptionEntity prepareEventSubscriptionEntity(ExecutionEntity execution) {
    EventSubscriptionEntity eventSubscriptionEntity = null;
    if(eventType.equals("message")) {
      eventSubscriptionEntity = new MessageEventSubscriptionEntity(execution);
    }else  if(eventType.equals("signal")) {
      eventSubscriptionEntity = new SignalEventSubscriptionEntity(execution);
    }else {
      throw new ActivitiIllegalArgumentException("Found event definition of unknown type: "+eventType);
    }
View Full Code Here

          if(!subscriptionsForSameMessageName.isEmpty()) {
            throw new ActivitiException("Cannot deploy process definition '" + processDefinition.getResourceName()
                    + "': there already is a message event subscription for the message with name '" + eventDefinition.getEventName() + "'.");
          }
         
          MessageEventSubscriptionEntity newSubscription = new MessageEventSubscriptionEntity();
          newSubscription.setEventName(eventDefinition.getEventName());
          newSubscription.setActivityId(eventDefinition.getActivityId());
          newSubscription.setConfiguration(processDefinition.getId());

          if (processDefinition.getTenantId() != null) {
            newSubscription.setTenantId(processDefinition.getTenantId());
          }
         
          newSubscription.insert();
        }
      }
    }     
  }
View Full Code Here

   
    if(messageName == null) {
      throw new ActivitiIllegalArgumentException("Cannot start process instance by message: message name is null");
    }
   
    MessageEventSubscriptionEntity messageEventSubscription = commandContext.getEventSubscriptionEntityManager()
      .findMessageStartEventSubscriptionByName(messageName, tenantId);
   
    if(messageEventSubscription == null) {
      throw new ActivitiObjectNotFoundException("Cannot start process instance by message: no subscription to message with name '"+messageName+"' found.", MessageEventSubscriptionEntity.class);
    }
   
    String processDefinitionId = messageEventSubscription.getConfiguration();
    if(processDefinitionId == null) {
      throw new ActivitiException("Cannot start process instance by message: subscription to message with name '"+messageName+"' is not a message start event.");
    }
       
    DeploymentManager deploymentCache = commandContext
            .getProcessEngineConfiguration()
            .getDeploymentManager();
         
    ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
    if (processDefinition == null) {
        throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
    }
 
    ActivityImpl startActivity = processDefinition.findActivity(messageEventSubscription.getActivityId());
    ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey, startActivity);

    if (processVariables != null) {
      processInstance.setVariables(processVariables);
    }
View Full Code Here

   
    processEngineConfiguration.getCommandExecutorTxRequired()
      .execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity1 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity1.setEventName("messageName");       
          messageEventSubscriptionEntity1.setActivityId("someActivity");         
          messageEventSubscriptionEntity1.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity2 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity2.setEventName("messageName");
          messageEventSubscriptionEntity2.setActivityId("someActivity");
          messageEventSubscriptionEntity2.insert();
         
          SignalEventSubscriptionEntity signalEventSubscriptionEntity3 = new SignalEventSubscriptionEntity();
          signalEventSubscriptionEntity3.setEventName("messageName2");
          signalEventSubscriptionEntity3.setActivityId("someOtherActivity");
          signalEventSubscriptionEntity3.insert();
View Full Code Here

   
    processEngineConfiguration.getCommandExecutorTxRequired()
      .execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity1 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity1.setEventName("messageName");
          messageEventSubscriptionEntity1.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity2 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity2.setEventName("messageName");
          messageEventSubscriptionEntity2.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity3 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity3.setEventName("messageName2");
          messageEventSubscriptionEntity3.insert();
         
          return null;
        }
      });
   
View Full Code Here

   
    processEngineConfiguration.getCommandExecutorTxRequired()
      .execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity1 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity1.setEventName("messageName");         
          messageEventSubscriptionEntity1.insert();
         
          MessageEventSubscriptionEntity messageEventSubscriptionEntity2 = new MessageEventSubscriptionEntity();
          messageEventSubscriptionEntity2.setEventName("messageName");
          messageEventSubscriptionEntity2.insert();
         
          SignalEventSubscriptionEntity signalEventSubscriptionEntity3 = new SignalEventSubscriptionEntity();
          signalEventSubscriptionEntity3.setEventName("messageName2");
          signalEventSubscriptionEntity3.insert();
         
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.persistence.entity.MessageEventSubscriptionEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.