1 5 package com.opensymphony.workflow; 6 7 import com.opensymphony.workflow.spi.Step; 8 9 import java.util.*; 10 11 12 18 public class JoinNodes { 19 21 private Collection steps; 22 private DummyStep dummy = new DummyStep(); 23 24 26 public JoinNodes(Collection steps) { 27 this.steps = steps; 28 } 29 30 32 public Step getStep(int stepId) { 33 for (Iterator iterator = steps.iterator(); iterator.hasNext();) { 34 Step step = (Step) iterator.next(); 35 36 if (step.getStepId() == stepId) { 37 return step; 38 } 39 } 40 41 return dummy; 44 } 45 46 48 public class DummyStep implements Step { 49 public int getActionId() { 50 return -1; 51 } 52 53 public String getCaller() { 54 return null; 55 } 56 57 public Date getDueDate() { 58 return null; 59 } 60 61 public long getEntryId() { 62 return -1; 63 } 64 65 public Date getFinishDate() { 66 return null; 67 } 68 69 public long getId() { 70 return -1; 71 } 72 73 public String getOwner() { 74 return null; 75 } 76 77 public long[] getPreviousStepIds() { 78 return new long[0]; 79 } 80 81 public Date getStartDate() { 82 return null; 83 } 84 85 public String getStatus() { 86 return null; 87 } 88 89 public int getStepId() { 90 return -1; 91 } 92 } 93 } 94 | Popular Tags |