Changeset 2132 for trunk/autoquest-ui-core/src/main/java
- Timestamp:
- 08/24/16 10:17:41 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-ui-core/src/main/java/de/ugoe/cs/autoquest/commands/usability/CMDgenerateTaskTree.java
r1844 r2132 45 45 @Override 46 46 public String help() { 47 return "generateTaskTree <sequences> {<tasktree>}"; 47 return "generateTaskTree <sequences> {<tasktree>} {-considerEventEquality} " + 48 "{-minimumSequenceCoverage=<some integer>}"; 48 49 } 49 50 … … 56 57 @Override 57 58 public void run(List<Object> parameters) { 58 String sequencesName; 59 String tasktreeName; 59 String sequencesName = null; 60 String tasktreeName = null; 61 boolean useEventEqualityForTaskComparison = false; 62 int minimumSequenceCoverage = 0; 63 60 64 try { 61 sequencesName = (String) parameters.get(0); 62 if (parameters.size() > 1) { 63 tasktreeName = (String) parameters.get(1); 64 } 65 else { 66 tasktreeName = "tasktree"; 65 for (int i = 0; i < parameters.size(); i++) { 66 String parameter = (String) parameters.get(i); 67 if (!parameter.startsWith("-")) { 68 if (sequencesName == null) { 69 sequencesName = parameter; 70 } 71 else if (tasktreeName == null) { 72 tasktreeName = parameter; 73 } 74 else { 75 throw new IllegalArgumentException("unrecognized parameter: " + parameter); 76 } 77 } 78 else { 79 if ("-considerEventEquality".equals(parameter)) { 80 useEventEqualityForTaskComparison = true; 81 } 82 else if (parameter.startsWith("-minimumSequenceCoverage=")) { 83 try { 84 minimumSequenceCoverage = Integer.parseInt 85 (parameter.substring("-minimumSequenceCoverage=".length())); 86 } 87 catch (Exception e) { 88 throw new IllegalArgumentException 89 ("invalid value for parameter minimumSequenceCoverage: " + 90 parameter.substring("-minimumSequenceCoverage=".length())); 91 } 92 } 93 else { 94 throw new IllegalArgumentException("unrecognized parameter: " + parameter); 95 } 96 } 67 97 } 68 98 } 99 catch (IllegalArgumentException e) { 100 throw e; 101 } 69 102 catch (Exception e) { 103 throw new IllegalArgumentException("could not process parameters", e); 104 } 105 106 if (sequencesName == null) { 70 107 throw new IllegalArgumentException("must provide a sequences name"); 108 } 109 110 if (tasktreeName == null) { 111 tasktreeName = "tasktree"; 71 112 } 72 113 … … 84 125 sequences = (Collection<List<Event>>) dataObject; 85 126 86 ITaskModel taskModel = new TaskTreeManager().createTaskModel(sequences); 127 ITaskModel taskModel = new TaskTreeManager().createTaskModel 128 (sequences, useEventEqualityForTaskComparison, minimumSequenceCoverage); 87 129 88 130 if (GlobalDataContainer.getInstance().addData(tasktreeName, taskModel)) {
Note: See TracChangeset
for help on using the changeset viewer.