Bugfix: Rule Scheduler should filter rules based on non-negative IDs

This commit is contained in:
NilsWeidmann 2023-03-13 18:03:59 +01:00
parent 08fee98e09
commit f7ae57ceff
2 changed files with 3 additions and 2 deletions

View file

@ -7,7 +7,7 @@ import org.emoflon.neo.cypher.models.*;
public class API_Common {
// Default values (might have to be changed)
public static final String PLATFORM_PLUGIN_URI = "/C:/Program Files/Eclipse/eclipse-for-java-and-dsl-developers/plugins/";
public static final String NEOCORE_URI_INSTALLED = "/C:/Program Files/Eclipse/eclipse-for-java-and-dsl-developers/plugins/org.emoflon.neo.neocore_1.0.0.202210011604/";
public static final String NEOCORE_URI_INSTALLED = "/C:/Program Files/Eclipse/eclipse-for-java-and-dsl-developers/plugins/org.emoflon.neo.neocore_1.0.0.202211241827/";
public static final String PLATFORM_RESOURCE_URI = "../";
public static NeoCoreBuilder createBuilder() {

View file

@ -175,6 +175,7 @@ public class ModelIntegrationOperationalStrategy extends ILPBasedOperationalStra
var filteredRulesToMatches = new HashMap<IRule<NeoMatch, NeoCoMatch>, Collection<NeoMatch>>();
var allRulesToMatches = super.selectMatches(matchContainer, progressMonitor);
determineCreateDeltaElements();
Collection<Long> createDeltaElementsWithPositiveIds = createDeltaElements.stream().map(e -> Math.abs(e)).toList();
for (IRule<NeoMatch,NeoCoMatch> r : allRulesToMatches.keySet()) {
// No CO rule
@ -183,7 +184,7 @@ public class ModelIntegrationOperationalStrategy extends ILPBasedOperationalStra
else {
filteredRulesToMatches.put(r, new HashSet<NeoMatch>());
for (NeoMatch m : allRulesToMatches.get(r))
if (m.getElements().stream().filter(e -> createDeltaElements.contains(e)).findAny().isPresent())
if (m.getElements().stream().filter(e -> createDeltaElementsWithPositiveIds.contains(e)).findAny().isPresent())
filteredRulesToMatches.get(r).add(m);
}
}