com.evolveum.midpoint.task.api.Task.getWorkState()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中com.evolveum.midpoint.task.api.Task.getWorkState()方法的一些代码示例,展示了Task.getWorkState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getWorkState()方法的具体详情如下:
包路径:com.evolveum.midpoint.task.api.Task
类名称:Task
方法名:getWorkState

Task.getWorkState介绍

暂无

代码示例

代码示例来源:origin: Evolveum/midpoint

@NotNull
private TaskWorkStateType getWorkState(Task task) throws SchemaException {
  if (task.getWorkState() != null) {
    return task.getWorkState();
  } else {
    throw new SchemaException("No work state in task " + task);
  }
}

代码示例来源:origin: Evolveum/midpoint

public static Task findWorkerByBucketNumber(List<Task> workers, int sequentialNumber) {
  for (Task worker : workers) {
    if (worker.getWorkState() != null && TaskWorkStateTypeUtil
        .findBucketByNumber(worker.getWorkState().getBucket(), sequentialNumber) != null) {
      return worker;
    }
  }
  return null;
}

代码示例来源:origin: Evolveum/midpoint

private void setOrUpdateEstimatedNumberOfBuckets(Task task, WorkSegmentationStrategy workStateStrategy, OperationResult result)
    throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException {
  Integer number = workStateStrategy.estimateNumberOfBuckets(task.getWorkState());
  if (number != null && (task.getWorkState() == null || !number.equals(task.getWorkState().getNumberOfBuckets()))) {
    List<ItemDelta<?, ?>> itemDeltas = prismContext.deltaFor(TaskType.class)
        .item(TaskType.F_WORK_STATE, TaskWorkStateType.F_NUMBER_OF_BUCKETS).replace(number)
        .asItemDeltas();
    repositoryService.modifyObject(TaskType.class, task.getOid(), itemDeltas, result);
  }
}

代码示例来源:origin: Evolveum/midpoint

int created = createWorkers(coordinatorTask, shouldBeWorkers, perNodeConfigurationMap, result);
TaskWorkStateType workState = coordinatorTask.getWorkState();
Integer closedBecauseDone = null;
if (isCloseWorkersOnWorkDone(options) && workState != null && Boolean.TRUE.equals(workState.isAllWorkComplete())) {

代码示例来源:origin: Evolveum/midpoint

setOrCheckTaskKind(task, opResult);
List<Task> workers = task.listSubtasks(true, opResult);
boolean clean = task.getWorkState() == null || Boolean.TRUE.equals(task.getWorkState().isAllWorkComplete());

代码示例来源:origin: Evolveum/midpoint

throws SchemaException, PreconditionViolationException, ObjectNotFoundException, ObjectAlreadyExistsException {
List<Task> workers = coordinatorTask.listSubtasks(true, result);
if (coordinatorTask.getWorkState() == null) {
  return false;
TaskWorkStateType newState = coordinatorTask.getWorkState().clone();
int reclaiming = 0;
for (WorkBucketType bucket : newState.getBucket()) {

代码示例来源:origin: Evolveum/midpoint

buckets = new ArrayList<>(coordinator.getWorkState().getBucket());
sortBucketsBySequentialNumber(buckets);
buckets = new ArrayList<>(coordinator.getWorkState().getBucket());
sortBucketsBySequentialNumber(buckets);
assertEquals(3, buckets.size());

相关文章