Class Task

All Implemented Interfaces:
ConfigurationItem, Lockable, VisitableItem, Serializable, Comparable<BaseConfigurationItem>
Direct Known Subclasses:
BaseScriptTask, ContainerTask, CreateReleaseTask, GateTask, NotificationTask, TaskGroup, UserInputTask

@Metadata(label="Manual", versioned=false, description="Describes an action that is not automated and requires a human to mark completion") public class Task extends PlanItem implements Lockable
An Digital.ai Release task. See also GateTask.
See Also:
  • Field Details

  • Constructor Details

    • Task

      public Task()
  • Method Details

    • getConfigurationUri

      public String getConfigurationUri()
    • setConfigurationUri

      public void setConfigurationUri(String configurationUri)
    • getCiUid

      public Integer getCiUid()
    • setCiUid

      public void setCiUid(Integer ciUid)
    • getDocumentationPage

      public String getDocumentationPage()
    • setDocumentationPage

      public void setDocumentationPage(String documentationPage)
    • getComments

      public List<Comment> getComments()
    • getContainer

      public TaskContainer getContainer()
    • setContainer

      public void setContainer(TaskContainer container)
    • getStatus

      public TaskStatus getStatus()
    • setStatus

      public void setStatus(TaskStatus status)
    • getTeam

      public String getTeam()
    • hasTeam

      public boolean hasTeam()
    • setTeam

      public void setTeam(String team)
    • getWatchers

      public Set<String> getWatchers()
    • setWatchers

      public void setWatchers(Set<String> watchers)
    • addWatcher

      public void addWatcher(String watcher)
    • removeWatcher

      public void removeWatcher(String watcher)
    • setPrecondition

      public void setPrecondition(String precondition)
    • getPrecondition

      public String getPrecondition()
    • getFailureHandler

      public String getFailureHandler()
    • getAbortScript

      public String getAbortScript() throws IOException
      Throws:
      IOException
    • setFailureHandler

      public void setFailureHandler(String failureHandler)
    • isTaskFailureHandlerEnabled

      public boolean isTaskFailureHandlerEnabled()
    • setTaskFailureHandlerEnabled

      public void setTaskFailureHandlerEnabled(boolean taskFailureHandlerEnabled)
    • getTaskRecoverOp

      public TaskRecoverOp getTaskRecoverOp()
    • setTaskRecoverOp

      public void setTaskRecoverOp(TaskRecoverOp taskRecoverOp)
    • getTags

      public List<String> getTags()
    • setTags

      public void setTags(List<String> tags)
    • isCheckAttributes

      public boolean isCheckAttributes()
    • setCheckAttributes

      public void setCheckAttributes(boolean checkAttributes)
    • setVariableMapping

      public void setVariableMapping(Map<String,String> variableMapping)
    • getVariableMapping

      public Map<String,String> getVariableMapping()
    • hasVariableMapping

      public boolean hasVariableMapping()
    • setMaxCommentSize

      public void setMaxCommentSize(int maxCommentSize)
    • getMaxCommentSize

      public int getMaxCommentSize()
    • getLastStatusChangeBy

      public String getLastStatusChangeBy()
    • isDefaultTaskType

      public static boolean isDefaultTaskType(Type type)
    • fromType

      public static <T extends Task> T fromType(String taskType)
    • fromType

      public static <T extends Task> T fromType(Type taskType)
    • applyDefaults

      protected void applyDefaults()
    • getPhase

      public Phase getPhase()
    • start

      public Changes start()
    • canStartNow

      public boolean canStartNow()
    • canScheduleTaskStart

      public boolean canScheduleTaskStart()
    • startPending

      public Changes startPending(String targetId)
    • startWithInput

      public Changes startWithInput()
    • retry

      public Changes retry(String targetId)
    • setScheduledStartDate

      public void setScheduledStartDate(Date scheduledStartDate)
      Overrides:
      setScheduledStartDate in class PlanItem
    • startNow

      protected Changes startNow(String targetId, boolean shouldBePending)
    • execute

      protected Changes execute(String targetId, TaskStartOrRetryOperation operation)
    • shouldFacetBeChecked

      public boolean shouldFacetBeChecked()
    • canBeBackup

      public boolean canBeBackup()
    • shouldPreconditionBeChecked

      public boolean shouldPreconditionBeChecked()
    • postponeUntilEnvironmentsAreReserved

      public Changes postponeUntilEnvironmentsAreReserved(Date postponeUntil)
    • markAsDone

      public Changes markAsDone(String targetId, TaskStatus status)
      Parameters:
      targetId - since tasks nest, this can either be the id of this task or the id of one of its children
    • fail

      public Changes fail(String targetId, String failReason)
    • fail

      public Changes fail(String targetId, String failReason, User user)
    • fail

      public Changes fail(String targetId, String failReason, boolean fromAbort)
    • fail

      public Changes fail(String targetId, String failReason, User user, boolean fromAbort)
    • reopen

      public Changes reopen()
    • abort

      public Changes abort()
    • hasBeenStarted

      public boolean hasBeenStarted()
      Specified by:
      hasBeenStarted in class PlanItem
    • hasBeenFlagged

      public boolean hasBeenFlagged()
    • getFlaggedCount

      public int getFlaggedCount()
    • getDelayedCount

      public int getDelayedCount()
    • hasBeenDelayed

      public boolean hasBeenDelayed()
    • getFailuresCount

      public int getFailuresCount()
    • setHasBeenFlagged

      public void setHasBeenFlagged(boolean hasBeenFlagged)
    • setHasBeenDelayed

      public void setHasBeenDelayed(boolean hasBeenDelayed)
    • setFailuresCount

      public void setFailuresCount(int failuresCount)
    • isDone

      public boolean isDone()
      Specified by:
      isDone in class PlanItem
    • isDoneInAdvance

      public boolean isDoneInAdvance()
    • isDefunct

      public boolean isDefunct()
    • isUpdatable

      public boolean isUpdatable()
      Specified by:
      isUpdatable in class PlanItem
    • isAborted

      public boolean isAborted()
      Specified by:
      isAborted in class PlanItem
    • isNotYetReached

      public boolean isNotYetReached()
    • isPlanned

      public boolean isPlanned()
    • isActive

      public boolean isActive()
      Specified by:
      isActive in class PlanItem
    • isInProgress

      public boolean isInProgress()
    • isPending

      public boolean isPending()
    • isWaitingForInput

      public boolean isWaitingForInput()
    • isFailed

      public boolean isFailed()
    • isFailing

      public boolean isFailing()
    • isCompletedInAdvance

      public boolean isCompletedInAdvance()
    • isSkipped

      public boolean isSkipped()
    • isSkippedInAdvance

      public boolean isSkippedInAdvance()
    • isPreconditionInProgress

      public boolean isPreconditionInProgress()
    • isFailureHandlerInProgress

      public boolean isFailureHandlerInProgress()
    • isAbortScriptInProgress

      public boolean isAbortScriptInProgress()
    • isFacetInProgress

      public boolean isFacetInProgress()
    • hasFailureHandlerScript

      protected boolean hasFailureHandlerScript()
    • hasAbortScript

      public boolean hasAbortScript()
    • hasTaskRecoverOp

      protected boolean hasTaskRecoverOp()
    • isMovable

      public boolean isMovable()
    • isAssignedTo

      public boolean isAssignedTo(Team team)
    • isGate

      public boolean isGate()
    • isTaskGroup

      public boolean isTaskGroup()
    • isParallelGroup

      public boolean isParallelGroup()
    • getAttachments

      public List<Attachment> getAttachments()
    • setAttachments

      public void setAttachments(List<Attachment> attachments)
    • isPreconditionEnabled

      public boolean isPreconditionEnabled()
    • isFailureHandlerEnabled

      public boolean isFailureHandlerEnabled()
    • getExecutionId

      public String getExecutionId()
    • setExecutionId

      public void setExecutionId(String executionId)
    • generateExecutionId

      public void generateExecutionId()
    • deleteAttachment

      public void deleteAttachment(String attachmentId)
    • resetToPlanned

      public Changes resetToPlanned()
    • setFlagStatus

      public void setFlagStatus(FlagStatus flagStatus)
      Overrides:
      setFlagStatus in class PlanItem
    • getRelease

      public Release getRelease()
      Specified by:
      getRelease in class PlanItem
    • getReleaseUid

      public Integer getReleaseUid()
      Specified by:
      getReleaseUid in class PlanItem
    • setReleaseUid

      public void setReleaseUid(Integer releaseUid)
      Specified by:
      setReleaseUid in class PlanItem
    • getDisplayPath

      public String getDisplayPath()
      Specified by:
      getDisplayPath in class PlanItem
    • getReleaseOwner

      public String getReleaseOwner()
    • getAllTasks

      public List<Task> getAllTasks()
    • getChildren

      public List<PlanItem> getChildren()
      Specified by:
      getChildren in class PlanItem
    • accept

      public void accept(ReleaseVisitor visitor)
      Specified by:
      accept in interface VisitableItem
    • getVariableUsages

      public List<UsagePoint> getVariableUsages()
      Specified by:
      getVariableUsages in class PlanItem
    • freezeVariables

      public Set<String> freezeVariables(Changes changes, boolean freezeEvenIfUnresolved)
    • shouldFreezeVariableMapping

      protected boolean shouldFreezeVariableMapping(CiProperty property)
    • getInputVariables

      public List<Variable> getInputVariables()
    • getReferencedVariables

      public List<Variable> getReferencedVariables()
    • getUnboundRequiredVariables

      protected List<String> getUnboundRequiredVariables()
    • freezeVariablesInCustomFields

      public Set<String> freezeVariablesInCustomFields(Map<String,ValueWithInterpolation> variables, Map<String,String> passwordVariables, Changes changes, boolean freezeEvenIfUnresolved)

      To be overridden in child classes with custom fields that can contain variables.

      Apply VariableHelper.replaceAll(Object, Map, Set, boolean) to each field; if child entities are modified, add them to changes.
    • isWaitForScheduledStartDate

      public boolean isWaitForScheduledStartDate()
    • setWaitForScheduledStartDate

      public void setWaitForScheduledStartDate(boolean waitForScheduledStartDate)
    • isDelayDuringBlackout

      public boolean isDelayDuringBlackout()
    • setDelayDuringBlackout

      public void setDelayDuringBlackout(boolean delayDuringBlackout)
    • checkDatesValidity

      public void checkDatesValidity()
    • isAutomated

      public boolean isAutomated()
    • ownerHasBeenReassigned

      public boolean ownerHasBeenReassigned(Task task)
    • teamHasBeenReassigned

      public boolean teamHasBeenReassigned(Task task)
    • delayDuringBlackoutHasChanged

      public boolean delayDuringBlackoutHasChanged(Task task)
    • failureHandlerHasChanged

      public boolean failureHandlerHasChanged(Task task)
    • preconditionHasChanged

      public boolean preconditionHasChanged(Task task)
    • getTaskType

      public Type getTaskType()
    • isStillExecutingScript

      public boolean isStillExecutingScript(String executionId)
    • isPostponedDueToBlackout

      public boolean isPostponedDueToBlackout()
    • setPostponedDueToBlackout

      public void setPostponedDueToBlackout(boolean delay)
    • getOriginalScheduledStartDate

      public Date getOriginalScheduledStartDate()
    • setOriginalScheduledStartDate

      public void setOriginalScheduledStartDate(Date originalDate)
    • isDueSoon

      public boolean isDueSoon()
    • getElapsedDurationFraction

      public double getElapsedDurationFraction()
    • shouldNotifyDueSoon

      public boolean shouldNotifyDueSoon()
    • isDueSoonNotified

      public boolean isDueSoonNotified()
    • setDueSoonNotified

      public void setDueSoonNotified(boolean dueSoonNotified)
    • deleteTask

      public void deleteTask(Task task)
    • replaceTask

      public void replaceTask(Task task)
    • findComment

      public Comment findComment(String commentId)
    • updateComment

      public void updateComment(Comment originalComment, Comment updatedComment)
    • clearComments

      public void clearComments()
    • clearModificationAttributes

      public void clearModificationAttributes()
    • isLocked

      public boolean isLocked()
      Specified by:
      isLocked in interface Lockable
    • setLocked

      public void setLocked(boolean locked)
      Specified by:
      setLocked in interface Lockable
    • lock

      public void lock()
      Specified by:
      lock in interface Lockable
    • unlock

      public void unlock()
      Specified by:
      unlock in interface Lockable
    • isSupportedInWorkflow

      public boolean isSupportedInWorkflow()
    • setSupportedInWorkflow

      public void setSupportedInWorkflow(boolean supportedInWorkflow)
    • getFacets

      public List<Facet> getFacets()
    • setFacets

      public void setFacets(List<Facet> facets)
    • getUrl

      public String getUrl()
    • isPostponedUntilEnvironmentsAreReserved

      public boolean isPostponedUntilEnvironmentsAreReserved()
    • setPostponedUntilEnvironmentsAreReserved

      public Task setPostponedUntilEnvironmentsAreReserved(boolean postponedUntilEnvironmentsAreReserved)