Package com.founder.fix.fixflow.core.impl.db

Examples of com.founder.fix.fixflow.core.impl.db.DbSqlSession


   

    CommandContext commandContext = Context.getCommandContext();
    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();

    int processDefinitionVersion;

    ProcessDefinitionBehavior latestProcessDefinition = processDefinitionManager.findLatestProcessDefinitionByKey(process.getProcessDefinitionKey());
    if (latestProcessDefinition != null) {
      processDefinitionVersion = latestProcessDefinition.getVersion() + 1;
    } else {
      processDefinitionVersion = 1;
    }
   
   
    if(deployment.getUpdateDeploymentId()!=null&&!deployment.getUpdateDeploymentId().equals("")){
     
      String deploymentId = deployment.getId();
      process.setDeploymentId(deploymentId);
      ProcessDefinitionBehavior persistedProcessDefinition = processDefinitionManager.findProcessDefinitionByDeploymentAndKey(
          deploymentId, process.getProcessDefinitionKey());
      //process.setId(persistedProcessDefinition.getId());
      process.setVersion(persistedProcessDefinition.getVersion());
      process.setProcessDefinitionId(persistedProcessDefinition.getProcessDefinitionId());
      Context.getProcessEngineConfiguration().getDeploymentCache().removeProcessDefinition(process.getProcessDefinitionId());
     
    }else{
     

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

      String processDefinitionId = process.getProcessDefinitionKey() + ":" + process.getVersion() + ":" + GuidUtil.CreateGuid(); // GUID

      process.setProcessDefinitionId(processDefinitionId);

      dbSqlSession.insert("insertProcessDefinition", process);
    }
   
   
    //Context.getProcessEngineConfiguration().getDeploymentCache().removeProcessDefinition(processDefinitionId);
    //Context.getProcessEngineConfiguration().getDeploymentCache().addProcessDefinition(process);
View Full Code Here


 
  // getters and setters
  // //////////////////////////////////////////////////////

  public DbSqlSession getDbSqlSession() {
    return new DbSqlSession(Context.getDbConnection(), Context.getCacheObject());
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.impl.db.DbSqlSession

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.