| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package edu.sampleu.travel.workflow; |
| 17 |
|
|
| 18 |
|
import java.util.ArrayList; |
| 19 |
|
import java.util.HashMap; |
| 20 |
|
import java.util.List; |
| 21 |
|
import java.util.Map; |
| 22 |
|
|
| 23 |
|
import org.kuali.rice.kns.web.ui.Field; |
| 24 |
|
import org.kuali.rice.kns.web.ui.Row; |
| 25 |
|
import org.kuali.rice.kew.rule.GenericWorkflowAttribute; |
| 26 |
|
import org.kuali.rice.kew.rule.WorkflowAttributeValidationError; |
| 27 |
|
|
| 28 |
|
|
|
|
|
| 0% |
Uncovered Elements: 34 (34) |
Complexity: 12 |
Complexity Density: 0.55 |
|
| 29 |
|
public class DestinationRuleAttribute extends GenericWorkflowAttribute { |
| 30 |
|
|
| 31 |
|
private static final String DEST_LABEL = "Destination"; |
| 32 |
|
private static final String DEST_FIELD_KEY = "destination"; |
| 33 |
|
|
| 34 |
|
private final List<Row> rows = new ArrayList<Row>(); |
| 35 |
|
|
| 36 |
|
private String destination; |
| 37 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
0
|
public DestinationRuleAttribute() {... |
| 39 |
0
|
super("destination"); |
| 40 |
|
} |
| 41 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 42 |
0
|
public DestinationRuleAttribute(String destination) {... |
| 43 |
0
|
super("destination"); |
| 44 |
0
|
this.destination = destination; |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 79 |
0
|
public List<Row> getRuleRows() {... |
| 80 |
0
|
return getRows(); |
| 81 |
|
} |
| 82 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 83 |
0
|
public List<Row> getRoutingDataRows() {... |
| 84 |
0
|
return getRows(); |
| 85 |
|
} |
| 86 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
| 87 |
0
|
private List<Row> getRows() {... |
| 88 |
0
|
log.info("Returning rows: " + rows); |
| 89 |
0
|
List<Field> fields = new ArrayList<Field>(); |
| 90 |
0
|
fields.add(new Field(DEST_LABEL, "", Field.TEXT, false, DEST_FIELD_KEY, "", false, false, null, null)); |
| 91 |
0
|
List<Row> rows = new ArrayList<Row>(); |
| 92 |
0
|
rows.add(new Row(fields)); |
| 93 |
0
|
return rows; |
| 94 |
|
} |
| 95 |
|
|
| 96 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 97 |
0
|
public void setDestination(String destination) {... |
| 98 |
0
|
this.destination = destination; |
| 99 |
|
} |
| 100 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 101 |
0
|
public Map<String, String> getProperties() {... |
| 102 |
0
|
Map<String, String> props = new HashMap<String, String>(); |
| 103 |
0
|
props.put("destination", destination); |
| 104 |
0
|
return props; |
| 105 |
|
} |
| 106 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 107 |
0
|
public List validateRoutingData(Map paramMap) {... |
| 108 |
0
|
return validateInputMap(paramMap); |
| 109 |
|
} |
| 110 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 111 |
0
|
public List validateRuleData(Map paramMap) {... |
| 112 |
0
|
return validateInputMap(paramMap); |
| 113 |
|
} |
| 114 |
|
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 115 |
0
|
private List validateInputMap(Map paramMap) {... |
| 116 |
0
|
List errors = new ArrayList(); |
| 117 |
0
|
this.destination = (String) paramMap.get(DEST_FIELD_KEY); |
| 118 |
0
|
if (this.destination == null && required) { |
| 119 |
0
|
errors.add(new WorkflowAttributeValidationError(DEST_FIELD_KEY, "Destination is required.")); |
| 120 |
|
} |
| 121 |
0
|
return errors; |
| 122 |
|
} |
| 123 |
|
} |