Class CustomScriptTask

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

@Metadata(label="Python Script", versioned=false) public class CustomScriptTask extends BaseScriptTask
See Also:
  • Field Details

  • 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
    • getStatusLine

      public String getStatusLine()
    • setStatusLine

      public void setStatusLine(String statusLine)
    • 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