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`, `java.io.Serializable`, `java.lang.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 java.lang.String` | `color` |
    `protected java.lang.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

    All Methods Instance Methods Concrete Methods
    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​(java.lang.String targetTaskId, java.lang.String failReason, User user)` |
    `Changes` | `failTask​(java.lang.String targetTaskId, java.lang.String failReason, User user, boolean fromAbort)` |
    `java.util.List<GateTask>` | `getAllGates()` |
    `java.util.List<Task>` | `getAllTasks()` |
    `java.lang.String` | `getAncestorId()` |
    `java.util.List<PlanItem>` | `getChildren()` |
    `java.lang.String` | `getColor()` |
    `Task` | `getCurrentTask()` |
    `java.lang.String` | `getDisplayPath()` |
    `java.lang.String` | `getOriginId()` |
    `Release` | `getRelease()` |
    `java.lang.String` | `getReleaseOwner()` |
    `java.lang.Integer` | `getReleaseUid()` |
    `PhaseStatus` | `getStatus()` |
    `Task` | `getTask​(java.lang.Integer index)` |
    `Task` | `getTask​(java.lang.String taskId)` |
    `java.util.List<Task>` | `getTasks()` |
    `java.util.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​(java.lang.String taskId, TaskStatus status)` |
    `Changes` | `resetToPlanned()` |
    `Changes` | `retryTask​(java.lang.String taskId)` |
    `void` | `setColor​(java.lang.String color)` |
    `void` | `setOriginId​(java.lang.String originId)` |
    `void` | `setRelease​(Release release)` |
    `void` | `setReleaseUid​(java.lang.Integer releaseUid)` |
    `void` | `setStatus​(PhaseStatus status)` |
    `void` | `setTasks​(java.util.List<Task> tasks)` |
    `Changes` | `start()` |
    `Changes` | `startPendingTask​(java.lang.String targetTaskId)` |
    `Changes` | `startWithInput​(java.lang.String targetTaskId)` |
    `Changes` | `taskPreconditionValidated​(java.lang.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 Detail

    - #### 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 java.lang.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 java.lang.String originId

  - ### Constructor Detail

    - #### Phase

          public Phase()

  - ### Method Detail

    - #### getTasks

          public java.util.List<Task> getTasks()

      Specified by:
        `getTasks` in interface `TaskContainer`

    - #### setTasks

          public void setTasks​(java.util.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 java.lang.Integer getReleaseUid()

      Specified by:
        `getReleaseUid` in class `PlanItem`

    - #### setReleaseUid

          public void setReleaseUid​(java.lang.Integer releaseUid)

      Specified by:
        `setReleaseUid` in class `PlanItem`

    - #### getDisplayPath

          public java.lang.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 java.lang.String getColor()

    - #### setColor

          public void setColor​(java.lang.String color)

    - #### getOriginId

          public java.lang.String getOriginId()

    - #### setOriginId

          public void setOriginId​(java.lang.String originId)

    - #### start

          public Changes start()

    - #### startPendingTask

          public Changes startPendingTask​(java.lang.String targetTaskId)

    - #### startWithInput

          public Changes startWithInput​(java.lang.String targetTaskId)

    - #### taskPreconditionValidated

          public Changes taskPreconditionValidated​(java.lang.String targetTaskId)

    - #### markTaskAsDone

          public Changes markTaskAsDone​(java.lang.String taskId,
                                        TaskStatus status)

    - #### failTask

          public Changes failTask​(java.lang.String targetTaskId,
                                  java.lang.String failReason,
                                  User user)

    - #### failTask

          public Changes failTask​(java.lang.String targetTaskId,
                                  java.lang.String failReason,
                                  User user,
                                  boolean fromAbort)

    - #### retryTask

          public Changes retryTask​(java.lang.String taskId)

    - #### abort

          public Changes abort()

    - #### fail

          public Changes fail()

    - #### failing

          public Changes failing()

    - #### getTask

          public Task getTask​(java.lang.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()

    - #### isFailing

          public boolean isFailing()

    - #### getReleaseOwner

          public java.lang.String getReleaseOwner()

    - #### getAllGates

          public java.util.List<GateTask> getAllGates()

    - #### getAllTasks

          public java.util.List<Task> getAllTasks()

    - #### getChildren

          public java.util.List<PlanItem> getChildren()

      Specified by:
        `getChildren` in class `PlanItem`

    - #### accept

          public void accept​(ReleaseVisitor visitor)

      Specified by:
        `accept` in interface `VisitableItem`

    - #### getVariableUsages

          public java.util.List<UsagePoint> getVariableUsages()

      Specified by:
        `getVariableUsages` in class `PlanItem`

    - #### close

          public Changes close()

    - #### getTask

          public Task getTask​(java.lang.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 java.lang.String getAncestorId()

    - #### isLatestCopy

          public boolean isLatestCopy()