本文整理了Java中com.evolveum.midpoint.task.api.Task.savePendingModifications()
方法的一些代码示例,展示了Task.savePendingModifications()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.savePendingModifications()
方法的具体详情如下:
包路径:com.evolveum.midpoint.task.api.Task
类名称:Task
方法名:savePendingModifications
[英]Saves modifications done against the in-memory version of the task into the repository.
[中]将针对任务的内存版本所做的修改保存到存储库中。
代码示例来源:origin: Evolveum/midpoint
public void commitChanges(OperationResult result) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException {
task.savePendingModifications(result);
}
代码示例来源:origin: Evolveum/midpoint
private void setExpectedTotalToNull(Task coordinatorTask, OperationResult opResult) {
coordinatorTask.setExpectedTotal(null);
try {
coordinatorTask.savePendingModifications(opResult);
} catch (Throwable t) {
throw new SystemException("Couldn't update the task: " + t.getMessage(), t);
}
}
代码示例来源:origin: Evolveum/midpoint
private void scheduleSubtasksNow(List<Task> subtasks, Task masterTask, OperationResult opResult) throws SchemaException,
ObjectAlreadyExistsException, ObjectNotFoundException {
masterTask.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.RESCHEDULE); // i.e. close for single-run tasks
masterTask.savePendingModifications(opResult);
Set<String> dependents = getDependentTasksIdentifiers(subtasks);
// first set dependents to waiting, and only after that start runnables
for (Task subtask : subtasks) {
if (dependents.contains(subtask.getTaskIdentifier())) {
subtask.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.EXECUTE_IMMEDIATELY);
subtask.savePendingModifications(opResult);
}
}
for (Task subtask : subtasks) {
if (!dependents.contains(subtask.getTaskIdentifier())) {
taskManager.scheduleTaskNow(subtask, opResult);
}
}
}
代码示例来源:origin: Evolveum/midpoint
if (dependent.getExecutionStatus() == TaskExecutionStatus.SUSPENDED) {
dependent.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.EXECUTE_IMMEDIATELY);
dependent.savePendingModifications(opResult);
subtask.savePendingModifications(opResult);
代码示例来源:origin: Evolveum/midpoint
private void createAndStartSubtasks(TaskPartitionsDefinition partitionsDefinition, Task masterTask,
OperationResult opResult) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException {
List<Task> subtasksCreated;
try {
subtasksCreated = createSubtasks(partitionsDefinition, masterTask, opResult);
} catch (Throwable t) {
List<Task> subtasksToRollback = masterTask.listSubtasks(opResult);
taskManager.suspendAndDeleteTasks(TaskUtil.tasksToOids(subtasksToRollback), TaskManager.DO_NOT_WAIT, true,
opResult);
throw t;
}
masterTask.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.RESCHEDULE); // i.e. close for single-run tasks
masterTask.savePendingModifications(opResult);
List<Task> subtasksToResume = subtasksCreated.stream()
.filter(t -> t.getExecutionStatus() == TaskExecutionStatus.SUSPENDED)
.collect(Collectors.toList());
taskManager.resumeTasks(TaskUtil.tasksToOids(subtasksToResume), opResult);
LOGGER.info("Partitioned subtasks were successfully created and started for master {}", masterTask);
}
代码示例来源:origin: Evolveum/midpoint
filenameProp.setRealValue(input.getAbsolutePath());
task.setExtensionProperty(filenameProp);
task.savePendingModifications(result);
代码示例来源:origin: Evolveum/midpoint
taskManager.reconcileWorkers(task.getOid(), options, opResult);
task.savePendingModifications(opResult);
taskManager.resumeTasks(TaskUtil.tasksToOids(task.listSubtasks(true, opResult)), opResult);
LOGGER.info("Worker tasks were successfully created for coordinator {}", task);
代码示例来源:origin: Evolveum/midpoint
coordinatorTask.setExpectedTotal(expectedTotal);
try {
coordinatorTask.savePendingModifications(opResult);
} catch (ObjectAlreadyExistsException e) { // other exceptions are handled in the outer try block
throw new IllegalStateException(
代码示例来源:origin: Evolveum/midpoint
@Override
public void onProcessEnd(ProcessEvent event, WfTask wfTask, OperationResult result) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException {
Task task = wfTask.getTask();
// we simply put model context back into parent task
// (or if it is null, we set the task to skip model context processing)
// it is safe to directly access the parent, because (1) it is in waiting state, (2) we are its only child
Task rootTask = task.getParentTask(result);
SerializationSafeContainer<LensContextType> contextContainer = event.getVariable(GcpProcessVariableNames.VARIABLE_MODEL_CONTEXT, SerializationSafeContainer.class);
LensContextType lensContextType = null;
if (contextContainer != null) {
contextContainer.setPrismContext(prismContext);
lensContextType = contextContainer.getValue();
}
if (lensContextType == null) {
LOGGER.debug(GcpProcessVariableNames.VARIABLE_MODEL_CONTEXT + " not present in process, this means we should stop processing. Task = {}", rootTask);
wfTaskUtil.storeModelContext(rootTask, (ModelContext) null, false);
} else {
LOGGER.debug("Putting (changed or unchanged) value of {} into the task {}", GcpProcessVariableNames.VARIABLE_MODEL_CONTEXT, rootTask);
wfTaskUtil.storeModelContext(rootTask, lensContextType);
}
rootTask.savePendingModifications(result);
LOGGER.trace("onProcessEnd ending for task {}", task);
}
//endregion
代码示例来源:origin: Evolveum/midpoint
task.savePendingModifications(result); // just to be sure (if the task was already persistent)
} catch (ObjectNotFoundException e) {
LOGGER.error("Task object not found, expecting it to exist (task {})", task, e);
代码示例来源:origin: Evolveum/midpoint
objectclassProp.setRealValue(objectclass);
task.setExtensionProperty(objectclassProp);
task.savePendingModifications(result); // just to be sure (if the task was already persistent)
代码示例来源:origin: Evolveum/midpoint
task.savePendingModifications(result);
} catch (SchemaException | ObjectNotFoundException | ObjectAlreadyExistsException | ConfigurationException | ExpressionEvaluationException | RuntimeException | Error e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't prepare child model context", e);
代码示例来源:origin: Evolveum/midpoint
task001.savePendingModifications(result);
代码示例来源:origin: Evolveum/midpoint
task001.savePendingModifications(result); // however, this does not work, because 'modifyObject' in repo first reads object, overwriting any existing definitions ...
代码示例来源:origin: Evolveum/midpoint
task.savePendingModifications(result);
代码示例来源:origin: Evolveum/midpoint
task.setExtensionProperty(lastToken);
task.savePendingModifications(parentResult);
return processedChanges;
代码示例来源:origin: Evolveum/midpoint
taskManager.getPrismContext()));
try {
task.savePendingModifications(opResult);
} catch(Exception e) {
throw new SystemException("Cannot schedule L2 handler", e);
task.pushHandlerUri(AbstractTaskManagerTest.L3_TASK_HANDLER_URI, new ScheduleType(), null);
try {
task.savePendingModifications(opResult);
} catch(Exception e) {
throw new SystemException("Cannot schedule L3 handler", e);
代码示例来源:origin: Evolveum/midpoint
localCoordinatorTask.savePendingModifications(opResult);
} catch (ObjectAlreadyExistsException e) { // other exceptions are handled in the outer try block
throw new IllegalStateException(
内容来源于网络,如有侵权,请联系作者删除!