use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DeploymentManager method deleteDecisionDeployment.
protected void deleteDecisionDeployment(String deploymentId, boolean cascade) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
if (processEngineConfiguration.isDmnEnabled()) {
DecisionDefinitionManager decisionDefinitionManager = getDecisionDefinitionManager();
List<DecisionDefinition> decisionDefinitions = decisionDefinitionManager.findDecisionDefinitionByDeploymentId(deploymentId);
if (cascade) {
// delete historic decision instances
for (DecisionDefinition decisionDefinition : decisionDefinitions) {
getHistoricDecisionInstanceManager().deleteHistoricDecisionInstancesByDecisionDefinitionId(decisionDefinition.getId());
}
}
// delete decision definitions from db
decisionDefinitionManager.deleteDecisionDefinitionsByDeploymentId(deploymentId);
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
for (DecisionDefinition decisionDefinition : decisionDefinitions) {
String decisionDefinitionId = decisionDefinition.getId();
// remove decision definitions from cache:
deploymentCache.removeDecisionDefinition(decisionDefinitionId);
}
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class HistoricBatchManager method completeHistoricBatch.
public void completeHistoricBatch(final BatchEntity batch) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.BATCH_END, batch)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createBatchEndEvent(batch);
}
});
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class HistoricBatchManager method createHistoricBatch.
public void createHistoricBatch(final BatchEntity batch) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.BATCH_START, batch)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createBatchStartEvent(batch);
}
});
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class StringUtil method fromBytes.
/**
* converts a byte array into a string using the provided process engine's default charset as
* returned by {@link ProcessEngineConfigurationImpl#getDefaultCharset()}
*
* @param bytes the byte array
* @param processEngine the process engine
* @return a string representing the bytes
*/
public static String fromBytes(byte[] bytes, ProcessEngine processEngine) {
ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
Charset charset = processEngineConfiguration.getDefaultCharset();
return new String(bytes, charset);
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class StringUtil method readerFromBytes.
public static Reader readerFromBytes(byte[] bytes) {
EnsureUtil.ensureActiveCommandContext("StringUtil.readerFromBytes");
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
return new InputStreamReader(inputStream, processEngineConfiguration.getDefaultCharset());
}
Aggregations