本文整理汇总了Java中org.camunda.bpm.engine.impl.interceptor.CommandContext.getProcessEngineConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java CommandContext.getProcessEngineConfiguration方法的具体用法?Java CommandContext.getProcessEngineConfiguration怎么用?Java CommandContext.getProcessEngineConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.impl.interceptor.CommandContext
的用法示例。
在下文中一共展示了CommandContext.getProcessEngineConfiguration方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBatch
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected BatchEntity createBatch(CommandContext commandContext,
MigrationPlan migrationPlan,
Collection<String> processInstanceIds,
ProcessDefinitionEntity sourceProcessDefinition) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler<MigrationBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);
MigrationBatchConfiguration configuration = new MigrationBatchConfiguration(
new ArrayList<String>(processInstanceIds),
migrationPlan,
executionBuilder.isSkipCustomListeners(),
executionBuilder.isSkipIoMappings());
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
batch.setTenantId(sourceProcessDefinition.getTenantId());
commandContext.getBatchManager().insert(batch);
return batch;
}
示例2: createBatch
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected BatchEntity createBatch(CommandContext commandContext, List<AbstractProcessInstanceModificationCommand> instructions,
List<String> processInstanceIds, ProcessDefinitionEntity processDefinition) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler<RestartProcessInstancesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);
RestartProcessInstancesBatchConfiguration configuration = new RestartProcessInstancesBatchConfiguration(
processInstanceIds, instructions, builder.getProcessDefinitionId(), builder.isInitialVariables(), builder.isSkipCustomListeners(), builder.isSkipIoMappings(), builder.isWithoutBusinessKey());
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
batch.setTenantId(processDefinition.getTenantId());
commandContext.getBatchManager().insert(batch);
return batch;
}
示例3: createBatch
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler<SetRetriesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);
SetRetriesBatchConfiguration configuration = new SetRetriesBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getRetries());
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
commandContext.getBatchManager().insert(batch);
return batch;
}
示例4: createBatch
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected BatchEntity createBatch(CommandContext commandContext, List<String> ids) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration);
BatchConfiguration configuration = getAbstractIdsBatchConfiguration(ids);
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
commandContext.getBatchManager().insert(batch);
return batch;
}
示例5: createBatch
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration);
BatchConfiguration configuration = getAbstractIdsBatchConfiguration(new ArrayList<String>(processInstanceIds));
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, (UpdateProcessInstancesSuspendStateBatchConfiguration) configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
commandContext.getBatchManager().insert(batch);
return batch;
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:UpdateProcessInstancesSuspendStateBatchCmd.java
示例6: createBatch
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected BatchEntity createBatch(CommandContext commandContext, List<AbstractProcessInstanceModificationCommand> instructions,
Collection<String> processInstanceIds, ProcessDefinitionEntity processDefinition) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler<ModificationBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);
ModificationBatchConfiguration configuration = new ModificationBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getProcessDefinitionId(), instructions,
builder.isSkipCustomListeners(), builder.isSkipIoMappings());
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
batch.setTenantId(processDefinition.getTenantId());
commandContext.getBatchManager().insert(batch);
return batch;
}
示例7: processDefinitionTestProvider
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected static TestProvider processDefinitionTestProvider() {
return new TestProvider() {
@Override
public Command<ProcessApplicationReference> createGetProcessApplicationCommand(final String definitionId) {
return new Command<ProcessApplicationReference>() {
public ProcessApplicationReference execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl configuration = commandContext.getProcessEngineConfiguration();
DeploymentCache deploymentCache = configuration.getDeploymentCache();
ProcessDefinitionEntity definition = deploymentCache.findDeployedProcessDefinitionById(definitionId);
return ProcessApplicationContextUtil.getTargetProcessApplication(definition);
}
};
}
@Override
public String getLatestDefinitionIdByKey(RepositoryService repositoryService, String key) {
return repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult().getId();
}
};
}
示例8: caseDefinitionTestProvider
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected static TestProvider caseDefinitionTestProvider() {
return new TestProvider() {
@Override
public Command<ProcessApplicationReference> createGetProcessApplicationCommand(final String definitionId) {
return new Command<ProcessApplicationReference>() {
public ProcessApplicationReference execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl configuration = commandContext.getProcessEngineConfiguration();
DeploymentCache deploymentCache = configuration.getDeploymentCache();
CaseDefinitionEntity definition = deploymentCache.findDeployedCaseDefinitionById(definitionId);
return ProcessApplicationContextUtil.getTargetProcessApplication(definition);
}
};
}
@Override
public String getLatestDefinitionIdByKey(RepositoryService repositoryService, String key) {
return repositoryService.createCaseDefinitionQuery().caseDefinitionKey(key).latestVersion().singleResult().getId();
}
};
}
示例9: decisionDefinitionTestProvider
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected static TestProvider decisionDefinitionTestProvider() {
return new TestProvider() {
@Override
public Command<ProcessApplicationReference> createGetProcessApplicationCommand(final String definitionId) {
return new Command<ProcessApplicationReference>() {
public ProcessApplicationReference execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl configuration = commandContext.getProcessEngineConfiguration();
DeploymentCache deploymentCache = configuration.getDeploymentCache();
DecisionDefinitionEntity definition = deploymentCache.findDeployedDecisionDefinitionById(definitionId);
return ProcessApplicationContextUtil.getTargetProcessApplication(definition);
}
};
}
@Override
public String getLatestDefinitionIdByKey(RepositoryService repositoryService, String key) {
return repositoryService.createDecisionDefinitionQuery().decisionDefinitionKey(key).latestVersion().singleResult().getId();
}
};
}
示例10: decisionRequirementsDefinitionTestProvider
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected static TestProvider decisionRequirementsDefinitionTestProvider() {
return new TestProvider() {
@Override
public Command<ProcessApplicationReference> createGetProcessApplicationCommand(final String definitionId) {
return new Command<ProcessApplicationReference>() {
public ProcessApplicationReference execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl configuration = commandContext.getProcessEngineConfiguration();
DeploymentCache deploymentCache = configuration.getDeploymentCache();
DecisionRequirementsDefinitionEntity definition = deploymentCache.findDeployedDecisionRequirementsDefinitionById(definitionId);
return ProcessApplicationContextUtil.getTargetProcessApplication(definition);
}
};
}
@Override
public String getLatestDefinitionIdByKey(RepositoryService repositoryService, String key) {
return repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(key).latestVersion().singleResult().getId();
}
};
}
示例11: generateInstructions
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected List<MigrationInstruction> generateInstructions(CommandContext commandContext,
ProcessDefinitionImpl sourceProcessDefinition,
ProcessDefinitionImpl targetProcessDefinition,
boolean updateEventTriggers) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
// generate instructions
MigrationInstructionGenerator migrationInstructionGenerator = processEngineConfiguration.getMigrationInstructionGenerator();
ValidatingMigrationInstructions generatedInstructions = migrationInstructionGenerator.generate(sourceProcessDefinition, targetProcessDefinition, updateEventTriggers);
// filter only valid instructions
generatedInstructions.filterWith(processEngineConfiguration.getMigrationInstructionValidators());
return generatedInstructions.asMigrationInstructions();
}
示例12: getNextBatch
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
/**
* 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 HistoryCleanupBatch getNextBatch(CommandContext commandContext) {
final Integer batchSize = getHistoryCleanupBatchSize(commandContext);
HistoryCleanupBatch historyCleanupBatch = new HistoryCleanupBatch();
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
//add process instance ids
final List<String> historicProcessInstanceIds = commandContext.getHistoricProcessInstanceManager()
.findHistoricProcessInstanceIdsForCleanup(batchSize);
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());
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());
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);
if (historicBatchIds.size() > 0) {
historyCleanupBatch.setHistoricBatchIds(historicBatchIds);
}
}
return historyCleanupBatch;
}