本文整理汇总了Java中org.camunda.bpm.engine.impl.interceptor.CommandContext.getJobManager方法的典型用法代码示例。如果您正苦于以下问题:Java CommandContext.getJobManager方法的具体用法?Java CommandContext.getJobManager怎么用?Java CommandContext.getJobManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.impl.interceptor.CommandContext
的用法示例。
在下文中一共展示了CommandContext.getJobManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSuspensionState
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
protected void updateSuspensionState(CommandContext commandContext, SuspensionState suspensionState) {
JobDefinitionManager jobDefinitionManager = commandContext.getJobDefinitionManager();
JobManager jobManager = commandContext.getJobManager();
if (jobDefinitionId != null) {
jobDefinitionManager.updateJobDefinitionSuspensionStateById(jobDefinitionId, suspensionState);
} else if (processDefinitionId != null) {
jobDefinitionManager.updateJobDefinitionSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
jobManager.updateStartTimerJobSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
} else if (processDefinitionKey != null) {
if (!isProcessDefinitionTenantIdSet) {
jobDefinitionManager.updateJobDefinitionSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
jobManager.updateStartTimerJobSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
} else {
jobDefinitionManager.updateJobDefinitionSuspensionStateByProcessDefinitionKeyAndTenantId(processDefinitionKey, processDefinitionTenantId, suspensionState);
jobManager.updateStartTimerJobSuspensionStateByProcessDefinitionKeyAndTenantId(processDefinitionKey, processDefinitionTenantId, suspensionState);
}
}
}
示例2: updateSuspensionState
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
protected void updateSuspensionState(CommandContext commandContext, SuspensionState suspensionState) {
JobManager jobManager = commandContext.getJobManager();
if (jobId != null) {
jobManager.updateJobSuspensionStateById(jobId, suspensionState);
} else if (jobDefinitionId != null) {
jobManager.updateJobSuspensionStateByJobDefinitionId(jobDefinitionId, suspensionState);
} else if (processInstanceId != null) {
jobManager.updateJobSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);
} else if (processDefinitionId != null) {
jobManager.updateJobSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
} else if (processDefinitionKey != null) {
if (!processDefinitionTenantIdSet) {
jobManager.updateJobSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
} else {
jobManager.updateJobSuspensionStateByProcessDefinitionKeyAndTenantId(processDefinitionKey, processDefinitionTenantId, suspensionState);
}
}
}
示例3: createJobEntities
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected void createJobEntities(BatchEntity batch, DeleteProcessInstanceBatchConfiguration configuration, String deploymentId,
List<String> processInstancesToHandle, int invocationsPerBatchJob) {
CommandContext commandContext = Context.getCommandContext();
ByteArrayManager byteArrayManager = commandContext.getByteArrayManager();
JobManager jobManager = commandContext.getJobManager();
int createdJobs = 0;
while (!processInstancesToHandle.isEmpty()) {
int lastIdIndex = Math.min(invocationsPerBatchJob, processInstancesToHandle.size());
// view of process instances for this job
List<String> idsForJob = processInstancesToHandle.subList(0, lastIdIndex);
DeleteProcessInstanceBatchConfiguration jobConfiguration = createJobConfiguration(configuration, idsForJob);
ByteArrayEntity configurationEntity = saveConfiguration(byteArrayManager, jobConfiguration);
JobEntity job = createBatchJob(batch, configurationEntity);
job.setDeploymentId(deploymentId);
jobManager.insertAndHintJobExecutor(job);
createdJobs++;
idsForJob.clear();
}
// update created jobs for batch
batch.setJobsCreated(batch.getJobsCreated() + createdJobs);
// update batch configuration
batch.setConfigurationBytes(writeConfiguration(configuration));
}
示例4: createJobs
import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public boolean createJobs(BatchEntity batch) {
CommandContext commandContext = Context.getCommandContext();
ByteArrayManager byteArrayManager = commandContext.getByteArrayManager();
JobManager jobManager = commandContext.getJobManager();
T configuration = readConfiguration(batch.getConfigurationBytes());
int batchJobsPerSeed = batch.getBatchJobsPerSeed();
int invocationsPerBatchJob = batch.getInvocationsPerBatchJob();
List<String> ids = configuration.getIds();
int numberOfItemsToProcess = Math.min(invocationsPerBatchJob * batchJobsPerSeed, ids.size());
// view of process instances to process
List<String> processIds = ids.subList(0, numberOfItemsToProcess);
int createdJobs = 0;
while (!processIds.isEmpty()) {
int lastIdIndex = Math.min(invocationsPerBatchJob, processIds.size());
// view of process instances for this job
List<String> idsForJob = processIds.subList(0, lastIdIndex);
T jobConfiguration = createJobConfiguration(configuration, idsForJob);
ByteArrayEntity configurationEntity = saveConfiguration(byteArrayManager, jobConfiguration);
JobEntity job = createBatchJob(batch, configurationEntity);
postProcessJob(configuration, job);
jobManager.insertAndHintJobExecutor(job);
idsForJob.clear();
createdJobs++;
}
// update created jobs for batch
batch.setJobsCreated(batch.getJobsCreated() + createdJobs);
// update batch configuration
batch.setConfigurationBytes(writeConfiguration(configuration));
return ids.isEmpty();
}