当前位置: 首页>>代码示例>>Java>>正文


Java CommandContext.getByteArrayManager方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.impl.interceptor.CommandContext.getByteArrayManager方法的典型用法代码示例。如果您正苦于以下问题:Java CommandContext.getByteArrayManager方法的具体用法?Java CommandContext.getByteArrayManager怎么用?Java CommandContext.getByteArrayManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.impl.interceptor.CommandContext的用法示例。


在下文中一共展示了CommandContext.getByteArrayManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:33,代码来源:DeleteProcessInstancesJobHandler.java

示例2: 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();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:42,代码来源:AbstractBatchJobHandler.java


注:本文中的org.camunda.bpm.engine.impl.interceptor.CommandContext.getByteArrayManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。