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

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


    processDefinition = resolveProcessDefinition(processDefinition);
    return processDefinition;
  }

  public ProcessDefinitionEntity findDeployedLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) {
    ProcessDefinitionEntity processDefinition = Context
      .getCommandContext()
      .getProcessDefinitionEntityManager()
      .findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);
    if (processDefinition==null) {
      throw new ActivitiObjectNotFoundException("no processes deployed with key '"+processDefinitionKey+"' for tenant identifier '" + tenantId + "'", ProcessDefinition.class);
View Full Code Here


    processDefinition = resolveProcessDefinition(processDefinition);
    return processDefinition;
  }

  public ProcessDefinitionEntity findDeployedProcessDefinitionByKeyAndVersion(String processDefinitionKey, Integer processDefinitionVersion) {
    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) Context
      .getCommandContext()
      .getProcessDefinitionEntityManager()
      .findProcessDefinitionByKeyAndVersion(processDefinitionKey, processDefinitionVersion);
    if (processDefinition==null) {
      throw new ActivitiObjectNotFoundException("no processes deployed with key = '" + processDefinitionKey + "' and version = '" + processDefinitionVersion + "'", ProcessDefinition.class);
View Full Code Here

    this.processDefinitionId = processDefinitionId;
  }
 
  @SuppressWarnings({"unchecked", "rawtypes"})
  public List<IdentityLink> execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = commandContext
        .getProcessDefinitionEntityManager()
        .findProcessDefinitionById(processDefinitionId);
     
    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("Cannot find process definition with id " + processDefinitionId, ProcessDefinition.class);
    }
   
    List<IdentityLink> identityLinks = (List) processDefinition.getIdentityLinks();
    return identityLinks;
  }
View Full Code Here

    if (processDefinitionId == null) {
      throw new ActivitiIllegalArgumentException("processDefinitionId is null");
    }

    // Find the bpmn 2.0 xml resource name which is stored on the process definition
    ProcessDefinitionEntity processDefinitionEntity = commandContext
            .getProcessDefinitionEntityManager()
            .findProcessDefinitionById(processDefinitionId);
   
    if (processDefinitionEntity == null) {
      throw new ActivitiObjectNotFoundException("Process definition does not exist: " + processDefinitionId, ProcessDefinitionEntity.class);
    }

    // Fetch the resource
    String resourceName = processDefinitionEntity.getResourceName();
    ResourceEntity resource = commandContext.getResourceEntityManager()
            .findResourceByDeploymentIdAndResourceName(processDefinitionEntity.getDeploymentId(), resourceName);
    if (resource == null) {
      if (commandContext.getDeploymentEntityManager().findDeploymentById(processDefinitionEntity.getDeploymentId()) == null) {
        throw new ActivitiObjectNotFoundException("deployment for process definition does not exist: "
      + processDefinitionEntity.getDeploymentId(), Deployment.class);
      } else {
        throw new ActivitiObjectNotFoundException("no resource found with name '" + resourceName
                + "' in deployment '" + processDefinitionEntity.getDeploymentId() + "'", InputStream.class);
      }
    }
   
    // Convert the bpmn 2.0 xml to a bpmn model
    BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
View Full Code Here

  public GetStartFormCmd(String processDefinitionId) {
    this.processDefinitionId = processDefinitionId;
  }

  public StartFormData execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = commandContext
      .getProcessEngineConfiguration()
      .getDeploymentManager()
      .findDeployedProcessDefinitionById(processDefinitionId);
    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId +"'", ProcessDefinition.class);
    }
   
    StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
    if (startFormHandler == null) {
      throw new ActivitiException("No startFormHandler defined in process '" + processDefinitionId +"'");
    }
   
   
View Full Code Here

    }
    this.processDefinitionId = processDefinitionId;
  }

  public InputStream execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = commandContext
            .getProcessEngineConfiguration()
            .getDeploymentManager()
            .findDeployedProcessDefinitionById(processDefinitionId);
    String deploymentId = processDefinition.getDeploymentId();
    String resourceName = processDefinition.getResourceName();
    InputStream processModelStream =
            new GetDeploymentResourceCmd(deploymentId, resourceName)
            .execute(commandContext);
    return processModelStream;
  }
View Full Code Here

      if (execution != null) {
        activity = execution.getProcessDefinition().findActivity(job.getJobHandlerConfiguration());
      }
    } else if (TimerStartEventJobHandler.TYPE.equals(type)) {
      DeploymentManager deploymentManager = commandContext.getProcessEngineConfiguration().getDeploymentManager();
      ProcessDefinitionEntity processDefinition = 
          deploymentManager.findDeployedLatestProcessDefinitionByKeyAndTenantId(job.getJobHandlerConfiguration(), job.getTenantId());
      if (processDefinition != null) {
        activity = processDefinition.getInitial();
      }
    } else if (AsyncContinuationJobHandler.TYPE.equals(type)) {
      ExecutionEntity execution = fetchExecutionEntity(commandContext, job.getExecutionId());
      if (execution != null) {
        activity = execution.getActivity();
View Full Code Here

    }
    this.processDefinitionId = processDefinitionId;
  }

  public InputStream execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = commandContext
            .getProcessEngineConfiguration()
            .getDeploymentManager()
            .findDeployedProcessDefinitionById(processDefinitionId);
    String deploymentId = processDefinition.getDeploymentId();
    String resourceName = processDefinition.getDiagramResourceName();
    if (resourceName == null ) {
      log.info("Resource name is null! No process diagram stream exists.");
      return null;
    } else {
      InputStream processDiagramStream =
View Full Code Here

    List<ProcessDefinitionEntity> processDefinitionEntities = new ArrayList<ProcessDefinitionEntity>();
    ProcessDefinitionEntityManager processDefinitionManager = commandContext.getProcessDefinitionEntityManager();
   
    if(processDefinitionId != null) {
     
      ProcessDefinitionEntity processDefinitionEntity = processDefinitionManager.findProcessDefinitionById(processDefinitionId);
      if(processDefinitionEntity == null) {
        throw new ActivitiObjectNotFoundException("Cannot find process definition for id '"+processDefinitionId+"'", ProcessDefinition.class);
      }
      processDefinitionEntities.add(processDefinitionEntity);
     
View Full Code Here

   
    if (processDefinitionId == null) {
      throw new ActivitiIllegalArgumentException("Process definition id is null");
    }
   
    ProcessDefinitionEntity processDefinition = commandContext
            .getProcessDefinitionEntityManager()
            .findProcessDefinitionById(processDefinitionId);

    if (processDefinition == null) {
      throw new ActivitiObjectNotFoundException("No process definition found for id = '" + processDefinitionId + "'", ProcessDefinition.class);
    }
   
    // Update category
    processDefinition.setCategory(category);
   
    // Remove process definition from cache, it will be refetched later
    DeploymentCache<ProcessDefinitionEntity> processDefinitionCache =
        commandContext.getProcessEngineConfiguration().getProcessDefinitionCache();
    if (processDefinitionCache != null) {
View Full Code Here

TOP

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

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.