Examples of StepDescriptor


Examples of com.opensymphony.workflow.loader.StepDescriptor

    stepVO.setOwner(step.getOwner());
    stepVO.setCaller(step.getCaller());
   
    try
    {
      StepDescriptor stepDescriptor = workflowDescriptor.getStep(step.getStepId());
      if(stepDescriptor != null)
      {
        stepVO.setName(stepDescriptor.getName());
        for (Iterator i = stepDescriptor.getActions().iterator(); i.hasNext();)
          stepVO.addAction(createActionVO((ActionDescriptor)i.next()));
      }
      else
      {
        throw new SystemException("No stepDescriptor found for " + step);
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepDescriptor

            functions = new TreeMap<String,StepDescriptor>();
            for (StepDescriptor d : StepDescriptor.all()) {
                functions.put(d.getFunctionName(), d);
            }
        }
        final StepDescriptor d = functions.get(name);
        if (d == null) {
            throw new NoSuchMethodError("No such DSL method " + name + " found among " + functions.keySet());
        }

        final NamedArgsAndClosure ps = parseArgs(d,args);

        CpsThread thread = CpsThread.current();

        FlowNode an;

        // TODO: generalize the notion of Step taking over the FlowNode creation.
        // see https://trello.com/c/v6Pbwqxj/13-allowing-steps-to-build-flownodes
        boolean hack = d instanceof ParallelStep.DescriptorImpl;

        if (ps.body == null && !hack) {
            an = new StepAtomNode(exec, d, thread.head.get());
            // TODO: use CPS call stack to obtain the current call site source location. See JENKINS-23013
            thread.head.setNewHead(an);
        } else {
            an = new StepStartNode(exec, d, thread.head.get());
            thread.head.setNewHead(an);
        }

        final CpsStepContext context = new CpsStepContext(d,thread,handle,an,ps.body);
        Step s;
        boolean sync;
        try {
            d.checkContextAvailability(context);
            s = d.newInstance(ps.namedArgs);
            StepExecution e = s.start(context);
            thread.setStep(e);
            sync = e.start();
        } catch (Exception e) {
            if (e instanceof MissingContextVariableException)
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepDescriptor

            stepDescriptor = (StepDescriptor) j.getDescriptor(stepDescriptorId);
        return stepDescriptor;
    }

    public String getDisplayName() {
        StepDescriptor d = getStepDescriptor();
        return d!=null ? d.getDisplayName() : stepDescriptorId;
    }
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepDescriptor

        return descriptor;
    }

    @Override
    protected String getTypeDisplayName() {
        StepDescriptor d = getDescriptor();
        return d!=null ? d.getDisplayName() : descriptorId;
    }
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepDescriptor

    public boolean isBody() {
        return getAction(BodyInvocationAction.class)!=null;
    }

    public String getStepName() {
        StepDescriptor d = getDescriptor();
        return d!=null ? d.getDisplayName() : descriptorId;
    }
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepDescriptor

    }

    private static void assertRoundTrip(Step step, String expected) throws Exception {
        assertEquals(expected, Snippetizer.object2Groovy(step));
        GroovyShell shell = new GroovyShell(r.jenkins.getPluginManager().uberClassLoader);
        final StepDescriptor desc = step.getDescriptor();
        shell.setVariable("steps", new GroovyObjectSupport() {
            @Override public Object invokeMethod(String name, Object args) {
                if (name.equals(desc.getFunctionName())) {
                    try {
                        return desc.newInstance(DSL.parseArgs(desc, args).namedArgs);
                    } catch (RuntimeException x) {
                        throw x;
                    } catch (Exception x) {
                        throw new RuntimeException(x);
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.