Examples of FlowExecution


Examples of org.jenkinsci.plugins.workflow.flow.FlowExecution

        AccessControlled accessControlled() {
            try {
                if (!context.isReady()) {
                    return null;
                }
                FlowExecution exec = context.get(FlowExecution.class);
                if (exec == null) {
                    return null;
                }
                Queue.Executable executable = exec.getOwner().getExecutable();
                if (executable instanceof AccessControlled) {
                    return (AccessControlled) executable;
                } else {
                    return null;
                }
View Full Code Here

Examples of org.springframework.batch.core.job.flow.FlowExecution

        logger.debug("Handling state="+stateName);
        status = state.handle(executor);
        stepExecution = executor.getStepExecution();
      }
      catch (FlowExecutionException e) {
        executor.close(new FlowExecution(stateName, status));
        throw e;
      }
      catch (Exception e) {
        executor.close(new FlowExecution(stateName, status));
        throw new FlowExecutionException(String.format("Ended flow=%s at state=%s with exception", name,
                                    stateName), e);
      }

      logger.debug("Completed state="+stateName+" with status="+status);

      state = nextState(stateName, status, stepExecution);
    }

    FlowExecution result = new FlowExecution(stateName, status);
    executor.close(result);
    return result;

  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    @Override
    @SuppressWarnings("unchecked")
    public Object getReferenceInFlowScope(String flowExecutionKey, String referenceName, HttpServletRequest request) {
        ExternalContextHolder.setExternalContext(new ServletExternalContext(servletContext, request, null));
        FlowExecutionRepository executionRepository =  ((FlowExecutorImpl) flowExecutor).getExecutionRepository();
        FlowExecution flowExecution = executionRepository.getFlowExecution(executionRepository.parseFlowExecutionKey(flowExecutionKey));
        FlowSession flowSession = flowExecution.getActiveSession();
        return flowSession.getScope().get(referenceName);
    }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

        assertTrue(context.getFlashScope().get("rootCauseException") instanceof TestException);
      }
    };
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue("Should have ended", !execution.isActive());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

  public void testStateExceptionHandlingTransitionNoSuchState() {
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have failed no such state");
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    } catch (IllegalArgumentException e) {
    }
  }

  public void testStateExceptionHandlingRethrow() {
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have rethrown");
    } catch (FlowExecutionException e) {
      // expected
    }
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

      public Flow createFlow() throws FlowBuilderException {
        return Flow.create(getContext().getFlowId(), getContext().getFlowAttributes());
      }
    };
    Flow flow = new FlowAssembler(builder, new MockFlowBuilderContext("flow")).assembleFlow();
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue(execution.isActive());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    flowDefinition = new Flow("flow");
    new EndState(flowDefinition, "end");
  }

  public void testCreate() {
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertSame(flowDefinition, execution.getDefinition());
    assertFalse(execution.hasStarted());
    assertFalse(execution.isActive());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

  public void testCreateWithExecutionAttributes() {
    MutableAttributeMap attributes = new LocalAttributeMap();
    attributes.put("foo", "bar");
    factory.setExecutionAttributes(attributes);
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertEquals(attributes, execution.getAttributes());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

      public void sessionStarting(RequestContext context, FlowSession session, MutableAttributeMap input) {
        starting = true;
      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertFalse(execution.isActive());
    execution.start(null, new MockExternalContext());
    assertTrue(starting);
  }
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.