java.lang.Object
hudson.model.AbstractDescribableImpl<Step>
org.jenkinsci.plugins.workflow.steps.Step
All Implemented Interfaces:
ExtensionPoint, Describable<Step>
Direct Known Subclasses:
AbstractStepImpl

public abstract class Step extends AbstractDescribableImpl<Step> implements ExtensionPoint
One thing that can be done, perhaps asynchronously. A Step is merely the definition of how this task is configured; StepExecution represents any state associated with one actual run of it.

Extends from Describable to support UI-based instantiation. Your step should have a config.jelly allowing a user to configure its properties, and may have a help.html and/or help-fieldName.html, plus doEtc methods on the StepDescriptor for form validation, completion, and so on. It should have a DataBoundConstructor specifying mandatory properties. It may also use DataBoundSetter for optional properties. All properties also need public getters (or to be public fields) for data binding to work.

  • Constructor Details

    • Step

      public Step()
  • Method Details

    • start

      public abstract StepExecution start(StepContext context) throws Exception
      Start execution of something and report the end result back to the given callback. Arguments are passed when instantiating steps.
      Returns:
      true if the execution of this step has synchronously completed before this method returns. It is the callee's responsibility to set the return value via StepContext.onSuccess(Object) or FutureCallback.onFailure(Throwable). false if the asynchronous execution has started and that StepContext will be notified when the result comes in. (Note that the nature of asynchrony is such that it is possible for the StepContext to be already notified before this method returns.)
      Throws:
      Exception - if any exception is thrown, Step is assumed to have completed abnormally synchronously (as if FutureCallback.onFailure(java.lang.Throwable) is called and the method returned true.)
      See Also:
    • getDescriptor

      public StepDescriptor getDescriptor()
      Specified by:
      getDescriptor in interface Describable<Step>
      Overrides:
      getDescriptor in class AbstractDescribableImpl<Step>