All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.plugins.jira.workflow.Workflow.groovy Maven / Gradle / Ivy

The newest version!
package net.serenitybdd.plugins.jira.workflow
/**
 * Manage JIRA workflow integration.
 * JIRA workflow integration is configured using a simple Groovy DSL to define the transitionSetMap to be performed
 * for each test result.
 */
class Workflow {

    private final String name;
    private final boolean active;

    def builder = new TransitionBuilder()

    protected Workflow(String name, String configuration, boolean active) {
        this.name = name;
        this.active = active;
        Script s = new GroovyClassLoader().parseClass(configuration).newInstance()
        s.binding = new BuilderBinding(builder:builder)
        s.run()
    }

    String getName() {
        return name;
    }

    boolean isActive() {
        return active;
    }

    TransitionBuilder.TransitionSetMap getTransitions() {
        builder.getTransitionSetMap()
    }
}

class BuilderBinding extends Binding {
    def builder
    Object getVariable(String name) {
        return { Object... args ->  builder.invokeMethod(name,args) }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy