Class ActivityStateUtil
- java.lang.Object
-
- com.evolveum.midpoint.schema.util.task.ActivityStateUtil
-
public class ActivityStateUtil extends Object
Utility methods related to activity state and activity work state. Does NOT deal with execution across task trees. SeeActivityTreeUtil
for that.
-
-
Constructor Summary
Constructors Constructor Description ActivityStateUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @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>
getLocalStatesStream(ActivityStateType root)
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)
-
-
-
Method Detail
-
isProgressAvailableLocally
public static boolean isProgressAvailableLocally(@NotNull @NotNull TaskType task)
- 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
public static boolean hasDelegatedActivity(@NotNull @NotNull TaskType task)
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
public static boolean isManageableTreeRoot(@NotNull @NotNull TaskType task)
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
public static boolean hasLocalDistributedActivity(@NotNull @NotNull TaskType task)
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
public static ActivityPathType getLocalRootPathBean(TaskActivityStateType taskState)
-
getLocalRootPath
public static ActivityPath getLocalRootPath(TaskActivityStateType taskState)
-
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
public static boolean isComplete(@NotNull @NotNull ActivityStateType state)
Returns true if the activity is complete.
-
isDelegated
public static boolean isDelegated(@NotNull @NotNull ActivityStateType state)
-
isDistributed
public static boolean isDistributed(@NotNull @NotNull ActivityStateType state)
-
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
public static Stream<ActivityStateType> getLocalStatesStream(ActivityStateType root)
-
-