|
@@ 1144-1187 (lines=44) @@
|
| 1141 |
|
* @param bounds |
| 1142 |
|
* @throws Exception |
| 1143 |
|
*/ |
| 1144 |
|
protected void prepareDuringTemporalConstraint(ExecutionNode reference, ExecutionNode target, long[][] bounds) |
| 1145 |
|
throws Exception { |
| 1146 |
|
|
| 1147 |
|
// create constraint |
| 1148 |
|
DuringIntervalConstraint constraint = this.facade. |
| 1149 |
|
createTemporalConstraint(TemporalConstraintType.DURING); |
| 1150 |
|
// set references |
| 1151 |
|
constraint.setReference(reference.getInterval()); |
| 1152 |
|
constraint.setTarget(target.getInterval()); |
| 1153 |
|
|
| 1154 |
|
// set bounds |
| 1155 |
|
constraint.setStartTimeBound(bounds[0]); |
| 1156 |
|
constraint.setEndTimeBound(bounds[1]); |
| 1157 |
|
// propagate temporal constraint |
| 1158 |
|
this.facade.propagate(constraint); |
| 1159 |
|
|
| 1160 |
|
|
| 1161 |
|
// add execution dependencies |
| 1162 |
|
this.addStartExecutionDependency(reference, target, new ExecutionNodeStatus[] { |
| 1163 |
|
ExecutionNodeStatus.IN_EXECUTION |
| 1164 |
|
}); |
| 1165 |
|
|
| 1166 |
|
this.addEndExecutionDependency(reference, target, new ExecutionNodeStatus[] { |
| 1167 |
|
ExecutionNodeStatus.IN_EXECUTION, |
| 1168 |
|
}); |
| 1169 |
|
|
| 1170 |
|
this.addEndExecutionDependency(target, reference, new ExecutionNodeStatus[] { |
| 1171 |
|
ExecutionNodeStatus.EXECUTED, |
| 1172 |
|
}); |
| 1173 |
|
|
| 1174 |
|
|
| 1175 |
|
|
| 1176 |
|
|
| 1177 |
|
// add stop execution condition |
| 1178 |
|
this.addStopExecutionDependency(reference, target, new ExecutionNodeStatus[] { |
| 1179 |
|
ExecutionNodeStatus.IN_EXECUTION, |
| 1180 |
|
ExecutionNodeStatus.FAILURE, |
| 1181 |
|
}); |
| 1182 |
|
|
| 1183 |
|
// add stop execution condition |
| 1184 |
|
this.addStopExecutionDependency(target, reference, new ExecutionNodeStatus[] { |
| 1185 |
|
ExecutionNodeStatus.EXECUTED, |
| 1186 |
|
ExecutionNodeStatus.FAILURE, |
| 1187 |
|
ExecutionNodeStatus.WAITING |
| 1188 |
|
}); |
| 1189 |
|
} |
| 1190 |
|
|
|
@@ 1198-1238 (lines=41) @@
|
| 1195 |
|
* @param bounds |
| 1196 |
|
* @throws Exception |
| 1197 |
|
*/ |
| 1198 |
|
protected void prepareContainsTemporalConstraint(ExecutionNode reference, ExecutionNode target, long[][] bounds) |
| 1199 |
|
throws Exception { |
| 1200 |
|
|
| 1201 |
|
// create constraint |
| 1202 |
|
ContainsIntervalConstraint constraint = this.facade. |
| 1203 |
|
createTemporalConstraint(TemporalConstraintType.CONTAINS); |
| 1204 |
|
// set references |
| 1205 |
|
constraint.setReference(reference.getInterval()); |
| 1206 |
|
constraint.setTarget(target.getInterval()); |
| 1207 |
|
|
| 1208 |
|
// set bounds |
| 1209 |
|
constraint.setStartTimeBound(bounds[0]); |
| 1210 |
|
constraint.setEndTimeBound(bounds[1]); |
| 1211 |
|
// propagate temporal constraint |
| 1212 |
|
this.facade.propagate(constraint); |
| 1213 |
|
|
| 1214 |
|
// add execution dependencies |
| 1215 |
|
this.addEndExecutionDependency(reference, target, new ExecutionNodeStatus[] { |
| 1216 |
|
ExecutionNodeStatus.EXECUTED, |
| 1217 |
|
}); |
| 1218 |
|
|
| 1219 |
|
this.addStartExecutionDependency(target, reference, new ExecutionNodeStatus[] { |
| 1220 |
|
ExecutionNodeStatus.IN_EXECUTION |
| 1221 |
|
}); |
| 1222 |
|
|
| 1223 |
|
this.addEndExecutionDependency(target, reference, new ExecutionNodeStatus[] { |
| 1224 |
|
ExecutionNodeStatus.IN_EXECUTION, |
| 1225 |
|
}); |
| 1226 |
|
|
| 1227 |
|
|
| 1228 |
|
// add stop execution condition |
| 1229 |
|
this.addStopExecutionDependency(reference, target, new ExecutionNodeStatus[] { |
| 1230 |
|
ExecutionNodeStatus.EXECUTED, |
| 1231 |
|
ExecutionNodeStatus.FAILURE, |
| 1232 |
|
ExecutionNodeStatus.WAITING |
| 1233 |
|
}); |
| 1234 |
|
|
| 1235 |
|
// add stop execution condition |
| 1236 |
|
this.addStopExecutionDependency(target, reference, new ExecutionNodeStatus[] { |
| 1237 |
|
ExecutionNodeStatus.IN_EXECUTION, |
| 1238 |
|
ExecutionNodeStatus.FAILURE, |
| 1239 |
|
|
| 1240 |
|
}); |
| 1241 |
|
} |