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

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

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

Task.addModificationImmediate介绍

[英]Changes in-memory and in-repo representations immediately.
[中]立即更改内存和回购表示。

代码示例

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

public void setRootTaskOidImmediate(Task task, String oid, OperationResult result) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException {
  Collection<PrismReferenceValue> values = new ArrayList<>();
  if (StringUtils.isNotEmpty(oid)) {
    values.add(createObjectRef(oid, TASK).asReferenceValue());
  }
  task.addModificationImmediate(
      prismContext.deltaFor(TaskType.class)
          .item(F_WORKFLOW_CONTEXT, F_ROOT_TASK_REF).replace(values)
          .asItemDelta(),
      result);
}

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

private void setOrCheckTaskKind(Task task, OperationResult opResult)
    throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException {
  TaskKindType taskKind = task.getWorkManagement() != null ? task.getWorkManagement().getTaskKind() : null;
  if (taskKind == null) {
    ItemDelta<?, ?> itemDelta = prismContext.deltaFor(TaskType.class)
        .item(TaskType.F_WORK_MANAGEMENT, TaskWorkManagementType.F_TASK_KIND)
        .replace(TaskKindType.COORDINATOR)
        .asItemDelta();
    task.addModificationImmediate(itemDelta, opResult);
  } else if (taskKind != TaskKindType.COORDINATOR) {
    throw new IllegalStateException("Task has incompatible task kind; expected " + TaskKindType.COORDINATOR +
        " but having: " + task.getWorkManagement() + " in " + task);
  }
}

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

private void setOrCheckTaskKind(Task masterTask, OperationResult opResult)
    throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException {
  TaskKindType taskKind = masterTask.getWorkManagement() != null ? masterTask.getWorkManagement().getTaskKind() : null;
  if (taskKind == null) {
    ItemDelta<?, ?> itemDelta = getPrismContext().deltaFor(TaskType.class)
        .item(TaskType.F_WORK_MANAGEMENT, TaskWorkManagementType.F_TASK_KIND)
        .replace(TaskKindType.PARTITIONED_MASTER)
        .asItemDelta();
    masterTask.addModificationImmediate(itemDelta, opResult);
  } else if (taskKind != TaskKindType.PARTITIONED_MASTER) {
    throw new IllegalStateException("Partitioned task has incompatible task kind: " + masterTask.getWorkManagement() + " in " + masterTask);
  }
}

相关文章