Package com.xebialabs.xlrelease.domain

# Class Phase

java.lang.Object
com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
com.xebialabs.xlrelease.domain.PlanItem
com.xebialabs.xlrelease.domain.Phase

All Implemented Interfaces:
  `ConfigurationItem`, `TaskContainer`, `VisitableItem`, `Serializable`, `Comparable<BaseConfigurationItem>`

@Metadata(description="A phase in a release that contains tasks.", versioned=false) public class Phase extends PlanItem implements TaskContainer

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `color`
  `protected String`
  `originId`
  `protected PhaseStatus`
  `status`

  ### Fields inherited from class com.xebialabs.xlrelease.domain.PlanItem

  `BY_TITLE, description, dueDate, endDate, flagComment, flagStatus, overdueNotified, owner, plannedDuration, scheduledStartDate, startDate, title`

  ### Fields inherited from class com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem

  `id, syntheticProperties, type`

  ### Fields inherited from interface com.xebialabs.deployit.plugin.api.udm.ConfigurationItem

  `SYNTHETIC_PROPERTIES_FIELD, TYPE_FIELD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Phase()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Changes`
  `abort()`
  `void`
  `accept(ReleaseVisitor visitor)`
  `void`
  `addTask(Task task, int position)`
  `Changes`
  `close()`
  `void`
  `deleteTask(Task task)`
  `Changes`
  `fail()`
  `Changes`
  `failing()`
  `Changes`
  `failTask(String targetTaskId, String failReason, User user)`
  `Changes`
  `failTask(String targetTaskId, String failReason, User user, boolean fromAbort)`
  `List<GateTask>`
  `getAllGates()`
  `List<Task>`
  `getAllTasks()`
  `String`
  `getAncestorId()`
  `List<PlanItem>`
  `getChildren()`
  `String`
  `getColor()`
  `Task`
  `getCurrentTask()`
  `String`
  `getDisplayPath()`
  `String`
  `getOriginId()`
  `Release`
  `getRelease()`
  `String`
  `getReleaseOwner()`
  `Integer`
  `getReleaseUid()`
  `PhaseStatus`
  `getStatus()`
  `Task`
  `getTask(Integer index)`
  `Task`
  `getTask(String taskId)`
  `List<Task>`
  `getTasks()`
  `List<UsagePoint>`
  `getVariableUsages()`
  `boolean`
  `hasBeenStarted()`
  `boolean`
  `hasCurrentTask()`
  `boolean`
  `isAborted()`
  `boolean`
  `isActive()`
  `boolean`
  `isDefunct()`
  `boolean`
  `isDone()`
  `boolean`
  `isFailed()`
  `boolean`
  `isFailing()`
  `boolean`
  `isLatestCopy()`
  `boolean`
  `isOriginal()`
  `boolean`
  `isPhaseCopied()`
  Checks within the phase release if there is another phase that has its originId filled and referring to this phase.
  `boolean`
  `isPlanned()`
  `boolean`
  `isUpdatable()`
  `Changes`
  `markTaskAsDone(String taskId, TaskStatus status)`
  `Changes`
  `markTaskAsFailing(String taskId, String failReason)`
  `Changes`
  `resetToPlanned()`
  `Changes`
  `retryTask(String taskId)`
  `void`
  `setColor(String color)`
  `void`
  `setOriginId(String originId)`
  `void`
  `setRelease(Release release)`
  `void`
  `setReleaseUid(Integer releaseUid)`
  `void`
  `setStatus(PhaseStatus status)`
  `void`
  `setTasks(List<Task> tasks)`
  `Changes`
  `start()`
  `Changes`
  `startPendingTask(String targetTaskId)`
  `Changes`
  `startWithInput(String targetTaskId)`
  `Changes`
  `taskPreconditionValidated(String targetTaskId)`

  ### Methods inherited from class com.xebialabs.xlrelease.domain.PlanItem

  `calculateDueDate, checkDatesValidity, getActualDuration, getComputedPlannedDuration, getDescription, getDueDate, getEndDate, getEndOrDueDate, getFlagComment, getFlagStatus, getOrCalculateDueDate, getOwner, getPlannedDuration, getScheduledStartDate, getStartDate, getStartOrScheduledDate, getTitle, hasDueDate, hasEndDate, hasEndOrDueDate, hasOwner, hasOwner, hasPlannedDuration, hasScheduledStartDate, hasStartDate, hasStartOrScheduledDate, hasTitle, hasTitle, hasValidStartDates, isFlagged, isOverdue, isOverdueNotified, isTitleContaining, moveChildren, setDates, setDescription, setDueDate, setEndDate, setFlagComment, setFlagStatus, setOverdueNotified, setOwner, setPlannedDuration, setScheduledStartDate, setStartAndEndDatesIfEmpty, setStartDate, setTitle, shouldNotifyOverdue, updateDates, updateDuration`

  ### Methods inherited from class com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem

  `compareTo, equals, get$ciAttributes, get$directoryReference, get$externalProperties, get$internalId, get$referenceId, get$securedCi, get$securedDirectoryReference, get$token, get$validationMessages, getId, getName, getProperty, getPropertyDescriptor, getType, hashCode, hasProperty, set$ciAttributes, set$directoryReference, set$externalProperties, set$internalId, set$referenceId, set$securedCi, set$securedDirectoryReference, set$token, set$validationMessages, setId, setProperty, setType, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.xebialabs.deployit.plugin.api.udm.ConfigurationItem

  `get$directoryReference, get$internalId, get$referenceId, get$securedCi, get$securedDirectoryReference, get$validationMessages, getId, getName, getProperty, getType, hasProperty, setId, setProperty`

  ### Methods inherited from interface com.xebialabs.xlrelease.domain.TaskContainer

  `getTitle, isLocked, replaceTask, replaceTask`

- ## Field Details

  - ### status

    @Property(description="The state the phase is in.") protected PhaseStatus status

  - ### color

    @Property(description="The color of the phase top bar in the UI. Format: #(hex value); for example \'#3D6C9E\'") protected String color

  - ### originId

    @Property(required=false, description="If given, then this phase has been copied as a part of restart phase operation based on this id") protected String originId

- ## Constructor Details

  - ### Phase

    public Phase()

- ## Method Details

  - ### getTasks

    public List<Task> getTasks()
    Specified by:
      `getTasks` in interface `TaskContainer`

  - ### setTasks

    public void setTasks(List<Task> tasks)
    Specified by:
      `setTasks` in interface `TaskContainer`

  - ### getCurrentTask

    public Task getCurrentTask()

  - ### hasCurrentTask

    public boolean hasCurrentTask()

  - ### 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`

  - ### setRelease

    public void setRelease(Release release)

  - ### getStatus

    public PhaseStatus getStatus()

  - ### setStatus

    public void setStatus(PhaseStatus status)

  - ### getColor

    public String getColor()

  - ### setColor

    public void setColor(String color)

  - ### getOriginId

    public String getOriginId()

  - ### setOriginId

    public void setOriginId(String originId)

  - ### start

    public Changes start()

  - ### startPendingTask

    public Changes startPendingTask(String targetTaskId)

  - ### startWithInput

    public Changes startWithInput(String targetTaskId)

  - ### taskPreconditionValidated

    public Changes taskPreconditionValidated(String targetTaskId)

  - ### markTaskAsDone

    public Changes markTaskAsDone(String taskId, TaskStatus status)

  - ### markTaskAsFailing

    public Changes markTaskAsFailing(String taskId, String failReason)

  - ### failTask

    public Changes failTask(String targetTaskId, String failReason, User user)

  - ### failTask

    public Changes failTask(String targetTaskId, String failReason, User user, boolean fromAbort)

  - ### retryTask

    public Changes retryTask(String taskId)

  - ### abort

    public Changes abort()

  - ### fail

    public Changes fail()

  - ### failing

    public Changes failing()

  - ### getTask

    public Task getTask(Integer index)

  - ### resetToPlanned

    public Changes resetToPlanned()

  - ### hasBeenStarted

    public boolean hasBeenStarted()
    Specified by:
      `hasBeenStarted` in class `PlanItem`

  - ### isActive

    public boolean isActive()
    Specified by:
      `isActive` in class `PlanItem`

  - ### isDone

    public boolean isDone()
    Specified by:
      `isDone` in class `PlanItem`

  - ### isDefunct

    public boolean isDefunct()

  - ### isUpdatable

    public boolean isUpdatable()
    Specified by:
      `isUpdatable` in class `PlanItem`

  - ### isAborted

    public boolean isAborted()
    Specified by:
      `isAborted` in class `PlanItem`

  - ### isPlanned

    public boolean isPlanned()

  - ### isFailed

    public boolean isFailed()
    Specified by:
      `isFailed` in class `PlanItem`

  - ### isFailing

    public boolean isFailing()
    Specified by:
      `isFailing` in class `PlanItem`

  - ### getReleaseOwner

    public String getReleaseOwner()

  - ### getAllGates

    public List<GateTask> getAllGates()

  - ### 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`

  - ### close

    public Changes close()

  - ### getTask

    public Task getTask(String taskId)

  - ### addTask

    public void addTask(Task task, int position)
    Specified by:
      `addTask` in interface `TaskContainer`

  - ### deleteTask

    public void deleteTask(Task task)

  - ### isOriginal

    public boolean isOriginal()

  - ### isPhaseCopied

    public boolean isPhaseCopied()
    Checks within the phase release if there is another phase that has its originId filled and referring to this phase.
    Returns:

  - ### getAncestorId

    public String getAncestorId()

  - ### isLatestCopy

    public boolean isLatestCopy()