Skip to content
Permalink
Browse files
Merge pull request #37 from jglick/buildable-orphan-JENKINS-40521
[JENKINS-40521] Added WorkflowJobProperty.isBuildable
  • Loading branch information
jglick committed Feb 10, 2017
2 parents 00d7e14 + 333bd36 commit c2bb083e4c21baa50c94d5fd57f386a8a82fcebd
@@ -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?
}

@@ -26,6 +26,7 @@

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

/**
@@ -40,4 +41,12 @@
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 c2bb083

Please sign in to comment.