当前位置: 首页>>代码示例>>Java>>正文


Java ProcessEngine.VERSION属性代码示例

本文整理汇总了Java中org.activiti.engine.ProcessEngine.VERSION属性的典型用法代码示例。如果您正苦于以下问题:Java ProcessEngine.VERSION属性的具体用法?Java ProcessEngine.VERSION怎么用?Java ProcessEngine.VERSION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.activiti.engine.ProcessEngine的用法示例。


在下文中一共展示了ProcessEngine.VERSION属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dbSchemaUpgrade

protected void dbSchemaUpgrade(String component, String dbVersion) {
  log.info("upgrading activiti "+component+" schema from "+dbVersion+" to "+ProcessEngine.VERSION);
  
  if (dbVersion.endsWith("-SNAPSHOT")) {
    dbVersion = dbVersion.substring(0, dbVersion.length()-"-SNAPSHOT".length());
  }
  int minorDbVersionNumber = Integer.parseInt(dbVersion.substring(2));
  
  String libraryVersion = ProcessEngine.VERSION;
  if (ProcessEngine.VERSION.endsWith("-SNAPSHOT")) {
    libraryVersion = ProcessEngine.VERSION.substring(0, ProcessEngine.VERSION.length()-"-SNAPSHOT".length());
  }
  int minorLibraryVersionNumber = Integer.parseInt(libraryVersion.substring(2));
  
  while (minorDbVersionNumber<minorLibraryVersionNumber) {
    executeSchemaResource("upgrade", component, getResourceForDbOperation("upgrade", "upgradestep.5"+minorDbVersionNumber+".to.5"+(minorDbVersionNumber+1), component), true);
    minorDbVersionNumber++;
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:DbSqlSession.java

示例2: dbSchemaCheckVersion

public void dbSchemaCheckVersion() {
    try {
        String dbVersion = getDbVersion();
        if (!ProcessEngine.VERSION.equals(dbVersion)) {
            throw new ActivitiWrongDbException(ProcessEngine.VERSION, dbVersion);
        }

        String errorMessage = null;
        if (!isEngineTablePresent()) {
            errorMessage = addMissingComponent(errorMessage, "engine");
        }
        if (dbSqlSessionFactory.isDbHistoryUsed() && !isHistoryTablePresent()) {
            errorMessage = addMissingComponent(errorMessage, "history");
        }

        if (errorMessage != null) {
            throw new ActivitiException("Activiti database problem: " + errorMessage);
        }

    } catch (Exception e) {
        if (isMissingTablesException(e)) {
            throw new ActivitiException(
                    "no activiti tables in db. set <property name=\"databaseSchemaUpdate\" to value=\"true\" or value=\"create-drop\" (use create-drop for testing only!) in bean processEngineConfiguration in flowable.cfg.xml for automatic schema creation",
                    e);
        } else {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            } else {
                throw new ActivitiException("couldn't get db schema version", e);
            }
        }
    }

    LOGGER.debug("activiti db schema check successful");
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:35,代码来源:DbSqlSession.java

示例3: dbSchemaCreate

public void dbSchemaCreate() {
  ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
  
  int configuredHistoryLevel = processEngineConfiguration.getHistoryLevel();
  if ( (!processEngineConfiguration.isDbHistoryUsed())
       && (configuredHistoryLevel>ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE)
     ) {
    throw new ActivitiException("historyLevel config is higher then 'none' and dbHistoryUsed is set to false");
  }

  if (isEngineTablePresent()) {
    String dbVersion = getDbVersion();
    if (!ProcessEngine.VERSION.equals(dbVersion)) {
      throw new ActivitiWrongDbException(ProcessEngine.VERSION, dbVersion);
    }
  } else {
    dbSchemaCreateEngine();
  }

  if (processEngineConfiguration.isDbHistoryUsed()) {
    dbSchemaCreateHistory();
  }

  if (processEngineConfiguration.isDbIdentityUsed()) {
    dbSchemaCreateIdentity();
  }
  if (processEngineConfiguration.isDbCycleUsed()) {
    dbSchemaCreateCycle();
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:30,代码来源:DbSqlSession.java

示例4: dbSchemaCheckVersion

public void dbSchemaCheckVersion() {
  try {
    String dbVersion = getDbVersion();
    if (!ProcessEngine.VERSION.equals(dbVersion)) {
      throw new ActivitiWrongDbException(ProcessEngine.VERSION, dbVersion);
    }

    String errorMessage = null;
    if (!isEngineTablePresent()) {
      errorMessage = addMissingComponent(errorMessage, "engine");
    }
    if (dbSqlSessionFactory.isDbHistoryUsed() && !isHistoryTablePresent()) {
      errorMessage = addMissingComponent(errorMessage, "history");
    }
    if (dbSqlSessionFactory.isDbIdentityUsed() && !isIdentityTablePresent()) {
      errorMessage = addMissingComponent(errorMessage, "identity");
    }
    if (dbSqlSessionFactory.isDbCycleUsed() && !isCycleTablePresent()) {
      errorMessage = addMissingComponent(errorMessage, "cycle");
    }
    
    Integer configuredHistoryLevel = Context.getProcessEngineConfiguration().getHistoryLevel();
    PropertyEntity historyLevelProperty = selectById(PropertyEntity.class, "historyLevel");
    if (historyLevelProperty==null) {
      if (errorMessage==null) {
        errorMessage = "";
      }
      errorMessage += "no historyLevel property specified";
    } else {
      Integer databaseHistoryLevel = new Integer(historyLevelProperty.getValue());
      if (!configuredHistoryLevel.equals(databaseHistoryLevel)) {
        if (errorMessage==null) {
          errorMessage = "";
        }
        errorMessage += "historyLevel mismatch: configuration says "+configuredHistoryLevel+" and database says "+databaseHistoryLevel;
      }
    }
    
    if (errorMessage!=null) {
      throw new ActivitiException("Activiti database problem: "+errorMessage);
    }

  } catch (Exception e) {
    if (isMissingTablesException(e)) {
      throw new ActivitiException("no activiti tables in db.  set <property name=\"databaseSchemaUpdate\" to value=\"true\" or value=\"create-drop\" (use create-drop for testing only!) in bean processEngineConfiguration in activiti.cfg.xml for automatic schema creation", e);
    } else {
      if (e instanceof RuntimeException) {
        throw (RuntimeException) e;
      } else {
        throw new ActivitiException("couldn't get db schema version", e);
      }
    }
  }

  log.fine("activiti db schema check successful");
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:56,代码来源:DbSqlSession.java


注:本文中的org.activiti.engine.ProcessEngine.VERSION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。