Package com.xebialabs.xlrelease.domain
Class Task
java.lang.Object
com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
com.xebialabs.xlrelease.domain.PlanItem
com.xebialabs.xlrelease.domain.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 Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
protected boolean
static final double
protected String
protected String
protected int
protected boolean
protected boolean
protected int
protected Date
protected boolean
protected boolean
protected String
protected boolean
protected TaskRecoverOp
protected String
static final Type
protected boolean
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 -
Method Summary
Modifier and TypeMethodDescriptionabort()
void
accept
(ReleaseVisitor visitor) void
addWatcher
(String watcher) protected void
boolean
boolean
boolean
void
void
void
boolean
void
deleteAttachment
(String attachmentId) void
deleteTask
(Task task) protected Changes
execute
(String targetId, TaskStartOrRetryOperation operation) boolean
failureHandlerHasChanged
(Task task) findComment
(String commentId) freezeVariables
(Changes changes, boolean freezeEvenIfUnresolved) 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.static <T extends Task>
Tstatic <T extends Task>
Tvoid
getCiUid()
int
double
int
int
int
getPhase()
getTags()
getTeam()
getUrl()
boolean
boolean
boolean
boolean
protected boolean
protected boolean
boolean
hasTeam()
boolean
boolean
boolean
boolean
isActive()
boolean
isAssignedTo
(Team team) boolean
boolean
boolean
static boolean
isDefaultTaskType
(Type type) boolean
boolean
boolean
isDone()
boolean
boolean
boolean
boolean
boolean
isFailed()
boolean
boolean
boolean
boolean
isGate()
boolean
boolean
isLocked()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isStillExecutingScript
(String executionId) boolean
boolean
boolean
boolean
boolean
boolean
void
lock()
markAsDone
(String targetId, TaskStatus status) boolean
ownerHasBeenReassigned
(Task task) postponeUntilEnvironmentsAreReserved
(Date postponeUntil) boolean
preconditionHasChanged
(Task task) void
removeWatcher
(String watcher) reopen()
void
replaceTask
(Task task) void
setAttachments
(List<Attachment> attachments) void
setCheckAttributes
(boolean checkAttributes) void
void
setConfigurationUri
(String configurationUri) void
setContainer
(TaskContainer container) void
setDelayDuringBlackout
(boolean delayDuringBlackout) void
setDocumentationPage
(String documentationPage) void
setDueSoonNotified
(boolean dueSoonNotified) void
setExecutionId
(String executionId) void
void
setFailureHandler
(String failureHandler) void
setFailuresCount
(int failuresCount) void
setFlagStatus
(FlagStatus flagStatus) void
setHasBeenDelayed
(boolean hasBeenDelayed) void
setHasBeenFlagged
(boolean hasBeenFlagged) void
setLocked
(boolean locked) void
setMaxCommentSize
(int maxCommentSize) void
setOriginalScheduledStartDate
(Date originalDate) void
setPostponedDueToBlackout
(boolean delay) setPostponedUntilEnvironmentsAreReserved
(boolean postponedUntilEnvironmentsAreReserved) void
setPrecondition
(String precondition) void
setReleaseUid
(Integer releaseUid) void
setScheduledStartDate
(Date scheduledStartDate) void
setStatus
(TaskStatus status) void
setSupportedInWorkflow
(boolean supportedInWorkflow) void
void
setTaskFailureHandlerEnabled
(boolean taskFailureHandlerEnabled) void
setTaskRecoverOp
(TaskRecoverOp taskRecoverOp) void
void
setVariableMapping
(Map<String, String> variableMapping) void
setWaitForScheduledStartDate
(boolean waitForScheduledStartDate) void
setWatchers
(Set<String> watchers) boolean
protected boolean
shouldFreezeVariableMapping
(CiProperty property) boolean
boolean
start()
protected Changes
startPending
(String targetId) boolean
teamHasBeenReassigned
(Task task) void
unlock()
void
updateComment
(Comment originalComment, Comment updatedComment) 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, setOverdueNotified, setOwner, setPlannedDuration, 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
-
Field Details
-
CATEGORY_INPUT
- See Also:
-
CATEGORY_OUTPUT
- See Also:
-
DUE_SOON_THRESHOLD
public static final double DUE_SOON_THRESHOLD- See Also:
-
UNKNOWN_TASK_TYPE
-
team
@Property(required=false, description="The name of the team this task is assigned to.") protected String team -
waitForScheduledStartDate
@Property(required=false, defaultValue="true", description="The task is not started until the scheduledStartDate is reached if set to true.") protected boolean waitForScheduledStartDate -
delayDuringBlackout
@Property(required=false, defaultValue="false", description="The task is to be delayed when a blackout period is active.") protected boolean delayDuringBlackout -
postponedDueToBlackout
@Property(required=false, category="internal", defaultValue="false", description="The task is postponed by a blackout period") protected boolean postponedDueToBlackout -
postponedUntilEnvironmentsAreReserved
@Property(required=false, category="internal", defaultValue="false", description="The task is waiting for environment(s) to be reserved") protected boolean postponedUntilEnvironmentsAreReserved -
originalScheduledStartDate
@Property(required=false, category="internal", description="The original scheduled start date.") protected Date originalScheduledStartDate -
hasBeenFlagged
-
hasBeenDelayed
-
precondition
@Property(required=false, description="A snippet of code that is evaluated when the task is started.") protected String precondition -
failureHandler
@Property(required=false, description="A snippet of code that is evaluated when the task is failed.") protected String failureHandler -
taskFailureHandlerEnabled
@Property(required=false, defaultValue="false", description="The failed script will be executed.") protected boolean taskFailureHandlerEnabled -
taskRecoverOp
@Property(required=false, description="Task recovery operation performed after task failure.") protected TaskRecoverOp taskRecoverOp -
failuresCount
-
executionId
-
variableMapping
@Property(asContainment=true, required=false, description="Map from property name to a variable name that replaces that property") protected Map<String,String> variableMapping -
maxCommentSize
@Property(hidden=true, category="internal", description="Maximum size of a comment on a task. Default value is 32768.", defaultValue="32768") protected int maxCommentSize -
tags
@Property(required=false, description="The tags of the task. Tags can be used for grouping and querying.") protected List<String> tags -
IS_AUTOMATED_AND_IN_PROGRESS
-
-
Constructor Details
-
Task
public Task()
-
-
Method Details
-
getConfigurationUri
-
setConfigurationUri
-
getCiUid
-
setCiUid
-
getDocumentationPage
-
setDocumentationPage
-
getComments
-
getContainer
-
setContainer
-
getStatus
-
setStatus
-
getTeam
-
hasTeam
public boolean hasTeam() -
setTeam
-
getWatchers
-
setWatchers
-
addWatcher
-
removeWatcher
-
setPrecondition
-
getPrecondition
-
getFailureHandler
-
getAbortScript
- Throws:
IOException
-
setFailureHandler
-
isTaskFailureHandlerEnabled
public boolean isTaskFailureHandlerEnabled() -
setTaskFailureHandlerEnabled
public void setTaskFailureHandlerEnabled(boolean taskFailureHandlerEnabled) -
getTaskRecoverOp
-
setTaskRecoverOp
-
getTags
-
setTags
-
isCheckAttributes
public boolean isCheckAttributes() -
setCheckAttributes
public void setCheckAttributes(boolean checkAttributes) -
setVariableMapping
-
getVariableMapping
-
hasVariableMapping
public boolean hasVariableMapping() -
setMaxCommentSize
public void setMaxCommentSize(int maxCommentSize) -
getMaxCommentSize
public int getMaxCommentSize() -
getLastStatusChangeBy
-
isDefaultTaskType
-
fromType
-
fromType
-
applyDefaults
protected void applyDefaults() -
getPhase
-
start
-
canStartNow
public boolean canStartNow() -
canScheduleTaskStart
public boolean canScheduleTaskStart() -
startPending
-
startWithInput
-
retry
-
setScheduledStartDate
- Overrides:
setScheduledStartDate
in classPlanItem
-
startNow
-
execute
-
shouldFacetBeChecked
public boolean shouldFacetBeChecked() -
canBeBackup
public boolean canBeBackup() -
shouldPreconditionBeChecked
public boolean shouldPreconditionBeChecked() -
postponeUntilEnvironmentsAreReserved
-
markAsDone
- Parameters:
targetId
- since tasks nest, this can either be the id of this task or the id of one of its children
-
fail
-
fail
-
fail
-
fail
-
reopen
-
abort
-
hasBeenStarted
public boolean hasBeenStarted()- Specified by:
hasBeenStarted
in classPlanItem
-
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() -
isDoneInAdvance
public boolean isDoneInAdvance() -
isDefunct
public boolean isDefunct() -
isUpdatable
public boolean isUpdatable()- Specified by:
isUpdatable
in classPlanItem
-
isAborted
public boolean isAborted() -
isNotYetReached
public boolean isNotYetReached() -
isPlanned
public boolean isPlanned() -
isActive
public boolean isActive() -
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
-
isGate
public boolean isGate() -
isTaskGroup
public boolean isTaskGroup() -
isParallelGroup
public boolean isParallelGroup() -
getAttachments
-
setAttachments
-
isPreconditionEnabled
public boolean isPreconditionEnabled() -
isFailureHandlerEnabled
public boolean isFailureHandlerEnabled() -
getExecutionId
-
setExecutionId
-
generateExecutionId
public void generateExecutionId() -
deleteAttachment
-
resetToPlanned
-
setFlagStatus
- Overrides:
setFlagStatus
in classPlanItem
-
getRelease
- Specified by:
getRelease
in classPlanItem
-
getReleaseUid
- Specified by:
getReleaseUid
in classPlanItem
-
setReleaseUid
- Specified by:
setReleaseUid
in classPlanItem
-
getDisplayPath
- Specified by:
getDisplayPath
in classPlanItem
-
getReleaseOwner
-
getAllTasks
-
getChildren
- Specified by:
getChildren
in classPlanItem
-
accept
- Specified by:
accept
in interfaceVisitableItem
-
getVariableUsages
- Specified by:
getVariableUsages
in classPlanItem
-
freezeVariables
-
shouldFreezeVariableMapping
-
getInputVariables
-
getReferencedVariables
-
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.
ApplyVariableHelper.replaceAll(Object, Map, Set, boolean)
to each field; if child entities are modified, add them tochanges
. -
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
-
teamHasBeenReassigned
-
delayDuringBlackoutHasChanged
-
failureHandlerHasChanged
-
preconditionHasChanged
-
getTaskType
-
isStillExecutingScript
-
isPostponedDueToBlackout
public boolean isPostponedDueToBlackout() -
setPostponedDueToBlackout
public void setPostponedDueToBlackout(boolean delay) -
getOriginalScheduledStartDate
-
setOriginalScheduledStartDate
-
isDueSoon
public boolean isDueSoon() -
getElapsedDurationFraction
public double getElapsedDurationFraction() -
shouldNotifyDueSoon
public boolean shouldNotifyDueSoon() -
isDueSoonNotified
public boolean isDueSoonNotified() -
setDueSoonNotified
public void setDueSoonNotified(boolean dueSoonNotified) -
deleteTask
-
replaceTask
-
findComment
-
updateComment
-
clearComments
public void clearComments() -
clearModificationAttributes
public void clearModificationAttributes() -
isLocked
public boolean isLocked() -
setLocked
public void setLocked(boolean locked) -
lock
public void lock() -
unlock
public void unlock() -
isSupportedInWorkflow
public boolean isSupportedInWorkflow() -
setSupportedInWorkflow
public void setSupportedInWorkflow(boolean supportedInWorkflow) -
getFacets
-
setFacets
-
getUrl
-
isPostponedUntilEnvironmentsAreReserved
public boolean isPostponedUntilEnvironmentsAreReserved() -
setPostponedUntilEnvironmentsAreReserved
-