Task task = taskManager.createTaskInstance(MyClass.class.getName() + ".myOperation"); OperationResult result = task.getResult();
The Task structure provides a context to most midPoint operations and functions. It contains contextual information such as identity of the user that invoked the operation, it contains security context, it may be bound to scheduling data and so on. It also holds the operation result data structure. Each "business" operation in midPoint should be executed in a context of a task.