Search in sources :

Example 1 with DisableResumeJobProperty

use of org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty in project workflow-job-plugin by jenkinsci.

the class WorkflowJob method setResumeBlocked.

@Override
public void setResumeBlocked(boolean resumeBlocked) {
    try {
        boolean previousState = isResumeBlocked();
        if (resumeBlocked != previousState) {
            BulkChange bc = new BulkChange(this);
            try {
                removeProperty(DisableResumeJobProperty.class);
                if (resumeBlocked) {
                    addProperty(new DisableResumeJobProperty());
                }
                bc.commit();
            } finally {
                bc.abort();
            }
        }
    } catch (IOException ioe) {
        LOGGER.log(Level.WARNING, "Error persisting resume property statue", ioe);
    }
}
Also used : DisableResumeJobProperty(org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty) BulkChange(hudson.BulkChange) IOException(java.io.IOException)

Aggregations

BulkChange (hudson.BulkChange)1 IOException (java.io.IOException)1 DisableResumeJobProperty (org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty)1