Class WorkflowRun
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,ModelObject
,PersistenceRoot
,Queue.Executable
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Comparable<WorkflowRun>
,Runnable
,WithConsoleUrl
,HistoricalBuild
,LazyBuildMixIn.LazyLoadingRun<WorkflowJob,
,WorkflowRun> ModelObjectWithContextMenu
,RunWithSCM<WorkflowJob,
,WorkflowRun> OnMaster
,org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner.Executable
,org.kohsuke.stapler.StaplerProxy
public final class WorkflowRun
extends Run<WorkflowJob,WorkflowRun>
implements org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner.Executable, LazyBuildMixIn.LazyLoadingRun<WorkflowJob,WorkflowRun>, RunWithSCM<WorkflowJob,WorkflowRun>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static final class
Nested classes/interfaces inherited from class hudson.model.Run
Run.Artifact, Run.ArtifactList, Run.KeepLogBuildBadge, Run.RedirectUp, Run.RunExecution, Run.Runner, Run.RunnerAbortedException, Run.StatusSummarizer, Run.Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
Field Summary
Fields inherited from class hudson.model.Run
ARTIFACTS, charset, DELETE, description, duration, FEED_ADAPTER, FEED_ADAPTER_LATEST, LIST_CUTOFF, nextBuild, number, ORDER_BY_DATE, PERMISSIONS, previousBuild, project, QUEUE_ID_UNKNOWN, result, SKIP_PERMISSION_CHECK, timestamp, UPDATE, XSTREAM, XSTREAM2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.jenkinsci.plugins.workflow.flow.FlowExecutionOwner
protected BuildReference<WorkflowRun>
void
void
doConsoleText
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) void
doKill()
Immediately kills the build.org.kohsuke.stapler.HttpResponse
doStop()
void
doTerm()
SendsFutureCallback.onFailure(java.lang.Throwable)
to all running (leaf) steps.protected void
List<ChangeLogSet<? extends ChangeLogSet.Entry>>
getEnvironment
(TaskListener listener) org.jenkinsci.plugins.workflow.flow.FlowExecution
Gets the associated execution state, and do a more expensive loading operation if not initialized.com.google.common.util.concurrent.ListenableFuture<org.jenkinsci.plugins.workflow.flow.FlowExecution>
Allows the caller to block onFlowExecution
, which gets created relatively quickly after the build gets going.For use by Jelly only.getLog()
getLog
(int maxLines) Deprecated.getSCMs()
boolean
boolean
boolean
org.kohsuke.stapler.HttpResponse
httpKill()
Immediately kills the build.org.kohsuke.stapler.HttpResponse
httpTerm()
SendsFutureCallback.onFailure(java.lang.Throwable)
to all running (leaf) steps.boolean
boolean
boolean
protected void
onLoad()
void
reload()
Hack to allowexecution
to use anWorkflowRun.Owner
referring to this run, even when it has not yet been loaded.void
run()
Actually executes the workflow.void
save()
void
boolean
Methods inherited from class hudson.model.Run
_this, addAction, canToggleLogKeep, compareTo, delete, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doConsoleText, doDoDelete, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, execute, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifactManager, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildFingerprints, getBuildsOverThreshold, getBuildStatusSummary, getCause, getCauses, getCharacteristicEnvVars, getCharset, getConsoleUrl, getDescription, getDisplayName, getDuration, getDurationString, getDynamic, getDynamic, getEnvironment, getEnvVars, getEstimatedDuration, getExecutor, getExternalizableId, getFullDisplayName, getHasArtifacts, getIconColor, getId, getNumber, getOneOffExecutor, getParameterValues, getParent, getPreviousBuildInProgress, getPreviousBuildsOverThreshold, getPreviousBuiltBuild, getPreviousCompletedBuild, getPreviousFailedBuild, getPreviousNotFailedBuild, getPreviousSuccessfulBuild, getQueueId, getResult, getRootDir, getSearchUrl, getStartTimeInMillis, getTarget, getTime, getTimeInMillis, getTimestamp, getTimestampString, getTimestampString2, getTransientActions, getUrl, getWhyKeepLog, hasCustomDisplayName, isKeepLog, keepLog, keepLog, makeSearchIndex, onEndBuilding, onStartBuilding, pickArtifactManager, run, setDescription, setDisplayName, setQueueId, submit, toString, updateSymlinks, writeLogTo, writeReplace, writeWholeLogTo
Methods inherited from class hudson.model.Actionable
addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, removeAction, removeActions, replaceAction, replaceActions
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
Methods inherited from interface jenkins.model.HistoricalBuild
getBuildStatusIconClassName, getBuildStatusUrl, getTruncatedDescription
Methods inherited from interface hudson.model.Queue.Executable
getConsoleUrl, getEstimatedDuration, getParent, getParentExecutable, toString
Methods inherited from interface jenkins.scm.RunWithSCM
calculateCulprits, hasParticipant
-
Constructor Details
-
WorkflowRun
- Throws:
IOException
-
WorkflowRun
- Throws:
IOException
-
-
Method Details
-
getRunMixIn
- Specified by:
getRunMixIn
in interfaceLazyBuildMixIn.LazyLoadingRun<WorkflowJob,
WorkflowRun>
-
createReference
- Overrides:
createReference
in classRun<WorkflowJob,
WorkflowRun>
-
dropLinks
protected void dropLinks()- Overrides:
dropLinks
in classRun<WorkflowJob,
WorkflowRun>
-
getPreviousBuild
- Overrides:
getPreviousBuild
in classRun<WorkflowJob,
WorkflowRun>
-
getNextBuild
- Overrides:
getNextBuild
in classRun<WorkflowJob,
WorkflowRun>
-
run
public void run()Actually executes the workflow.- Specified by:
run
in interfaceQueue.Executable
- Specified by:
run
in interfaceRunnable
-
doTerm
public void doTerm()SendsFutureCallback.onFailure(java.lang.Throwable)
to all running (leaf) steps. -
httpTerm
@WebMethod(name="term") @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse httpTerm()SendsFutureCallback.onFailure(java.lang.Throwable)
to all running (leaf) steps. -
doKill
public void doKill()Immediately kills the build. -
httpKill
@WebMethod(name="kill") @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse httpKill()Immediately kills the build. -
getEnvironment
@NonNull public EnvVars getEnvironment(@NonNull TaskListener listener) throws IOException, InterruptedException - Overrides:
getEnvironment
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
InterruptedException
-
hasAllowTerm
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public boolean hasAllowTerm() -
hasAllowKill
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public boolean hasAllowKill() -
reload
Hack to allowexecution
to use anWorkflowRun.Owner
referring to this run, even when it has not yet been loaded.- Overrides:
reload
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-
onLoad
protected void onLoad()- Overrides:
onLoad
in classRun<WorkflowJob,
WorkflowRun>
-
setResult
- Overrides:
setResult
in classRun<WorkflowJob,
WorkflowRun>
-
deleteArtifacts
- Overrides:
deleteArtifacts
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-
getExecution
@CheckForNull public org.jenkinsci.plugins.workflow.flow.FlowExecution getExecution()Gets the associated execution state, and do a more expensive loading operation if not initialized. Performs all the needed initialization for the execution pre-loading too -- sets the executionPromise, adds Listener, calls onLoad on it etc.- Returns:
- non-null after the flow has started, even after finished (but may be null temporarily when about to start, or if starting failed)
-
getExecutionPromise
@NonNull public com.google.common.util.concurrent.ListenableFuture<org.jenkinsci.plugins.workflow.flow.FlowExecution> getExecutionPromise()Allows the caller to block onFlowExecution
, which gets created relatively quickly after the build gets going. -
asFlowExecutionOwner
@NonNull public org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner asFlowExecutionOwner()- Specified by:
asFlowExecutionOwner
in interfaceorg.jenkinsci.plugins.workflow.flow.FlowExecutionOwner.Executable
-
hasntStartedYet
public boolean hasntStartedYet()- Overrides:
hasntStartedYet
in classRun<WorkflowJob,
WorkflowRun>
-
isBuilding
public boolean isBuilding()- Specified by:
isBuilding
in interfaceHistoricalBuild
- Overrides:
isBuilding
in classRun<WorkflowJob,
WorkflowRun>
-
isInProgress
@Exported public boolean isInProgress()- Overrides:
isInProgress
in classRun<WorkflowJob,
WorkflowRun>
-
isLogUpdated
public boolean isLogUpdated()- Overrides:
isLogUpdated
in classRun<WorkflowJob,
WorkflowRun>
-
getSCMs
-
getChangeSets
- Specified by:
getChangeSets
in interfaceRunWithSCM<WorkflowJob,
WorkflowRun>
-
getCulpritIds
- Specified by:
getCulpritIds
in interfaceRunWithSCM<WorkflowJob,
WorkflowRun>
-
getCulprits
- Specified by:
getCulprits
in interfaceRunWithSCM<WorkflowJob,
WorkflowRun>
-
shouldCalculateCulprits
public boolean shouldCalculateCulprits()- Specified by:
shouldCalculateCulprits
in interfaceRunWithSCM<WorkflowJob,
WorkflowRun>
-
doStop
public org.kohsuke.stapler.HttpResponse doStop() -
getLogText
- Overrides:
getLogText
in classRun<WorkflowJob,
WorkflowRun>
-
getFlowGraphDataAsHtml
For use by Jelly only. -
getLogInputStream
- Overrides:
getLogInputStream
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-
doConsoleText
public void doConsoleText(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException - Overrides:
doConsoleText
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-
getLogReader
- Overrides:
getLogReader
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-
getLog
- Overrides:
getLog
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-
getLog
- Overrides:
getLog
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-
getLogFile
Deprecated.- Overrides:
getLogFile
in classRun<WorkflowJob,
WorkflowRun>
-
save
- Specified by:
save
in interfaceSaveable
- Overrides:
save
in classRun<WorkflowJob,
WorkflowRun> - Throws:
IOException
-