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

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


  public ProcessDefinitionEntity resolveProcessDefinition(ProcessDefinitionEntity processDefinition) {
    String processDefinitionId = processDefinition.getId();
    String deploymentId = processDefinition.getDeploymentId();
    processDefinition = processDefinitionCache.get(processDefinitionId);
    if (processDefinition==null) {
      DeploymentEntity deployment = Context
        .getCommandContext()
        .getDeploymentManager()
        .findDeploymentById(deploymentId);
      deployment.setNew(false);
      deploy(deployment);
      processDefinition = processDefinitionCache.get(processDefinitionId);
     
      if (processDefinition==null) {
        throw new ActivitiException("deployment '"+deploymentId+"' didn't put process definition '"+processDefinitionId+"' in the cache");
View Full Code Here


  public DeployCmd(DeploymentBuilderImpl deploymentBuilder) {
    this.deploymentBuilder = deploymentBuilder;
  }

  public Deployment execute(CommandContext commandContext) {
    DeploymentEntity deployment = deploymentBuilder.getDeployment();

    deployment.setDeploymentTime(ClockUtil.getCurrentTime());

    if ( deploymentBuilder.isDuplicateFilterEnabled() ) {
      DeploymentEntity existingDeployment = Context
        .getCommandContext()
        .getDeploymentManager()
        .findLatestDeploymentByName(deployment.getName());
     
      if ( (existingDeployment!=null)
View Full Code Here

  }

  @Test
  public void testDeployments() {
    when(repositoryService.createDeploymentQuery()).thenReturn(deploymentQuery);
    DeploymentEntity deployment = new DeploymentEntity();
    List<Deployment> deploymentList = new ArrayList<Deployment>();
    deployment.setId("testDeploymentId");
    deployment.setName("testDeploymentName");
    deployment.setTenantId("tenantId");
    deploymentList.add(deployment);
    when(deploymentQuery.list()).thenReturn(deploymentList);

    List<List<String>> result = processDefinitionsMBean.getDeployments();
    assertNotNull(result);
View Full Code Here

  public SimulationEvent apply(ActivitiEvent event) {
    if (ActivitiEventType.ENTITY_CREATED.equals(event.getType()) &&
      (event instanceof ActivitiEntityEvent) &&
      ((ActivitiEntityEvent) event).getEntity() instanceof DeploymentEntity) {

      DeploymentEntity deploymentEntity = (DeploymentEntity) ((ActivitiEntityEvent) event).getEntity();

      Map<String, Object> simEventProperties = new HashMap<String, Object>();
      simEventProperties.put(resourcesKey, deploymentEntity.getResources());

      return new SimulationEvent.Builder(simulationEventType).
                  simulationTime(Context.getProcessEngineConfiguration().getClock().getCurrentTime().getTime()).
                  properties(simEventProperties).
                  build();
View Full Code Here

  public DeployCmd(DeploymentBuilderImpl deploymentBuilder) {
    this.deploymentBuilder = deploymentBuilder;
  }

  public Deployment execute(CommandContext commandContext) {
    DeploymentEntity deployment = deploymentBuilder.getDeployment();

    deployment.setDeploymentTime(commandContext.getProcessEngineConfiguration().getClock().getCurrentTime());

    if ( deploymentBuilder.isDuplicateFilterEnabled() ) {
     
      List<Deployment> existingDeployments = new ArrayList<Deployment>();
      if (deployment.getTenantId() == null || ProcessEngineConfiguration.NO_TENANT_ID.equals(deployment.getTenantId())) {
        DeploymentEntity existingDeployment = commandContext
            .getDeploymentEntityManager()
            .findLatestDeploymentByName(deployment.getName());
        if (existingDeployment != null) {
          existingDeployments.add(existingDeployment);
        }
      } else {
         List<Deployment> deploymentList = commandContext
             .getProcessEngineConfiguration().getRepositoryService()
             .createDeploymentQuery()
             .deploymentName(deployment.getName())
             .deploymentTenantId(deployment.getTenantId())
             .orderByDeploymentId().desc().list();
        
         if (!deploymentList.isEmpty()) {
           existingDeployments.addAll(deploymentList);
         }
      }
         
      DeploymentEntity existingDeployment = null;
      if(!existingDeployments.isEmpty()) {
        existingDeployment = (DeploymentEntity) existingDeployments.get(0);
      }
     
      if ( (existingDeployment!=null)
View Full Code Here

      throw new ActivitiIllegalArgumentException("deploymentId is null");
    }
   
    // Update all entities
   
    DeploymentEntity deployment = commandContext.getDeploymentEntityManager().findDeploymentById(deploymentId);
    if (deployment == null) {
      throw new ActivitiObjectNotFoundException("Could not find deployment with id " + deploymentId, Deployment.class);
    }
    String oldTenantId = deployment.getTenantId();
    deployment.setTenantId(newTenantId);
   
   
    // Doing process instances, executions and tasks with direct SQL updates (otherwise would not be performant)
    commandContext.getProcessDefinitionEntityManager().updateProcessDefinitionTenantIdForDeployment(deploymentId, newTenantId);
    commandContext.getExecutionEntityManager().updateExecutionTenantIdForDeployment(deploymentId, newTenantId);
View Full Code Here

   
    if (deploymentId == null) {
      throw new ActivitiIllegalArgumentException("Deployment id is null");
    }
   
    DeploymentEntity deployment = commandContext
            .getDeploymentEntityManager()
            .findDeploymentById(deploymentId);

    if (deployment == null) {
      throw new ActivitiObjectNotFoundException("No deployment found for id = '" + deploymentId + "'", Deployment.class);
    }
   
    // Update category
    deployment.setCategory(category);
   
    if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
      commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
          ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_UPDATED, deployment));
    }
View Full Code Here

  public ProcessDefinitionEntity resolveProcessDefinition(ProcessDefinitionEntity processDefinition) {
    String processDefinitionId = processDefinition.getId();
    String deploymentId = processDefinition.getDeploymentId();
    processDefinition = processDefinitionCache.get(processDefinitionId);
    if (processDefinition==null) {
      DeploymentEntity deployment = Context
        .getCommandContext()
        .getDeploymentEntityManager()
        .findDeploymentById(deploymentId);
      deployment.setNew(false);
      deploy(deployment, null);
      processDefinition = processDefinitionCache.get(processDefinitionId);
     
      if (processDefinition==null) {
        throw new ActivitiException("deployment '"+deploymentId+"' didn't put process definition '"+processDefinitionId+"' in the cache");
View Full Code Here

  public void removeDeployment(String deploymentId, boolean cascade) {
    DeploymentEntityManager deploymentEntityManager = Context
        .getCommandContext()
        .getDeploymentEntityManager();
   
    DeploymentEntity deployment = deploymentEntityManager.findDeploymentById(deploymentId);
    if(deployment == null)
      throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", DeploymentEntity.class);

    // Remove any process definition from the cache
    List<ProcessDefinition> processDefinitions = new ProcessDefinitionQueryImpl(Context.getCommandContext())
View Full Code Here

    return (ProcessDefinitionEntity) execution.getProcessDefinition();
  }

  public DeploymentEntity getDeployment() {
    String deploymentId = getProcessDefinition().getDeploymentId();
    DeploymentEntity deployment = Context
      .getCommandContext()
      .getDeploymentEntityManager()
      .findDeploymentById(deploymentId);
    return deployment;
  }
View Full Code Here

TOP

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

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.