new ArrayList<TCGConjunction>();
ArrayList<TCGConjunction> colConjunctionsToTheEnd =
new ArrayList<TCGConjunction>();
// conjunction list is empty -> add a default conjunction to allow to add conditions
TCGConjunction oTemporalConjunction = null;
if(oDNF.getConjunctions().isEmpty()) {
oTemporalConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
oDNF.getConjunctions().add(oTemporalConjunction);
}
// check all conjunctions if they determine exactly one target state
for(TCGConjunction oConjunction : oDNF.getConjunctions()) {
// List<TCGTransition> colTransitions =
// TCGTransitionHelperClass.findResultingTransitions(
// oNode, oEvent, oConjunction);
// abc: �berpr�fen, ob es mehrere m�gliche Kandidaten f�r die resultierende Transition gibt
// Gibt es daf�r nicht schon ein Beispiel? Siehe FreightElevator!
// if(colTransitions.size() != 1) { // TODO : AAA: ok?
// no unique match found - get non-contradicting guards
List<TCGConjunction> colNonContradictingTransitionGuards =
TCGTransitionHelperClass.findNonContradictingTransitionGuards(
oNode, oEvent, oConjunction);
// is empty? -> do nothing -> all outgoing transitions are contradicting
// is not empty: create alternative conjunctions and add them before
// the original, ambiguous conjunction
if(!colNonContradictingTransitionGuards.isEmpty()) {
colConjunctionsToTheEnd.add(oConjunction);
for(TCGConjunction oNonConConjunction : colNonContradictingTransitionGuards) {
boolean bAddNewConjunctionToFront = false;
TCGConjunction oNewConjunction =
TCGConjunctionHelperClass.copyConjunctionDeep(oNonConConjunction);
// old expression values should be added to new conjunction?
// -> check if the old expression contains values that are not in the new conjunction
for(TCGOCLExpression oExp : oConjunction.getExpressions()) {
// add new expression only if it is not already contained
// or references the same original OCL expression
// or can be transformed into each other
if(!ObjectComparator.contains(oNonConConjunction.getExpressions(), oExp) &&
!TCGOCLExpressionHelperClass.containsElementWithSameOCLReference(
oNonConConjunction.getExpressions(), oExp) &&
!TCGOCLExpressionHelperClass.containsTransformableExpression(
oNonConConjunction.getExpressions(), oExp)) {
oNewConjunction.getExpressions().add(
TCGOCLExpressionHelperClass.copyExpression(oExp));
}
}
// new conjunction should be added to conjunctionsToTheFront?