Class ActivityStateUtil
java.lang.Object
com.evolveum.midpoint.schema.util.task.ActivityStateUtil
Utility methods related to activity state and activity work state.
Does NOT deal with execution across task trees. See
ActivityTreeUtil
for that.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ActivityStateType
findChildActivityStateRequired
(ActivityStateType state, String identifier) Returns child activity state - failing if not unique or not existing.static ActivityStateType
getActivityState
(@NotNull TaskType task, @NotNull ItemPath stateItemPath) Finds a state of an activity, given the state item path.static ActivityStateType
getActivityState
(@NotNull TaskType task, @NotNull ActivityPath activityPath) Finds a state of an activity, given the activity path.static ActivityStateType
getActivityState
(@Nullable TaskActivityStateType taskState, @NotNull ActivityPath activityPath) Finds a state of an activity, given the activity path.static @NotNull ActivityStateType
getActivityStateRequired
(@NotNull TaskActivityStateType taskState, @NotNull ItemPath stateItemPath) Finds a state of an activity, given the state item path.static @NotNull ActivityStateType
getActivityStateRequired
(@NotNull TaskActivityStateType taskState, @NotNull ActivityPath activityPath) Finds a state of an activity, given the activity path.static ActivityPath
getLocalRootPath
(TaskActivityStateType taskState) static ActivityPathType
getLocalRootPathBean
(TaskActivityStateType taskState) static Stream<ActivityStateType>
static @Nullable Object
getRootSyncTokenRealValue
(@NotNull TaskType task) static @NotNull Object
getRootSyncTokenRealValueRequired
(@NotNull TaskType task) static @NotNull ItemPath
getStateItemPath
(@NotNull TaskActivityStateType workState, @NotNull ActivityPath activityPath) Determines state item path for a given activity path.static @Nullable Object
getSyncTokenRealValue
(@NotNull TaskType task, @NotNull ActivityPath path) static boolean
hasDelegatedActivity
(@NotNull TaskType task) Is there any local activity that is delegated?static boolean
hasDelegatedActivity
(@Nullable TaskActivityStateType taskActivityState) Is there any local activity that is delegated?static boolean
hasLocalDistributedActivity
(@NotNull TaskType task) Is there any distributed activity in this task (locally)?static boolean
hasLocalDistributedActivity
(@Nullable TaskActivityStateType taskActivityState) Is there any distributed activity in this task?static boolean
isComplete
(@NotNull ActivityStateType state) Returns true if the activity is complete.static boolean
isDelegated
(@NotNull ActivityStateType state) static boolean
isDistributed
(@NotNull ActivityStateType state) static boolean
isLocal
(@NotNull ActivityPath activityPath, @NotNull TaskActivityStateType taskActivityState) static boolean
isManageableTreeRoot
(@NotNull TaskType task) This is to determine if this task should be managed as a tree root (and not as a plain task).static boolean
isProgressAvailableLocally
(@NotNull TaskType task)
-
Constructor Details
-
ActivityStateUtil
public ActivityStateUtil()
-
-
Method Details
-
isProgressAvailableLocally
- Returns:
- True if the progress of the task can be determined by looking only at the task itself. Currently this is true for tasks without delegation.
-
hasDelegatedActivity
Is there any local activity that is delegated? -
hasDelegatedActivity
public static boolean hasDelegatedActivity(@Nullable @Nullable TaskActivityStateType taskActivityState) Is there any local activity that is delegated? -
isManageableTreeRoot
This is to determine if this task should be managed as a tree root (and not as a plain task). We would like to see that without looking for subtasks, though. So we have to look at the activity state and see if there are any delegations or distributions. -
hasLocalDistributedActivity
Is there any distributed activity in this task (locally)? -
hasLocalDistributedActivity
public static boolean hasLocalDistributedActivity(@Nullable @Nullable TaskActivityStateType taskActivityState) Is there any distributed activity in this task? -
getActivityState
public static ActivityStateType getActivityState(@Nullable @Nullable TaskActivityStateType taskState, @NotNull @NotNull ActivityPath activityPath) Finds a state of an activity, given the activity path. Assumes local execution. -
getActivityState
public static ActivityStateType getActivityState(@NotNull @NotNull TaskType task, @NotNull @NotNull ActivityPath activityPath) Finds a state of an activity, given the activity path. Assumes local execution. -
getActivityState
public static ActivityStateType getActivityState(@NotNull @NotNull TaskType task, @NotNull @NotNull ItemPath stateItemPath) Finds a state of an activity, given the state item path. Assumes local execution. -
getActivityStateRequired
@NotNull public static @NotNull ActivityStateType getActivityStateRequired(@NotNull @NotNull TaskActivityStateType taskState, @NotNull @NotNull ActivityPath activityPath) Finds a state of an activity, given the activity path. Assumes local execution. Fails if there is no state object. -
getActivityStateRequired
@NotNull public static @NotNull ActivityStateType getActivityStateRequired(@NotNull @NotNull TaskActivityStateType taskState, @NotNull @NotNull ItemPath stateItemPath) Finds a state of an activity, given the state item path. Assumes local execution. Fails if there is no state object. -
getLocalRootPathBean
-
getLocalRootPath
-
getStateItemPath
@NotNull public static @NotNull ItemPath getStateItemPath(@NotNull @NotNull TaskActivityStateType workState, @NotNull @NotNull ActivityPath activityPath) Determines state item path for a given activity path. Assumes local execution. Fails if the state is not there. -
isLocal
public static boolean isLocal(@NotNull @NotNull ActivityPath activityPath, @NotNull @NotNull TaskActivityStateType taskActivityState) -
findChildActivityStateRequired
@NotNull public static @NotNull ActivityStateType findChildActivityStateRequired(ActivityStateType state, String identifier) Returns child activity state - failing if not unique or not existing. -
isComplete
Returns true if the activity is complete. -
isDelegated
-
isDistributed
-
getSyncTokenRealValue
@Nullable public static @Nullable Object getSyncTokenRealValue(@NotNull @NotNull TaskType task, @NotNull @NotNull ActivityPath path) throws SchemaException - Throws:
SchemaException
-
getRootSyncTokenRealValue
@Nullable public static @Nullable Object getRootSyncTokenRealValue(@NotNull @NotNull TaskType task) throws SchemaException - Throws:
SchemaException
-
getRootSyncTokenRealValueRequired
@NotNull public static @NotNull Object getRootSyncTokenRealValueRequired(@NotNull @NotNull TaskType task) throws SchemaException - Throws:
SchemaException
-
getLocalStatesStream
-