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

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

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

TaskManager.searchObjects介绍

[英]Notes: Implemented options are: - noFetch: it causes task manager NOT to ask remote nodes about node/task status. - (for tasks) TaskType.F_NEXT_RUN_START_TIMESTAMP: it can be used to disable asking Quartz for next run start time - other options that are passed down to repository
[中]注意:实现的选项有:-noFetch:它使任务管理器不向远程节点询问节点/任务状态。-(对于任务)任务类型。F_NEXT_RUN_START_TIMESTAMP:它可以用来禁止向Quartz询问下一次运行开始时间——其他传递到存储库的选项

代码示例

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

private Collection<String> getNodeIdentifiers(WorkerTasksPerNodeConfigurationType perNodeConfig, OperationResult opResult)
    throws SchemaException {
  if (!perNodeConfig.getNodeIdentifier().isEmpty()) {
    return perNodeConfig.getNodeIdentifier();
  } else {
    SearchResultList<PrismObject<NodeType>> nodes = taskManager.searchObjects(NodeType.class, null, null, opResult);
    return nodes.stream()
        .filter(n -> n.asObjectable().getExecutionStatus() == NodeExecutionStatusType.RUNNING)
        .map(n -> n.asObjectable().getNodeIdentifier())
        .collect(Collectors.toSet());
  }
}

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

private Map<String, String> getMidpointToActiviti(OperationResult result) throws SchemaException {
  final Map<String,String> rv = new HashMap<>();
  final List<PrismObject<TaskType>> tasks = taskManager.searchObjects(TaskType.class, null, null, result);
  int tasksWithProcessId = 0;
  for (PrismObject<TaskType> taskObject : tasks) {
    final TaskType task = taskObject.asObjectable();
    final WfContextType wfc = task.getWorkflowContext();
    final String pid = wfc != null ? wfc.getProcessInstanceId() : null;
    rv.put(task.getOid(), pid);
    if (pid != null) {
      tasksWithProcessId++;
    }
  }
  LOGGER.info("Found {} tasks; among these, {} have a pointer to process instance id", rv.size(), tasksWithProcessId);
  return rv;
}

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

private Set<String> getProcessInstancesToKeep(OperationResult result) throws SchemaException {
  ObjectQuery query = prismContext.queryFor(TaskType.class)
      .not().item(TaskType.F_WORKFLOW_CONTEXT, WfContextType.F_PROCESS_INSTANCE_ID).isNull()
      .build();
  SearchResultList<PrismObject<TaskType>> tasks = taskManager.searchObjects(TaskType.class, query, null, result);
  return tasks.stream()
      .map(t -> t.asObjectable().getWorkflowContext().getProcessInstanceId())
      .collect(Collectors.toSet());
}

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

break;
case TASK_MANAGER:
  list = taskManager.searchObjects(type, processedQuery, options, result);
  if (workflowManager != null && TaskType.class.isAssignableFrom(type) && !GetOperationOptions.isRaw(rootOptions) && !GetOperationOptions.isNoFetch(rootOptions)) {
    workflowManager.augmentTaskObjectList(list, options, task, result);

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

.item(TaskType.F_OBJECT_REF).ref(campaign.getOid())
    .build();
List<PrismObject<TaskType>> tasks = taskManager.searchObjects(TaskType.class, query, null, result);
assertEquals("unexpected number of related tasks", 1, tasks.size());
waitForTaskFinish(tasks.get(0).getOid(), true);

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

.item(TaskType.F_OBJECT_REF).ref(campaign.getOid())
    .build();
List<PrismObject<TaskType>> tasks = taskManager.searchObjects(TaskType.class, query, null, result);
assertEquals("unexpected number of related tasks", 1, tasks.size());
waitForTaskFinish(tasks.get(0).getOid(), true);

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

.item(TaskType.F_OBJECT_REF).ref(campaign.getOid())
    .build();
List<PrismObject<TaskType>> tasks = taskManager.searchObjects(TaskType.class, query, null, result);
assertEquals("unexpected number of related tasks", 1, tasks.size());
waitForTaskFinish(tasks.get(0).getOid(), true);

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

.item(TaskType.F_OBJECT_REF).ref(campaign.getOid())
    .build();
List<PrismObject<TaskType>> tasks = taskManager.searchObjects(TaskType.class, query, null, result);
assertEquals("unexpected number of related tasks", 1, tasks.size());
waitForTaskFinish(tasks.get(0).getOid(), true);

相关文章