View Javadoc
1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.server;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.junit.Ignore;
22  import org.kuali.rice.kew.engine.RouteContext;
23  import org.kuali.rice.kew.engine.RouteHelper;
24  import org.kuali.rice.kew.engine.node.SimpleSplitNode;
25  import org.kuali.rice.kew.engine.node.SplitResult;
26  
27  /**
28   * This is a description of what this class does - delyea don't forget to fill this in. 
29   * 
30   * @author Kuali Rice Team (rice.collab@kuali.org)
31   *
32   */
33  @Ignore
34  public class TestSplitNode extends SimpleSplitNode {
35  
36  	private static boolean leftBranch = true;
37  	private static boolean rightBranch = true;
38  	
39  	@Override
40  	public SplitResult process(RouteContext routeContext,
41  			RouteHelper routeHelper) throws Exception {
42  		return new SplitResult(getBranchNames());
43  	}
44  	
45  	public List<String> getBranchNames() {
46  		List<String> branchNames = new ArrayList<String>();
47  		if (isLeftBranch()) {
48  			branchNames.add("Left");
49  		}
50  		if (isRightBranch()) {
51  			branchNames.add("Right");
52  		}
53  		return branchNames;
54  	}
55  	public static void setLeftBranch(boolean leftBranch) {
56  		TestSplitNode.leftBranch = leftBranch;
57  	}
58  	public static boolean isLeftBranch() {
59  		return TestSplitNode.leftBranch;
60  	}
61  	public static void setRightBranch(boolean rightBranch) {
62  		TestSplitNode.rightBranch = rightBranch;
63  	}		
64  	public static boolean isRightBranch() {
65  		return TestSplitNode.rightBranch;
66  	}  	
67  }