public void executeMandatorySchemaResource(String operation, String component) { executeSchemaResource(operation, component, getResourceForDbOperation(operation, operation, component), false); }
nextVersion, component); executeSchemaResource("upgrade", component, getResourceForDbOperation("upgrade",
public void executeSchemaResource(String operation, String component, String resourceName, boolean isOptional) { InputStream inputStream = null; try { inputStream = ReflectUtil.getResourceAsStream(resourceName); if (inputStream == null) { if (isOptional) { log.info("no schema resource {} for {}", resourceName, operation); } else { throw new ActivitiException("resource '" + resourceName + "' is not available"); } } else { executeSchemaResource(operation, component, resourceName, inputStream); } } finally { IoUtil.closeSilently(inputStream); } }
public void executeMandatorySchemaResource(String operation, String component) { executeSchemaResource(operation, component, getResourceForDbOperation(operation, operation, component), false); }
public void executeMandatorySchemaResource(String operation, String component) { executeSchemaResource(operation, component, getResourceForDbOperation(operation, operation, component), false); }
protected void dbSchemaUpgrade(String component, String dbVersion) { log.info("upgrading activiti {} schema from {} to {}", component, dbVersion, 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++; } }
protected void dbSchemaUpgrade(final String component, final int currentDatabaseVersionsIndex) { ActivitiVersion activitiVersion = ACTIVITI_VERSIONS.get(currentDatabaseVersionsIndex); String dbVersion = activitiVersion.getMainVersion(); log.info("upgrading activiti {} schema from {} to {}", component, dbVersion, ProcessEngine.VERSION); // Actual execution of schema DDL SQL for (int i = currentDatabaseVersionsIndex + 1; i < ACTIVITI_VERSIONS.size(); i++) { String nextVersion = ACTIVITI_VERSIONS.get(i).getMainVersion(); // Taking care of -SNAPSHOT version in development if (nextVersion.endsWith("-SNAPSHOT")) { nextVersion = nextVersion.substring(0, nextVersion.length() - "-SNAPSHOT".length()); } dbVersion = dbVersion.replace(".", ""); nextVersion = nextVersion.replace(".", ""); log.info("Upgrade needed: {} -> {}. Looking for schema update resource for component '{}'", dbVersion, nextVersion, component); executeSchemaResource("upgrade", component, getResourceForDbOperation("upgrade", "upgradestep." + dbVersion + ".to." + nextVersion, component), true); dbVersion = nextVersion; } }
public void executeSchemaResource(String operation, String component, String resourceName, boolean isOptional) { InputStream inputStream = null; try { inputStream = ReflectUtil.getResourceAsStream(resourceName); if (inputStream == null) { if (isOptional) { log.info("no schema resource {} for {}", resourceName, operation); } else { throw new ActivitiException("resource '" + resourceName + "' is not available"); } } else { executeSchemaResource(operation, component, resourceName, inputStream); } } finally { IoUtil.closeSilently(inputStream); } }
public void executeSchemaResource(String operation, String component, String resourceName, boolean isOptional) { InputStream inputStream = null; try { inputStream = ReflectUtil.getResourceAsStream(resourceName); if (inputStream == null) { if (isOptional) { log.debug("no schema resource {} for {}", resourceName, operation); } else { throw new ActivitiException("resource '" + resourceName + "' is not available"); } } else { executeSchemaResource(operation, component, resourceName, inputStream); } } finally { IoUtil.closeSilently(inputStream); } }