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

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

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

TaskManager.addTask介绍

[英]Add new task. The OID provided in the task may be empty. In that case the OID will be assigned by the implementation of this method and it will be provided as return value. This operation should fail if such object already exists (if object with the provided OID already exists). The operation may fail if provided OID is in an unusable format for the storage. Generating own OIDs and providing them to this method is not recommended for normal operation. Should be atomic. Should not allow creation of two objects with the same OID (even if created in parallel). The operation may fail if the object to be created does not conform to the underlying schema of the storage system or the schema enforced by the implementation.
[中]添加新任务。任务中提供的OID可能为空。在这种情况下,OID将由该方法的实现分配,并作为返回值提供。如果此类对象已经存在(如果具有提供的OID的对象已经存在),则此操作将失败。如果提供的OID格式不适用于存储,则操作可能会失败。正常运行时,不建议生成自己的OID并将其提供给此方法。应该是原子的。不应允许创建具有相同OID的两个对象(即使是并行创建的)。如果要创建的对象不符合存储系统的基础架构或实现强制执行的架构,则操作可能会失败。

代码示例

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

String addTask(PrismObject<TaskType> taskPrism, RepoAddOptions options, OperationResult parentResult)
    throws ObjectAlreadyExistsException, SchemaException;

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

protected void addTask(File file) throws SchemaException, IOException, ObjectAlreadyExistsException {
  taskManager.addTask(prismContext.parseObject(file), new OperationResult("addTask"));
}

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

private String addTask(TaskType task, RepoAddOptions addOpt, OperationResult result)
    throws ObjectAlreadyExistsException {
  try {
    return taskManager.addTask(task.asPrismObject(), addOpt, result);
  } catch (ObjectAlreadyExistsException ex) {
    throw ex;
  } catch (Exception ex) {
    LoggingUtils.logException(LOGGER, "Couldn't add object {} to task manager", ex, task.getName());
    throw new SystemException(ex.getMessage(), ex);
  }
}

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

Assert.assertNotNull(taskManager, "Task manager is not initialized");
try {
  taskManager.addTask((PrismObject<TaskType>) object, result);
} catch (ObjectAlreadyExistsException ex) {
  result.recordFatalError(ex.getMessage(), ex);

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

taskManager.addTask(worker.asPrismObject(), result);
count++;

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

.ownerRef(userAdministrator.getOid(), UserType.COMPLEX_TYPE)
    .objectRef(USER_JACK_OID, UserType.COMPLEX_TYPE, SchemaConstants.ORG_DEFAULT);
String approvalTaskOid = taskManager.addTask(approvalTask.asPrismObject(), result);
System.out.println("Approval task OID = " + approvalTaskOid);

相关文章