Class ActivityTreeUtil
- java.lang.Object
-
- com.evolveum.midpoint.schema.util.task.ActivityTreeUtil
-
public class ActivityTreeUtil extends Object
Utility methods for navigating throughout activity trees, potentially distributed throughout a task tree. (There are also variants that traverse only local activities in a task.)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ActivityTreeUtil.ActivityStateInContext
Activity state with all the necessary context: the path, the task, and the partial states of coordinated workers.static class
ActivityTreeUtil.ActivityStateInLocalContext
Activity state in local context: just the path and the state.static interface
ActivityTreeUtil.ActivityStateProcessor
static interface
ActivityTreeUtil.ActivityStateTransformer<X>
static interface
ActivityTreeUtil.LocalActivityStateProcessor
static interface
ActivityTreeUtil.LocalActivityStateTransformer<X>
-
Constructor Summary
Constructors Constructor Description ActivityTreeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull List<ActivityStateType>
getAllLocalStates(@NotNull TaskActivityStateType taskActivityState)
static @NotNull List<TaskType>
getSubtasksForPath(TaskType task, ActivityPath activityPath, TaskResolver taskResolver)
static boolean
hasDelegatedActivity(TreeNode<ActivityTreeUtil.ActivityStateInContext> node)
We know this by comparing task OIDs (except for worker ones): all must be the same to be non-delegated.static void
processLocalStates(@NotNull TaskType task, @NotNull ActivityTreeUtil.LocalActivityStateProcessor processor)
Processes local activity state objects using the same rules as intransformLocalStates(TaskType, LocalActivityStateTransformer)
(TaskType, ActivityStateTransformer)}: all states are treated the same.static void
processStates(@NotNull TaskType rootTask, @NotNull TaskResolver resolver, @NotNull ActivityTreeUtil.ActivityStateProcessor processor)
Processes activity state objects using the same rules as intransformStates(TaskType, TaskResolver, ActivityStateTransformer)
: delegation states are ignored, distribution states are considered, along with all their workers' states.static @NotNull TreeNode<ActivityTreeUtil.ActivityStateInLocalContext>
toLocalStateTree(@NotNull TaskType task)
Creates aTreeNode
ofActivityTreeUtil.ActivityStateInLocalContext
objects for activities locally contained in the task.static @NotNull TreeNode<ActivityTreeUtil.ActivityStateInContext>
toStateTree(@NotNull TaskType rootTask, @NotNull TaskResolver resolver)
Special case oftransformStates(TaskType, TaskResolver, ActivityStateTransformer)
: creates aTreeNode
ofActivityTreeUtil.ActivityStateInContext
objects.static <X> @NotNull TreeNode<X>
transformLocalStates(@NotNull TaskType rootTask, @NotNull ActivityTreeUtil.LocalActivityStateTransformer<X> transformer)
Transforms task-local activity state objects into custom ones, organized into a tree.static <X> @NotNull TreeNode<X>
transformStates(@NotNull TaskType rootTask, @NotNull TaskResolver resolver, @NotNull ActivityTreeUtil.ActivityStateTransformer<X> transformer)
Transforms activity state objects into custom ones, organized into a tree.
-
-
-
Method Detail
-
transformStates
@NotNull public static <X> @NotNull TreeNode<X> transformStates(@NotNull @NotNull TaskType rootTask, @NotNull @NotNull TaskResolver resolver, @NotNull @NotNull ActivityTreeUtil.ActivityStateTransformer<X> transformer)
Transforms activity state objects into custom ones, organized into a tree. Delegation states are ignored. Distribution states are considered, and their workers' states are packed along them.
-
transformLocalStates
@NotNull public static <X> @NotNull TreeNode<X> transformLocalStates(@NotNull @NotNull TaskType rootTask, @NotNull @NotNull ActivityTreeUtil.LocalActivityStateTransformer<X> transformer)
Transforms task-local activity state objects into custom ones, organized into a tree. Does not distinguish between local, delegated, and distributed states: all are treated the same.
-
processStates
public static void processStates(@NotNull @NotNull TaskType rootTask, @NotNull @NotNull TaskResolver resolver, @NotNull @NotNull ActivityTreeUtil.ActivityStateProcessor processor)
Processes activity state objects using the same rules as intransformStates(TaskType, TaskResolver, ActivityStateTransformer)
: delegation states are ignored, distribution states are considered, along with all their workers' states.
-
processLocalStates
public static void processLocalStates(@NotNull @NotNull TaskType task, @NotNull @NotNull ActivityTreeUtil.LocalActivityStateProcessor processor)
Processes local activity state objects using the same rules as intransformLocalStates(TaskType, LocalActivityStateTransformer)
(TaskType, ActivityStateTransformer)}: all states are treated the same.
-
toStateTree
@NotNull public static @NotNull TreeNode<ActivityTreeUtil.ActivityStateInContext> toStateTree(@NotNull @NotNull TaskType rootTask, @NotNull @NotNull TaskResolver resolver)
Special case oftransformStates(TaskType, TaskResolver, ActivityStateTransformer)
: creates aTreeNode
ofActivityTreeUtil.ActivityStateInContext
objects.
-
toLocalStateTree
@NotNull public static @NotNull TreeNode<ActivityTreeUtil.ActivityStateInLocalContext> toLocalStateTree(@NotNull @NotNull TaskType task)
Creates aTreeNode
ofActivityTreeUtil.ActivityStateInLocalContext
objects for activities locally contained in the task.
-
hasDelegatedActivity
public static boolean hasDelegatedActivity(TreeNode<ActivityTreeUtil.ActivityStateInContext> node)
We know this by comparing task OIDs (except for worker ones): all must be the same to be non-delegated.
-
getSubtasksForPath
@NotNull public static @NotNull List<TaskType> getSubtasksForPath(TaskType task, ActivityPath activityPath, TaskResolver taskResolver)
-
getAllLocalStates
@NotNull public static @NotNull List<ActivityStateType> getAllLocalStates(@NotNull @NotNull TaskActivityStateType taskActivityState)
-
-