Package com.agiletec.plugins.jpcontentworkflow.aps.system.services.workflow.model

Examples of com.agiletec.plugins.jpcontentworkflow.aps.system.services.workflow.model.Step


    List<Step> steps = action.getSteps();
    assertEquals(4, steps.size());
    assertEquals("step1", steps.get(0).getCode());
    assertEquals("step2", steps.get(1).getCode());
    assertEquals("step3", steps.get(2).getCode());
    Step step = steps.get(3);
    assertEquals("step4", step.getCode());
    assertEquals("step4", step.getCode());
    assertEquals("Step 4", step.getDescr());
    assertEquals("supervisor", step.getRole());
  }
View Full Code Here


    Workflow workflow = this._workflowManager.getWorkflow("ART");
    assertEquals("ART", workflow.getTypeCode());
    assertNull(workflow.getRole());
    List<Step> steps = workflow.getSteps();
    assertEquals(3, steps.size());
    Step step1 = workflow.getStep("step1");
    assertEquals("step1", step1.getCode());
    assertEquals("Step 1", step1.getDescr());
    assertEquals("pageManager", step1.getRole());
   
    Step step2 = workflow.getStep("step2");
    assertEquals("step2", step2.getCode());
    assertEquals("Step 2", step2.getDescr());
    assertNull(step2.getRole());
   
    Step step3 = workflow.getStep("step3");
    assertEquals("step3", step3.getCode());
    assertEquals("Step 3", step3.getDescr());
    assertEquals("supervisor", step3.getRole());
   
    Workflow workflow2 = this._workflowManager.getWorkflow("EVN");
    assertEquals("pageManager", workflow2.getRole());
    assertEquals(0, workflow2.getSteps().size());
   
View Full Code Here

 
  protected void addSteps(List<Step> steps) {
    if (steps!=null) {
      Iterator<Step> stepsIter = steps.iterator();
      while (stepsIter.hasNext()) {
        Step step = stepsIter.next();
        String code = step.getCode();
        if (step.getDescr()!=null) {
          this.addParameter(code+"_SEP_descr", step.getDescr());
        }
        if (step.getRole()!=null) {
          this.addParameter(code+"_SEP_role", step.getRole());
        }
      }
      String codes = this.concatCodes(steps);
      this.addParameter("stepCodes", codes);
    }
View Full Code Here

  protected String concatCodes(List<Step> steps) {
    String codes = "";
    if (steps!=null) {
      Iterator<Step> stepsIter = steps.iterator();
      while (stepsIter.hasNext()) {
        Step step = stepsIter.next();
        codes += step.getCode();
        if (stepsIter.hasNext()) {
          codes += ",";
        }
      }
    }
View Full Code Here

  }
 
  private List<Step> createSteps() {
    List<Step> steps = new ArrayList<Step>();
   
    Step step1 = new Step();
    step1.setCode("step_1");
    step1.setDescr("step_1 descr");
    step1.setRole("role1");
    steps.add(step1);
   
    Step step2 = new Step();
    step2.setCode("step_2");
    step2.setDescr("step_2 descr");
    step2.setRole("role2");
    steps.add(step2);
   
    return steps;
  }
View Full Code Here

  }
 
  protected List<Step> prepareSteps(int size) {
    List<Step> steps = new ArrayList<Step>(size);
    for (int i=0; i<size; i++) {
      Step step = new Step();
      step.setCode("step" + i);
      step.setDescr("Step " + i);
      step.setRole("supervisor");
      steps.add(step);
    }
    return steps;
  }
View Full Code Here

  protected void compareSteps(List<Step> steps1, List<Step> steps2) {
    assertEquals(steps1.size(), steps2.size());
    Iterator<Step> steps1Iter = steps1.iterator();
    Iterator<Step> steps2Iter = steps2.iterator();
    while (steps1Iter.hasNext()) {
      Step step1 = steps1Iter.next();
      Step step2 = steps2Iter.next();
      assertEquals(step1.getCode(), step2.getCode());
      assertEquals(step1.getDescr(), step2.getDescr());
      assertEquals(step1.getRole(), step2.getRole());
    }
  }
View Full Code Here

        String status = content.getStatus();
        if (!Content.STATUS_NEW.equals(status) && !Content.STATUS_DRAFT.equals(status)) {
          if (Content.STATUS_READY.equals(status) || Content.STATUS_PUBLIC.equals(status)) {
            isAllowed = this.getAuthorizationManager().isAuthOnPermission(user, Permission.SUPERVISOR);
          } else {
            Step step = workflow.getStep(status);
            if (step != null) {
              isAllowed = this.getAuthorizationManager().isAuthOnRole(user, step.getRole());
            }
          }
        } else {
          isAllowed = true;
        }
View Full Code Here

      workflow.setRole(role.trim());
    }
    Iterator<Element> stepIter = contentTypeElem.getChildren(STEP_CHILD).iterator();
    while (stepIter.hasNext()) {
      Element stepElem = stepIter.next();
      Step step = this.extractStep(stepElem);
      workflow.addStep(step);
    }
    return workflow;
  }
View Full Code Here

    }
    return workflow;
  }
 
  protected Step extractStep(Element stepElem) {
    Step step = new Step();
    String code = stepElem.getAttributeValue(STEP_CODE_ATTR);
    step.setCode(code);
    String descr = stepElem.getAttributeValue(STEP_DESCR_ATTR);
    step.setDescr(descr);
    String role = stepElem.getAttributeValue(STEP_ROLE_ATTR);
    step.setRole(role);
    return step;
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpcontentworkflow.aps.system.services.workflow.model.Step

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.