Package org.jenkinsci.plugins.workflow.cps

Examples of org.jenkinsci.plugins.workflow.cps.CpsThread


    private transient FlowNode node;

    @Override
    public boolean start() throws Exception {
        CpsStepContext cps = (CpsStepContext) getContext();
        CpsThread t = CpsThread.current();

        GroovyShell shell = t.getExecution().getShell();

        Script script = shell.parse(cwd.child(step.getPath()).readToString());

        node.addAction(new LabelAction("Loaded script: "+step.getPath()));

        // execute body as another thread that shares the same head as this thread
        // as the body can pause.
        cps.invokeBodyLater(
                t.getGroup().export(script),
                Collections.<Action>emptyList()
        ).addCallback(cps); // when the body is done, the load step is done

        return false;
    }
View Full Code Here


        // TODO: we need to take over the flow node creation for a single StepStart/End pair that wraps
        // around all the subflows (and not let DSL.invokeMethod creates AtomNode)
        // see the corresponding hack in DSL.invokeMethod

        CpsStepContext cps = (CpsStepContext) getContext();
        CpsThread t = CpsThread.current();

        ResultHandler r = new ResultHandler(cps);

        for (Entry<String,Closure> e : parallelStep.closures.entrySet()) {
            BodyExecution body = cps.invokeBodyLater(
                    t.getGroup().export(e.getValue()),
                    Collections.singletonList(new ParallelLabelAction(e.getKey()))
            );
            body.addCallback(r.callbackFor(e.getKey()));
            bodies.add(body);
        }
View Full Code Here

TOP

Related Classes of org.jenkinsci.plugins.workflow.cps.CpsThread

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.