Changeset 804 for trunk/quest-core-tasktrees/src
- Timestamp:
- 09/10/12 16:57:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/temporalrelation/DefaultEventTargetSequenceDetectionRule.java
r798 r804 51 51 } 52 52 else { 53 handleEventTargetSequence(parent, startingIndex, index - 1, builder, 54 nodeFactory, result); 53 int endIndex = index - 1; 54 55 // only reduce to a sequence, if it is not a sequence with only one child 56 // or if this child is not a sequence itself 57 if ((startingIndex != endIndex) || 58 (!(parent.getChildren().get(startingIndex) instanceof ISequence))) 59 { 60 handleEventTargetSequence 61 (parent, startingIndex, endIndex, builder, nodeFactory, result); 55 62 56 return result; 63 result.setRuleApplicationStatus 64 (RuleApplicationStatus.RULE_APPLICATION_FINISHED); 65 return result; 66 } 67 else { 68 // here a new sequence on a new target begins 69 startingIndex = index; 70 currentEventTarget = eventTarget; 71 } 57 72 } 58 73 } … … 62 77 63 78 if (startingIndex > -1) { 64 if (finalize && (startingIndex > 0)) { 65 handleEventTargetSequence(parent, startingIndex, parent.getChildren().size() - 1, 66 builder, nodeFactory, result); 79 int endIndex = parent.getChildren().size() - 1; 80 81 if (finalize) { 82 // only reduce to a sequence, if it is not a sequence with only one child 83 // or if this child is not a sequence itself 84 if ((startingIndex > 0) && 85 ((startingIndex != endIndex) || 86 (!(parent.getChildren().get(startingIndex) instanceof ISequence)))) 87 { 88 handleEventTargetSequence 89 (parent, startingIndex, endIndex, builder, nodeFactory, result); 90 91 result.setRuleApplicationStatus(RuleApplicationStatus.RULE_APPLICATION_FINISHED); 92 } 67 93 } 68 94 else { … … 85 111 } 86 112 else { 87 return null; 113 IEventTarget commonTarget = null; 114 115 for (ITaskTreeNode child : node.getChildren()) { 116 if (commonTarget == null) { 117 commonTarget = determineEventTarget(child); 118 } 119 else { 120 if (!commonTarget.equals(determineEventTarget(child))) { 121 return null; 122 } 123 } 124 } 125 126 return commonTarget; 88 127 } 89 128 } … … 110 149 111 150 result.addNewlyCreatedParentNode(sequence); 112 result.setRuleApplicationStatus(RuleApplicationStatus.RULE_APPLICATION_FINISHED);113 151 } 114 152
Note: See TracChangeset
for help on using the changeset viewer.