Class WorkflowRun
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.Actionable
-
- hudson.model.Run<WorkflowJob,WorkflowRun>
-
- org.jenkinsci.plugins.workflow.job.WorkflowRun
-
- All Implemented Interfaces:
ExtensionPoint
,DescriptorByNameOwner
,ModelObject
,PersistenceRoot
,Queue.Executable
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Comparable<WorkflowRun>
,Runnable
,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
Nested Classes Modifier and Type Class Description static class
WorkflowRun.Checkouts
static class
WorkflowRun.SCMListenerImpl
-
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, TREE_CUTOFF, UPDATE, XSTREAM, XSTREAM2
-
-
Constructor Summary
Constructors Constructor Description WorkflowRun(WorkflowJob job)
WorkflowRun(WorkflowJob job, File dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner
asFlowExecutionOwner()
protected BuildReference<WorkflowRun>
createReference()
void
deleteArtifacts()
void
doConsoleText(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse 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
dropLinks()
List<ChangeLogSet<? extends ChangeLogSet.Entry>>
getChangeSets()
Set<String>
getCulpritIds()
Set<User>
getCulprits()
EnvVars
getEnvironment(TaskListener listener)
org.jenkinsci.plugins.workflow.flow.FlowExecution
getExecution()
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>
getExecutionPromise()
Allows the caller to block onFlowExecution
, which gets created relatively quickly after the build gets going.String
getFlowGraphDataAsHtml()
For use by Jelly only.String
getLog()
List<String>
getLog(int maxLines)
File
getLogFile()
Deprecated.InputStream
getLogInputStream()
Reader
getLogReader()
AnnotatedLargeText
getLogText()
WorkflowRun
getNextBuild()
WorkflowRun
getPreviousBuild()
LazyBuildMixIn.RunMixIn<WorkflowJob,WorkflowRun>
getRunMixIn()
List<SCM>
getSCMs()
boolean
hasAllowKill()
boolean
hasAllowTerm()
boolean
hasntStartedYet()
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
isBuilding()
boolean
isInProgress()
boolean
isLogUpdated()
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
setResult(Result r)
boolean
shouldCalculateCulprits()
-
Methods inherited from class hudson.model.Run
_this, addAction, canToggleLogKeep, compareTo, delete, doArtifact, doBuildNumber, doBuildStatus, doBuildTimestamp, doConfigSubmit, doDoDelete, doProgressiveLog, doSubmitDescription, doToggleLogKeep, execute, fromExternalizableId, getAbsoluteUrl, getACL, getApi, getArtifactManager, getArtifacts, getArtifactsDir, getArtifactsUpTo, getBadgeActions, getBuildFingerprints, getBuildsOverThreshold, getBuildStatusIconClassName, getBuildStatusSummary, getBuildStatusUrl, getCause, getCauses, getCharacteristicEnvVars, getCharset, getDescription, getDisplayName, getDuration, getDurationString, getDynamic, getEnvironment, getEnvVars, getEstimatedDuration, getExecutor, getExternalizableId, getFullDisplayName, getHasArtifacts, getIconColor, getId, getNumber, getOneOffExecutor, getParent, getPreviousBuildInProgress, getPreviousBuildsOverThreshold, getPreviousBuiltBuild, getPreviousCompletedBuild, getPreviousFailedBuild, getPreviousNotFailedBuild, getPreviousSuccessfulBuild, getQueueId, getResult, getRootDir, getSearchUrl, getStartTimeInMillis, getTarget, getTime, getTimeInMillis, getTimestamp, getTimestampString, getTimestampString2, getTransientActions, getTruncatedDescription, 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, 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
-
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 hudson.model.Queue.Executable
getEstimatedDuration, getParent, getParentExecutable, toString
-
Methods inherited from interface jenkins.scm.RunWithSCM
calculateCulprits, hasParticipant
-
-
-
-
Constructor Detail
-
WorkflowRun
public WorkflowRun(WorkflowJob job) throws IOException
- Throws:
IOException
-
WorkflowRun
public WorkflowRun(WorkflowJob job, File dir) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getRunMixIn
public LazyBuildMixIn.RunMixIn<WorkflowJob,WorkflowRun> getRunMixIn()
- Specified by:
getRunMixIn
in interfaceLazyBuildMixIn.LazyLoadingRun<WorkflowJob,WorkflowRun>
-
createReference
@NonNull protected BuildReference<WorkflowRun> createReference()
- Overrides:
createReference
in classRun<WorkflowJob,WorkflowRun>
-
dropLinks
protected void dropLinks()
- Overrides:
dropLinks
in classRun<WorkflowJob,WorkflowRun>
-
getPreviousBuild
@Exported public WorkflowRun getPreviousBuild()
- Overrides:
getPreviousBuild
in classRun<WorkflowJob,WorkflowRun>
-
getNextBuild
@Exported public 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
public void reload() throws IOException
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
public void setResult(@NonNull Result r)
- Overrides:
setResult
in classRun<WorkflowJob,WorkflowRun>
-
deleteArtifacts
public void deleteArtifacts() throws IOException
- 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()
- 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>
-
getChangeSets
@NonNull @Exported public List<ChangeLogSet<? extends ChangeLogSet.Entry>> getChangeSets()
- Specified by:
getChangeSets
in interfaceRunWithSCM<WorkflowJob,WorkflowRun>
-
getCulpritIds
@CheckForNull public Set<String> getCulpritIds()
- Specified by:
getCulpritIds
in interfaceRunWithSCM<WorkflowJob,WorkflowRun>
-
getCulprits
@Exported @NonNull public Set<User> 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
@NonNull public AnnotatedLargeText getLogText()
- Overrides:
getLogText
in classRun<WorkflowJob,WorkflowRun>
-
getFlowGraphDataAsHtml
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public String getFlowGraphDataAsHtml()
For use by Jelly only.
-
getLogInputStream
@NonNull public InputStream getLogInputStream() throws IOException
- Overrides:
getLogInputStream
in classRun<WorkflowJob,WorkflowRun>
- Throws:
IOException
-
doConsoleText
public void doConsoleText(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
- Overrides:
doConsoleText
in classRun<WorkflowJob,WorkflowRun>
- Throws:
IOException
-
getLogReader
@NonNull public Reader getLogReader() throws IOException
- Overrides:
getLogReader
in classRun<WorkflowJob,WorkflowRun>
- Throws:
IOException
-
getLog
@NonNull public String getLog() throws IOException
- Overrides:
getLog
in classRun<WorkflowJob,WorkflowRun>
- Throws:
IOException
-
getLog
@NonNull public List<String> getLog(int maxLines) throws IOException
- Overrides:
getLog
in classRun<WorkflowJob,WorkflowRun>
- Throws:
IOException
-
getLogFile
@Deprecated @NonNull public File getLogFile()
Deprecated.- Overrides:
getLogFile
in classRun<WorkflowJob,WorkflowRun>
-
save
public void save() throws IOException
- Specified by:
save
in interfaceSaveable
- Overrides:
save
in classRun<WorkflowJob,WorkflowRun>
- Throws:
IOException
-
-