Skip to content

Commit

Permalink
[JENKINS-40521] Added WorkflowJobProperty.isBuildable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Feb 6, 2017
1 parent 139ac7e commit 333bd36
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Expand Up @@ -205,6 +205,14 @@ public void setDefinition(FlowDefinition definition) {
}

@Override public boolean isBuildable() {
for (JobProperty<?> property : properties) {
if (property instanceof WorkflowJobProperty) {
Boolean buildable = ((WorkflowJobProperty) property).isBuildable();
if (buildable != null) {
return buildable;
}
}
}
return true; // why not?
}

Expand Down
Expand Up @@ -26,6 +26,7 @@

import hudson.model.JobProperty;
import hudson.security.ACL;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

/**
Expand All @@ -40,4 +41,12 @@ public abstract class WorkflowJobProperty extends JobProperty<WorkflowJob> {
return acl;
}

/**
* Allows a property to control whether {@link WorkflowJob#isBuildable}.
* @return a value, or null to have no effect
*/
public @CheckForNull Boolean isBuildable() {
return null;
}

}

0 comments on commit 333bd36

Please sign in to comment.