Package com.xebialabs.xlrelease.domain

# Class Dependency

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

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

@Metadata(description="A dependency to another release, phase or task in a Gate task.", versioned=false) public class Dependency extends BaseConfigurationItem implements CiWithInternalMetadata
Dependency is a link from a gate task to a plan item (release, phase or task) on which the gate depends.

There are several possible states of a dependency:

- Variable dependency. In this case the `targetId` contains a variable expression like ${varPhaseId}, and `target` is null.
- Dependency with string target. In this case the `targetId` contains a plan item ID, and `target` is null.
  - It is possible that `targetId` was emptied by a public API call or by deleting a variable. Then such a dependency does not contain neither `target` nor `targetId` and will cause a Gate to fail.
- Normal dependency. In this case the `target` field points to the plan item on which the `gateTask` depends.
- Archived dependency. A dependency becomes "archived" when the target plan item was deleted, for example when archiving old completed releases. In this case the `target` is `null`, and the information about archived plan item is stored in fields `archivedTargetId`, `archivedTargetTitle` and `archivedAsResolved`. The latter shows if the plan item was `COMPLETED` or `ABORTED`.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `PROPERTY_TARGET`
  `static final String`
  `TYPE_DEPENDENCY`

  ### 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
  `Dependency()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `archive()`
  `static String`
  `createArchivedTargetTitle(PlanItem planItem)`
  `Map<String,InternalMetadata>`
  `get$metadata()`
  `String`
  `getArchivedTargetId()`
  `String`
  `getArchivedTargetTitle()`
  `GateTask`
  `getGateTask()`
  `<T extends PlanItem>
  T`
  `getTarget()`
  `String`
  `getTargetDisplayPath()`
  `String`
  `getTargetId()`
  `String`
  `getTargetTitle()`
  `boolean`
  `hasResolvedTarget()`
  `boolean`
  `hasValidArchiveTargetId()`
  `boolean`
  `hasVariableTarget()`
  `boolean`
  `isAborted()`
  `boolean`
  `isArchived()`
  `boolean`
  `isArchivedAsResolved()`
  `boolean`
  `isDone()`
  `void`
  `setGateTask(GateTask gateTask)`
  `void`
  `setTarget(PlanItem target)`
  `void`
  `setTargetId(String targetId)`

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

- ## Field Details

  - ### TYPE_DEPENDENCY

    public static final String TYPE_DEPENDENCY

  - ### PROPERTY_TARGET

    public static final String PROPERTY_TARGET
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Dependency

    public Dependency()

- ## Method Details

  - ### getGateTask

    public GateTask getGateTask()

  - ### setGateTask

    public void setGateTask(GateTask gateTask)

  - ### getTarget

    public <T extends PlanItem> T getTarget()

  - ### setTarget

    public void setTarget(PlanItem target)

  - ### getTargetId

    public String getTargetId()

  - ### setTargetId

    public void setTargetId(String targetId)

  - ### getArchivedTargetId

    public String getArchivedTargetId()

  - ### getArchivedTargetTitle

    public String getArchivedTargetTitle()

  - ### isArchived

    public boolean isArchived()

  - ### isDone

    public boolean isDone()

  - ### isAborted

    public boolean isAborted()

  - ### getTargetDisplayPath

    public String getTargetDisplayPath()

  - ### getTargetTitle

    public String getTargetTitle()

  - ### archive

    public void archive()

  - ### isArchivedAsResolved

    public boolean isArchivedAsResolved()

  - ### createArchivedTargetTitle

    public static String createArchivedTargetTitle(PlanItem planItem)

  - ### hasResolvedTarget

    public boolean hasResolvedTarget()

  - ### hasVariableTarget

    public boolean hasVariableTarget()

  - ### hasValidArchiveTargetId

    public boolean hasValidArchiveTargetId()

  - ### get$metadata

    public Map<String,InternalMetadata> get$metadata()
    Specified by:
      `get$metadata` in interface `CiWithInternalMetadata`