Package com.xebialabs.xlrelease.domain

# Class CustomScriptTask

java.lang.Object
com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
com.xebialabs.xlrelease.domain.PlanItem
com.xebialabs.xlrelease.domain.Task
com.xebialabs.xlrelease.domain.BaseScriptTask
com.xebialabs.xlrelease.domain.CustomScriptTask

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

@Metadata(label="Python Script", versioned=false) public class CustomScriptTask extends BaseScriptTask

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `IGNORE_SCRIPT_VARIABLE_INTERPOLATION`
  `static final String`
  `PYTHON_SCRIPT_PREFIX`
  `static final String`
  `SCRIPT_PROPERTY_NAME`
  `static final Type`
  `UNKNOWN_TYPE`
  `static final String`
  `WAIT_FOR_SIGNAL_PROPERTY_NAME`

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

  `CATEGORY_INPUT, CATEGORY_OUTPUT, delayDuringBlackout, DUE_SOON_THRESHOLD, executionId, failureHandler, failuresCount, hasBeenDelayed, hasBeenFlagged, IS_AUTOMATED_AND_IN_PROGRESS, maxCommentSize, originalScheduledStartDate, postponedDueToBlackout, postponedUntilEnvironmentsAreReserved, precondition, tags, taskFailureHandlerEnabled, taskRecoverOp, team, UNKNOWN_TASK_TYPE, variableMapping, waitForScheduledStartDate`

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Changes`
  `execute(String targetId, TaskStartOrRetryOperation operation)`
  `Changes`
  `fail(String targetId, String failReason, User user, boolean fromAbort)`
  `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.
  `String`
  `getAbortScript()`
  `String`
  `getAbortScriptPath()`
  `String`
  `getEngine()`
  `Integer`
  `getInterval()`
  `String`
  `getNextScriptPath()`
  `PythonScript`
  `getPythonScript()`
  `String`
  `getScriptPath()`
  `int`
  `getScriptTimeout()`
  `List<UsagePoint>`
  `getVariableUsages()`
  `boolean`
  `hasAbortScript()`
  `boolean`
  `hasNextScriptToExecute()`
  `boolean`
  `isFailureHandlerEnabled()`
  `boolean`
  `isKeepPreviousOutputPropertiesOnRetry()`
  `boolean`
  `isPreconditionEnabled()`
  `boolean`
  `isPropertyVariableInterpolationOff(PythonScript pythonScript)`
  `boolean`
  `isSupportedInWorkflow()`
  `boolean`
  `isUnknown()`
  `boolean`
  `isWaitingForSignal()`
  `void`
  `resetSchedule()`
  `Changes`
  `retry(String targetId)`
  `void`
  `schedule(String scriptPath)`
  Tells the custom script task that the next script needs to be scheduled after this Jython script is finished.
  `void`
  `schedule(String scriptPath, Integer interval)`
  Tells the custom script task that the next script needs to be scheduled after this Jython script is finished with specified delay in seconds.
  `void`
  `setInterval(Integer interval)`
  `void`
  `setKeepPreviousOutputPropertiesOnRetry(boolean keepPreviousOutputPropertiesOnRetry)`
  `void`
  `setNextScriptPath(String nextScriptPath)`
  `void`
  `setPythonScript(PythonScript pythonScript)`
  `protected boolean`
  `shouldFreezeVariableMapping(CiProperty property)`

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

  `executeScript`

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

  `abort, accept, addWatcher, applyDefaults, canBeBackup, canScheduleTaskStart, canStartNow, checkDatesValidity, clearComments, clearModificationAttributes, delayDuringBlackoutHasChanged, deleteAttachment, deleteTask, fail, fail, fail, failureHandlerHasChanged, findComment, freezeVariables, fromType, fromType, generateExecutionId, getAllTasks, getAttachments, getChildren, getCiUid, getComments, getConfigurationUri, getContainer, getDelayedCount, getDisplayPath, getDocumentationPage, getElapsedDurationFraction, getExecutionId, getFacets, getFailureHandler, getFailuresCount, getFlaggedCount, getInputVariables, getLastStatusChangeBy, getMaxCommentSize, getOriginalScheduledStartDate, getPhase, getPrecondition, getReferencedVariableKeys, getReferencedVariables, getRelease, getReleaseOwner, getReleaseUid, getStatus, getStatusLine, getTags, getTaskRecoverOp, getTaskType, getTeam, getUnboundRequiredVariables, getUrl, getVariableMapping, getWatchers, hasBeenDelayed, hasBeenFlagged, hasBeenStarted, hasFailureHandlerScript, hasTaskRecoverOp, hasTeam, hasVariableMapping, isAborted, isAbortScriptInProgress, isActive, isAssignedTo, isAutomated, isCheckAttributes, isCompletedInAdvance, isDefaultTaskType, isDefunct, isDelayDuringBlackout, isDone, isDoneInAdvance, isDueSoon, isDueSoonNotified, isFacetInProgress, isFailed, isFailing, isFailureHandlerInProgress, isGate, isInProgress, isLocked, isMovable, isNotYetReached, isParallelGroup, isPending, isPlanned, isPostponedDueToBlackout, isPostponedUntilEnvironmentsAreReserved, isPreconditionInProgress, isSkipped, isSkippedInAdvance, isStillExecutingScript, isTaskFailureHandlerEnabled, isTaskGroup, isUpdatable, isWaitForScheduledStartDate, isWaitingForInput, lock, markAsDone, markAsFailing, ownerHasBeenReassigned, postponeUntilEnvironmentsAreReserved, preconditionHasChanged, removeWatcher, reopen, replaceTask, resetToPlanned, setAttachments, setCheckAttributes, setCiUid, setConfigurationUri, setContainer, setDelayDuringBlackout, setDocumentationPage, setDueSoonNotified, setExecutionId, setFacets, setFailureHandler, setFailuresCount, setFlagStatus, setHasBeenDelayed, setHasBeenFlagged, setLocked, setMaxCommentSize, setOriginalScheduledStartDate, setPostponedDueToBlackout, setPostponedUntilEnvironmentsAreReserved, setPrecondition, setReleaseUid, setScheduledStartDate, setStatus, setStatusLine, setSupportedInWorkflow, setTags, setTaskFailureHandlerEnabled, setTaskRecoverOp, setTeam, setVariableMapping, setWaitForScheduledStartDate, setWatchers, shouldFacetBeChecked, shouldNotifyDueSoon, shouldPreconditionBeChecked, start, startNow, startPending, startWithInput, teamHasBeenReassigned, unlock, updateComment`

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

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

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

- ## Field Details

  - ### UNKNOWN_TYPE

    public static final Type UNKNOWN_TYPE

  - ### PYTHON_SCRIPT_PREFIX

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

  - ### IGNORE_SCRIPT_VARIABLE_INTERPOLATION

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

  - ### SCRIPT_PROPERTY_NAME

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

  - ### WAIT_FOR_SIGNAL_PROPERTY_NAME

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

- ## Constructor Details

  - ### CustomScriptTask

    public CustomScriptTask()

- ## Method Details

  - ### freezeVariablesInCustomFields

    public Set<String> freezeVariablesInCustomFields(Map<String,ValueWithInterpolation> variables, Map<String,String> passwordVariables, Changes changes, boolean freezeEvenIfUnresolved)
    Description copied from class: `Task`

    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`.
    Overrides:
      `freezeVariablesInCustomFields` in class `Task`

  - ### shouldFreezeVariableMapping

    protected boolean shouldFreezeVariableMapping(CiProperty property)
    Overrides:
      `shouldFreezeVariableMapping` in class `Task`

  - ### isPreconditionEnabled

    public boolean isPreconditionEnabled()
    Overrides:
      `isPreconditionEnabled` in class `Task`

  - ### isFailureHandlerEnabled

    public boolean isFailureHandlerEnabled()
    Overrides:
      `isFailureHandlerEnabled` in class `Task`

  - ### execute

    protected Changes execute(String targetId, TaskStartOrRetryOperation operation)
    Overrides:
      `execute` in class `Task`

  - ### getPythonScript

    public PythonScript getPythonScript()

  - ### setPythonScript

    public void setPythonScript(PythonScript pythonScript)

  - ### getEngine

    public String getEngine()
    Specified by:
      `getEngine` in class `BaseScriptTask`

  - ### getVariableUsages

    public List<UsagePoint> getVariableUsages()
    Overrides:
      `getVariableUsages` in class `Task`

  - ### setNextScriptPath

    public void setNextScriptPath(String nextScriptPath)

  - ### getNextScriptPath

    public String getNextScriptPath()

  - ### getInterval

    public Integer getInterval()

  - ### setInterval

    public void setInterval(Integer interval)

  - ### hasNextScriptToExecute

    public boolean hasNextScriptToExecute()

  - ### schedule

    public void schedule(String scriptPath)
    Tells the custom script task that the next script needs to be scheduled after this Jython script is finished. The passed script path must be a valid Jython script on the classpath.

  - ### schedule

    public void schedule(String scriptPath, Integer interval)
    Tells the custom script task that the next script needs to be scheduled after this Jython script is finished with specified delay in seconds. The passed script path must be a valid Jython script on the classpath. The passed interval must be any value between 1 and 231-1.

  - ### resetSchedule

    public void resetSchedule()

  - ### fail

    public Changes fail(String targetId, String failReason, User user, boolean fromAbort)
    Overrides:
      `fail` in class `Task`

  - ### isWaitingForSignal

    public boolean isWaitingForSignal()

  - ### retry

    public Changes retry(String targetId)
    Overrides:
      `retry` in class `Task`

  - ### getScriptPath

    public String getScriptPath()

  - ### hasAbortScript

    public boolean hasAbortScript()
    Overrides:
      `hasAbortScript` in class `Task`

  - ### getAbortScriptPath

    public String getAbortScriptPath()

  - ### getAbortScript

    public String getAbortScript() throws IOException
    Overrides:
      `getAbortScript` in class `Task`
    Throws:
      `IOException`

  - ### isPropertyVariableInterpolationOff

    public boolean isPropertyVariableInterpolationOff(PythonScript pythonScript)

  - ### isUnknown

    public boolean isUnknown()

  - ### isKeepPreviousOutputPropertiesOnRetry

    public boolean isKeepPreviousOutputPropertiesOnRetry()

  - ### setKeepPreviousOutputPropertiesOnRetry

    public void setKeepPreviousOutputPropertiesOnRetry(boolean keepPreviousOutputPropertiesOnRetry)

  - ### isSupportedInWorkflow

    public boolean isSupportedInWorkflow()
    Overrides:
      `isSupportedInWorkflow` in class `Task`

  - ### getScriptTimeout

    public int getScriptTimeout()