本文整理汇总了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++;
}
}
示例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");
}
示例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();
}
}
示例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");
}