Class ActivityStateUtil


  • public class ActivityStateUtil
    extends Object
    Utility methods related to activity state and activity work state. Does NOT deal with execution across task trees. See ActivityTreeUtil for that.
    • Constructor Detail

      • ActivityStateUtil

        public ActivityStateUtil()
    • 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.
      • 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.
      • 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)