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


Java JobEntity.getProcessInstanceId方法代码示例

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


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

示例1: execute

import org.activiti.engine.impl.persistence.entity.JobEntity; //导入方法依赖的package包/类
public AcquiredJobs execute(CommandContext commandContext) {
  
  String lockOwner = jobExecutor.getLockOwner();
  int lockTimeInMillis = jobExecutor.getLockTimeInMillis();
  int maxNonExclusiveJobsPerAcquisition = jobExecutor.getMaxJobsPerAcquisition();
  
  AcquiredJobs acquiredJobs = new AcquiredJobs();
  List<JobEntity> jobs = commandContext
    .getJobEntityManager()
    .findNextJobsToExecute(new Page(0, maxNonExclusiveJobsPerAcquisition));

  for (JobEntity job: jobs) {
    List<String> jobIds = new ArrayList<String>();
    if (job != null && !acquiredJobs.contains(job.getId())) {
      if (job.isExclusive() && job.getProcessInstanceId() != null) {
        // acquire all exclusive jobs in the same process instance
        // (includes the current job)
        List<JobEntity> exclusiveJobs = commandContext.getJobEntityManager()
          .findExclusiveJobsToExecute(job.getProcessInstanceId());
        for (JobEntity exclusiveJob : exclusiveJobs) {
          if(exclusiveJob != null) {
            lockJob(exclusiveJob, lockOwner, lockTimeInMillis);
            jobIds.add(exclusiveJob.getId());
          }
        }
      } else {
        lockJob(job, lockOwner, lockTimeInMillis);
        jobIds.add(job.getId());
      }
      
    }

    acquiredJobs.addJobIdBatch(jobIds);
  }

  return acquiredJobs;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:38,代码来源:AcquireJobsCmd.java

示例2: getProcessId

import org.activiti.engine.impl.persistence.entity.JobEntity; //导入方法依赖的package包/类
private String getProcessId(CommandContext commandContext) {
    JobEntity job = commandContext.getJobEntityManager().findJobById(jobId);
    return job.getProcessInstanceId();
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:5,代码来源:AbortFailedProcessCommandFactory.java

示例3: execute

import org.activiti.engine.impl.persistence.entity.JobEntity; //导入方法依赖的package包/类
public AcquiredJobs execute(CommandContext commandContext) {
  
  String lockOwner = jobExecutor.getLockOwner();
  int lockTimeInMillis = jobExecutor.getLockTimeInMillis();
  int maxJobsPerAcquisition = jobExecutor.getMaxJobsPerAcquisition();    
  int jobsInThisAcquisition = 0;
  
  AcquiredJobs acquiredJobs = new AcquiredJobs();
  List<JobEntity> jobs = commandContext
    .getJobManager()
    .findNextJobsToExecute(new Page(0, maxJobsPerAcquisition));
      
  for (JobEntity job: jobs) {
    List<String> jobIds = new ArrayList<String>();

    if (job != null && !acquiredJobs.contains(job.getId())) {     
      if (job.isExclusive() && job.getProcessInstanceId() != null) {
        // acquire all exclusive jobs in the same process instance
        // (includes the current job)
        List<JobEntity> exclusiveJobs = commandContext.getJobManager()
          .findExclusiveJobsToExecute(job.getProcessInstanceId());
        for (JobEntity exclusiveJob : exclusiveJobs) {   
          if(exclusiveJob != null) {
            lockJob(exclusiveJob, lockOwner, lockTimeInMillis);
            jobIds.add(exclusiveJob.getId());
          }
        }
      } else {
        lockJob(job, lockOwner, lockTimeInMillis);
        jobIds.add(job.getId());        
      }
      
    } 

    acquiredJobs.addJobIdBatch(jobIds);
    
    jobsInThisAcquisition += jobIds.size();
    if(jobsInThisAcquisition >= maxJobsPerAcquisition) {
      break;
    }      
  }
  
  return acquiredJobs;
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:45,代码来源:AcquireJobsCmd.java


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