Java Code Examples for org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl#isCmmnEnabled()

The following examples show how to use org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl#isCmmnEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractPersistenceSession.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
public void dbSchemaPrune() {
  ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
  if (isHistoryTablePresent() && !processEngineConfiguration.isDbHistoryUsed()) {
    dbSchemaDropHistory();
  }
  if (isIdentityTablePresent() && !processEngineConfiguration.isDbIdentityUsed()) {
    dbSchemaDropIdentity();
  }
  if (isCmmnTablePresent() && !processEngineConfiguration.isCmmnEnabled()) {
    dbSchemaDropCmmn();
  }
  if (isCmmnHistoryTablePresent() && (!processEngineConfiguration.isCmmnEnabled() || !processEngineConfiguration.isDbHistoryUsed())) {
    dbSchemaDropCmmnHistory();
  }
  if (isDmnTablePresent() && !processEngineConfiguration.isDmnEnabled()) {
    dbSchemaDropDmn();
  }
  if(isDmnHistoryTablePresent() && (!processEngineConfiguration.isDmnEnabled() || !processEngineConfiguration.isDbHistoryUsed())) {
    dbSchemaDropDmnHistory();
  }
}
 
Example 2
Source File: AbstractPersistenceSession.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public void dbSchemaDrop() {
  ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

  if (processEngineConfiguration.isDmnEnabled()) {
    dbSchemaDropDmn();

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

  if (processEngineConfiguration.isCmmnEnabled()) {
    dbSchemaDropCmmn();
  }

  dbSchemaDropEngine();

  if (processEngineConfiguration.isCmmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
    dbSchemaDropCmmnHistory();
  }

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

  if (processEngineConfiguration.isDbIdentityUsed()) {
    dbSchemaDropIdentity();
  }
}
 
Example 3
Source File: AbstractPersistenceSession.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public void dbSchemaUpdate() {
  ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

  if (!isEngineTablePresent()) {
    dbSchemaCreateEngine();
  }

  if (!isHistoryTablePresent() && processEngineConfiguration.isDbHistoryUsed()) {
    dbSchemaCreateHistory();
  }

  if (!isIdentityTablePresent() && processEngineConfiguration.isDbIdentityUsed()) {
    dbSchemaCreateIdentity();
  }

  if (!isCmmnTablePresent() && processEngineConfiguration.isCmmnEnabled()) {
    dbSchemaCreateCmmn();
  }

  if (!isCmmnHistoryTablePresent() && processEngineConfiguration.isCmmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
    dbSchemaCreateCmmnHistory();
  }

  if (!isDmnTablePresent() && processEngineConfiguration.isDmnEnabled()) {
    dbSchemaCreateDmn();
  }

  if(!isDmnHistoryTablePresent() && processEngineConfiguration.isDmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
    dbSchemaCreateDmnHistory();
  }

}
 
Example 4
Source File: ProcessApplicationManager.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected void logRegistration(Set<String> deploymentIds, ProcessApplicationReference reference) {

    if (!LOG.isInfoEnabled()) {
      // building the log message is expensive (db queries) so we avoid it if we can
      return;
    }

    try {
      StringBuilder builder = new StringBuilder();
      builder.append("ProcessApplication '");
      builder.append(reference.getName());
      builder.append("' registered for DB deployments ");
      builder.append(deploymentIds);
      builder.append(". ");

      List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
      List<CaseDefinition> caseDefinitions = new ArrayList<CaseDefinition>();

      CommandContext commandContext = Context.getCommandContext();
      ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
      boolean cmmnEnabled = processEngineConfiguration.isCmmnEnabled();

      for (String deploymentId : deploymentIds) {

        DeploymentEntity deployment = commandContext
          .getDbEntityManager()
          .selectById(DeploymentEntity.class, deploymentId);

        if(deployment != null) {

          processDefinitions.addAll(getDeployedProcessDefinitionArtifacts(deployment));

          if (cmmnEnabled) {
            caseDefinitions.addAll(getDeployedCaseDefinitionArtifacts(deployment));
          }

        }
      }

      logProcessDefinitionRegistrations(builder, processDefinitions);

      if (cmmnEnabled) {
        logCaseDefinitionRegistrations(builder, caseDefinitions);
      }

      LOG.registrationSummary(builder.toString());

    }
    catch(Throwable e) {
      LOG.exceptionWhileLoggingRegistrationSummary(e);
    }
  }
 
Example 5
Source File: AbstractPersistenceSession.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void dbSchemaCreate() {
  ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

  HistoryLevel configuredHistoryLevel = processEngineConfiguration.getHistoryLevel();
  if ( (!processEngineConfiguration.isDbHistoryUsed())
       && (!configuredHistoryLevel.equals(HistoryLevel.HISTORY_LEVEL_NONE))
     ) {
    throw LOG.databaseHistoryLevelException(configuredHistoryLevel.getName());
  }

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

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

  if (processEngineConfiguration.isDbIdentityUsed()) {
    dbSchemaCreateIdentity();
  }

  if (processEngineConfiguration.isCmmnEnabled()) {
    dbSchemaCreateCmmn();
  }

  if (processEngineConfiguration.isCmmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
    dbSchemaCreateCmmnHistory();
  }

  if (processEngineConfiguration.isDmnEnabled()) {
    dbSchemaCreateDmn();

    if(processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaCreateDmnHistory();
    }
  }
}
 
Example 6
Source File: HistoryCleanupHelper.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
/**
 * Creates next batch object for history cleanup. First searches for historic process instances ready for cleanup. If there is still some place left in batch (configured batch
 * size was not reached), searches for historic decision instances and also adds them to the batch. Then if there is still some place left in batch, searches for historic case
 * instances and historic batches - and adds them to the batch.
 *
 * @param commandContext
 * @return
 */
public static void prepareNextBatch(HistoryCleanupBatch historyCleanupBatch, CommandContext commandContext) {
  final HistoryCleanupJobHandlerConfiguration configuration = historyCleanupBatch.getConfiguration();
  final Integer batchSize = getHistoryCleanupBatchSize(commandContext);
  ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();

  //add process instance ids
  final List<String> historicProcessInstanceIds = commandContext.getHistoricProcessInstanceManager()
      .findHistoricProcessInstanceIdsForCleanup(batchSize, configuration.getMinuteFrom(), configuration.getMinuteTo());
  if (historicProcessInstanceIds.size() > 0) {
    historyCleanupBatch.setHistoricProcessInstanceIds(historicProcessInstanceIds);
  }

  //if batch is not full, add decision instance ids
  if (historyCleanupBatch.size() < batchSize && processEngineConfiguration.isDmnEnabled()) {
    final List<String> historicDecisionInstanceIds = commandContext.getHistoricDecisionInstanceManager()
        .findHistoricDecisionInstanceIdsForCleanup(batchSize - historyCleanupBatch.size(), configuration.getMinuteFrom(), configuration.getMinuteTo());
    if (historicDecisionInstanceIds.size() > 0) {
      historyCleanupBatch.setHistoricDecisionInstanceIds(historicDecisionInstanceIds);
    }
  }

  //if batch is not full, add case instance ids
  if (historyCleanupBatch.size() < batchSize && processEngineConfiguration.isCmmnEnabled()) {
    final List<String> historicCaseInstanceIds = commandContext.getHistoricCaseInstanceManager()
        .findHistoricCaseInstanceIdsForCleanup(batchSize - historyCleanupBatch.size(), configuration.getMinuteFrom(), configuration.getMinuteTo());
    if (historicCaseInstanceIds.size() > 0) {
      historyCleanupBatch.setHistoricCaseInstanceIds(historicCaseInstanceIds);
    }
  }

  //if batch is not full, add batch ids
  Map<String, Integer> batchOperationsForHistoryCleanup = processEngineConfiguration.getParsedBatchOperationsForHistoryCleanup();
  if (historyCleanupBatch.size() < batchSize && batchOperationsForHistoryCleanup != null && !batchOperationsForHistoryCleanup.isEmpty()) {
    List<String> historicBatchIds = commandContext
        .getHistoricBatchManager()
        .findHistoricBatchIdsForCleanup(batchSize - historyCleanupBatch.size(), batchOperationsForHistoryCleanup, configuration.getMinuteFrom(), configuration.getMinuteTo());
    if (historicBatchIds.size() > 0) {
      historyCleanupBatch.setHistoricBatchIds(historicBatchIds);
    }
  }
}