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

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


  protected void addProcessImage(ProcessDefinition processDefinition, HistoricProcessInstance processInstance) {
    if(currentEmbedded != null) {
      mainPanel.removeComponent(currentEmbedded);
    }
   
    ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
      .getDeployedProcessDefinition(processDefinition.getId());

    // Only show when graphical notation is defined
    if (processDefinitionEntity != null && processDefinitionEntity.isGraphicalNotationDefined()) {
     
      if(imageHeader == null) {
        imageHeader = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
        imageHeader.addStyleName(ExplorerLayout.STYLE_H3);
        imageHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
View Full Code Here


* @author Tom Baeyens
*/
public class JsonProcessDefinitionConverter extends JsonObjectConverter<ProcessDefinition> {

  public JSONObject toJsonObject(ProcessDefinition processDefinition) {
    ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) processDefinition;
    JSONObject jsonObject = new JSONObject();
    jsonObject.put("id", processDefinitionEntity.getId());
    if (processDefinitionEntity.getKey()!=null) {
      jsonObject.put("key", processDefinitionEntity.getKey());
    }
    if (processDefinitionEntity.getDeploymentId()!=null) {
      jsonObject.put("deploymentId", processDefinitionEntity.getDeploymentId());
    }
    return jsonObject;
  }
View Full Code Here

*/
public class WebServiceUELTest extends AbstractWebServiceTaskTest {

  @Deployment
  public void testWebServiceInvocationWithDataFlowUEL() throws Exception {
    ProcessDefinitionEntity processDefinition = processEngineConfiguration
      .getCommandExecutorTxRequiresNew()
      .execute(new Command<ProcessDefinitionEntity>() {
        public ProcessDefinitionEntity execute(CommandContext commandContext) {
          return Context
            .getProcessEngineConfiguration()
            .getDeploymentCache()
            .findDeployedLatestProcessDefinitionByKey("webServiceInvocationWithDataFlowUEL");
        }
      });
 
      ItemDefinition itemDefinition = processDefinition.getIoSpecification().getDataInputs().get(0).getDefinition();

    ItemInstance itemInstance = itemDefinition.createInstance();
    FieldBaseStructureInstance structureInstance = (FieldBaseStructureInstance) itemInstance.getStructureInstance();
    structureInstance.setFieldValue("prefix", "The counter has the value ");
    structureInstance.setFieldValue("suffix", ". Good news");
View Full Code Here

  @Deployment
  public void testAsyncInvocationWithDataFlowUEL() throws Exception {
    assertEquals(-1, counter.getCount());

    ProcessDefinitionEntity processDefinition = processEngineConfiguration
      .getCommandExecutorTxRequiresNew()
      .execute(new Command<ProcessDefinitionEntity>() {
        public ProcessDefinitionEntity execute(CommandContext commandContext) {
          return Context
            .getProcessEngineConfiguration()
            .getDeploymentCache()
            .findDeployedLatestProcessDefinitionByKey("asyncWebServiceInvocationWithDataFlowUEL");
        }
      });
   
    ItemDefinition itemDefinition = processDefinition.getIoSpecification().getDataInputs().get(0).getDefinition();

    ItemInstance itemInstance = itemDefinition.createInstance();
    FieldBaseStructureInstance structureInstance = (FieldBaseStructureInstance) itemInstance.getStructureInstance();
    structureInstance.setFieldValue("newCounterValue", 23);
View Full Code Here

    ProcessDefinitionImpl currentProcessDefinitionImpl = processInstance.getProcessDefinition();

    DeploymentCache deploymentCache = Context
      .getProcessEngineConfiguration()
      .getDeploymentCache();
    ProcessDefinitionEntity currentProcessDefinition;
    if (currentProcessDefinitionImpl instanceof ProcessDefinitionEntity) {
      currentProcessDefinition = (ProcessDefinitionEntity) currentProcessDefinitionImpl;
    } else {
      currentProcessDefinition = deploymentCache.findDeployedProcessDefinitionById(currentProcessDefinitionImpl.getId());
    }

    ProcessDefinitionEntity newProcessDefinition = deploymentCache
      .findDeployedProcessDefinitionByKeyAndVersion(currentProcessDefinition.getKey(), processDefinitionVersion);
   
    validateAndSwitchVersionOfExecution(commandContext, processInstance, newProcessDefinition);
   
    // switch the historic process instance to the new process definition version
    commandContext.getHistoryManager().recordProcessDefinitionChange(processInstanceId, newProcessDefinition.getId());
   
    // switch all sub-executions of the process instance to the new process definition version
    List<ExecutionEntity> childExecutions = executionManager
      .findChildExecutionsByParentExecutionId(processInstanceId);
    for (ExecutionEntity executionEntity : childExecutions) {
View Full Code Here

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

    }
    this.processDefinitionId = processDefinitionId;
  }

  public String execute(CommandContext commandContext) {
    ProcessDefinitionEntity processDefinition = Context
            .getProcessEngineConfiguration()
            .getDeploymentCache()
            .findDeployedProcessDefinitionById(processDefinitionId);
    DefaultFormHandler formHandler;
    if (taskDefinitionKey == null) {
      // TODO: Maybe add getFormKey() to FormHandler interface to avoid the following cast
      formHandler = (DefaultFormHandler) processDefinition.getStartFormHandler();
    } else {
      TaskDefinition taskDefinition = processDefinition.getTaskDefinitions().get(taskDefinitionKey);
      // TODO: Maybe add getFormKey() to FormHandler interface to avoid the following cast
      formHandler = (DefaultFormHandler) taskDefinition.getTaskFormHandler();
    }
    String formKey = null;
    if (formHandler.getFormKey() != null) {
View Full Code Here

    for (ProcessDefinitionEntity processDefinition : processDefinitions) {
     
      if (deployment.isNew()) {
        int processDefinitionVersion;

        ProcessDefinitionEntity latestProcessDefinition = processDefinitionManager.findLatestProcessDefinitionByKey(processDefinition.getKey());
        if (latestProcessDefinition != null) {
          processDefinitionVersion = latestProcessDefinition.getVersion() + 1;
        } else {
          processDefinitionVersion = 1;
        }

        processDefinition.setVersion(processDefinitionVersion);
        processDefinition.setDeploymentId(deployment.getId());

        String nextId = idGenerator.getNextId();
        String processDefinitionId = processDefinition.getKey()
          + ":" + processDefinition.getVersion()
          + ":" + nextId; // ACT-505
                  
        // ACT-115: maximum id length is 64 charcaters
        if (processDefinitionId.length() > 64) {         
          processDefinitionId = nextId;
        }
        processDefinition.setId(processDefinitionId);

        removeObsoleteTimers(processDefinition);
        addTimerDeclarations(processDefinition);
       
        removeObsoleteMessageEventSubscriptions(processDefinition, latestProcessDefinition);
        addMessageEventSubscriptions(processDefinition);

        dbSqlSession.insert(processDefinition);
        deploymentCache.addProcessDefinition(processDefinition);
        addAuthorizations(processDefinition);

       
      } else {
        String deploymentId = deployment.getId();
        processDefinition.setDeploymentId(deploymentId);
        ProcessDefinitionEntity persistedProcessDefinition = processDefinitionManager.findProcessDefinitionByDeploymentAndKey(deploymentId, processDefinition.getKey());
        processDefinition.setId(persistedProcessDefinition.getId());
        processDefinition.setVersion(persistedProcessDefinition.getVersion());
        processDefinition.setSuspensionState(persistedProcessDefinition.getSuspensionState());
       
        deploymentCache.addProcessDefinition(processDefinition);
        addAuthorizations(processDefinition);

      }
View Full Code Here

    if (property != null) {
      activityId = property.toString();
    }
    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId)
        .singleResult();
    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
        .getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
    List<ActivityImpl> activitiList = processDefinition.getActivities();//获得当前任务的所有节点

    List<Map<String, Object>> activityInfos = new ArrayList<Map<String, Object>>();
    for (ActivityImpl activity : activitiList) {

      boolean currentActiviti = false;
View Full Code Here

    String procDefId = workflowEntity.getProcessDefinition().getId();
    List<ActivityImpl> actImpls = new ArrayList<ActivityImpl>();
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
    ProcessDefinitionImpl pdImpl = (ProcessDefinitionImpl) processDefinition;
    String processDefinitionId = pdImpl.getId();// 流程标识
    ProcessDefinitionEntity def = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processDefinitionId);
    List<ActivityImpl> activitiList = def.getActivities();// 获得当前任务的所有节点
    List<String> activeActivityIds = runtimeService.getActiveActivityIds(processInstanceId);
    for (String activeId : activeActivityIds) {
      for (ActivityImpl activityImpl : activitiList) {
        String id = activityImpl.getId();
        if (activityImpl.isScope()) {
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.