Examples of Workflow


Examples of com.opensymphony.workflow.Workflow

   * Executes the supplied <code>OsWorkflowCallback</code> against the current workflow instance as the caller bound
   * to the current <code>OsWorkflowContext</code>.
   */
  public Object execute(OsWorkflowCallback callback) {
    try {
      Workflow workflow = createWorkflow(OsWorkflowContextHolder.getWorkflowContext().getCaller());
      workflow.setConfiguration(this.configuration);
      return callback.doWithWorkflow(workflow);
    }
    catch (WorkflowException ex) {
      // TODO: proper exception translation
      throw new org.springmodules.workflow.WorkflowException("", ex);
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    }
  }

  public void testExecute() throws Exception {
    MockControl ctl = createMockWorkflowControl();
    final Workflow workflow = (Workflow) ctl.getMock();
    final Object returnObject = new Object();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        assertEquals("Incorrect caller", CALLER, caller);
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final Object value = new Object();
    final MockControl ctl = createMockWorkflowControl();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();

        Map inputs = new HashMap();
        inputs.put(key, value);

        // record expected calls
        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        ctl.setVoidCallable();
        workflow.doAction(MOCK_INSTANCE_ID, 1, inputs);
        ctl.setVoidCallable();
        ctl.replay();

        return workflow;
      }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final MockControl ctl = createMockWorkflowControl();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();
        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        workflow.getWorkflowDescriptor(WAKE_UP);
        ctl.setReturnValue(null);
        ctl.replay();

        return workflow;
      }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final MockControl ctl = createMockWorkflowControl();
    final List mockSteps = new ArrayList();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();
        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        workflow.getHistorySteps(MOCK_INSTANCE_ID);
        ctl.setReturnValue(mockSteps);
        ctl.replay();

        return workflow;
      }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final MockControl ctl = createMockWorkflowControl();
    final List mockSteps = new ArrayList();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();
        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        workflow.getCurrentSteps(MOCK_INSTANCE_ID);
        ctl.setReturnValue(mockSteps);
        ctl.replay();

        return workflow;
      }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final MockControl ctl = createMockWorkflowControl();
    final int mockEntryState = 98;

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();

        // expect setConfiguration
        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        workflow.getEntryState(MOCK_INSTANCE_ID);
        ctl.setReturnValue(mockEntryState);

        ctl.replay();
        return workflow;
      }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final MockControl ctl = createMockWorkflowControl();
    final PropertySet ps = new MapPropertySet();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();

        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        ctl.setVoidCallable();
        workflow.getPropertySet(MOCK_INSTANCE_ID);
        ctl.setReturnValue(ps);
        ctl.replay();

        return workflow;
      }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final int newState = 2;
    final MockControl ctl = createMockWorkflowControl();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();

        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        ctl.setVoidCallable();
        workflow.canModifyEntryState(MOCK_INSTANCE_ID, newState);
        ctl.setReturnValue(true);
        ctl.replay();

        return workflow;
      }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

    final int newState = 2;
    final MockControl ctl = createMockWorkflowControl();

    OsWorkflowTemplate template = new OsWorkflowTemplate() {
      protected Workflow createWorkflow(String caller) throws WorkflowException {
        Workflow workflow = (Workflow) ctl.getMock();

        workflow.setConfiguration(OsWorkflowTemplateTests.this.configuration);
        ctl.setVoidCallable();
        workflow.changeEntryState(MOCK_INSTANCE_ID, newState);
        ctl.setVoidCallable();
        ctl.replay();

        return workflow;
      }
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.