Added query generation to the BPMN example
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/pom.xml b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/pom.xml
index 81e9244..3f94afa 100644
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/pom.xml
+++ b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/pom.xml
@@ -1,13 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.eclipse.viatra.examples.dse.bpmn</groupId>
- <artifactId>bpmn</artifactId>
- <version>0.20.0-SNAPSHOT</version>
- </parent>
- <groupId>org.eclipse.viatra.examples.dse.bpmn</groupId>
- <artifactId>org.eclipse.viatra.dse.examples.bpmn.patterns</artifactId>
- <packaging>eclipse-plugin</packaging>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.viatra.examples.dse.bpmn</groupId>
+ <artifactId>bpmn</artifactId>
+ <version>0.20.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.eclipse.viatra.examples.dse.bpmn</groupId>
+ <artifactId>org.eclipse.viatra.dse.examples.bpmn.patterns</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <!-- Using maven-clean-plugin to remove previously generated code -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <execution>
+ <phase>clean</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <configuration>
+ <filesets>
+ <fileset>
+ <!-- Generated code folder -->
+ <directory>src-gen</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>.gitignore</excludes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Setting up generator -->
+ <plugin>
+ <groupId>org.eclipse.viatra</groupId>
+ <artifactId>viatra-maven-plugin</artifactId>
+ <version>${viatra.compiler.version}</version>
+ <!-- Binding execution to the code generation lifecycle phase -->
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputDirectory>src-gen</outputDirectory>
+ <metamodels>
+ <metamodel>
+ <packageClass>org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedbpmnPackage</packageClass>
+ </metamodel>
+ </metamodels>
+ <useProjectDependencies>true</useProjectDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/.gitignore b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/.gitignore
new file mode 100644
index 0000000..1a5126b
--- /dev/null
+++ b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/.gitignore
@@ -0,0 +1,5 @@
+#This file is needed to prevent git from omitting this folder that would cause build issues/compile errors.
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore
\ No newline at end of file
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/.gitignore b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/.gitignore
deleted file mode 100644
index 4a5335e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*._trace
\ No newline at end of file
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AbsenceOfResourceInstancesMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AbsenceOfResourceInstancesMatch.java
deleted file mode 100644
index 6a02f8e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AbsenceOfResourceInstancesMatch.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.AbsenceOfResourceInstancesQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.absenceOfResourceInstances pattern,
- * to be used in conjunction with {@link AbsenceOfResourceInstancesMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see AbsenceOfResourceInstancesMatcher
- * @see AbsenceOfResourceInstancesProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class AbsenceOfResourceInstancesMatch extends BasePatternMatch {
- private ResourceTypeVariant fRTV;
-
- private static List<String> parameterNames = makeImmutableList("RTV");
-
- private AbsenceOfResourceInstancesMatch(final ResourceTypeVariant pRTV) {
- this.fRTV = pRTV;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("RTV".equals(parameterName)) return this.fRTV;
- return null;
- }
-
- public ResourceTypeVariant getRTV() {
- return this.fRTV;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("RTV".equals(parameterName) ) {
- this.fRTV = (ResourceTypeVariant) newValue;
- return true;
- }
- return false;
- }
-
- public void setRTV(final ResourceTypeVariant pRTV) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRTV = pRTV;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.absenceOfResourceInstances";
- }
-
- @Override
- public List<String> parameterNames() {
- return AbsenceOfResourceInstancesMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fRTV};
- }
-
- @Override
- public AbsenceOfResourceInstancesMatch toImmutable() {
- return isMutable() ? newMatch(fRTV) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"RTV\"=" + prettyPrintValue(fRTV)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fRTV == null) ? 0 : fRTV.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof AbsenceOfResourceInstancesMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- AbsenceOfResourceInstancesMatch other = (AbsenceOfResourceInstancesMatch) obj;
- if (fRTV == null) {if (other.fRTV != null) return false;}
- else if (!fRTV.equals(other.fRTV)) return false;
- return true;
- }
-
- @Override
- public AbsenceOfResourceInstancesQuerySpecification specification() {
- try {
- return AbsenceOfResourceInstancesQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static AbsenceOfResourceInstancesMatch newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static AbsenceOfResourceInstancesMatch newMutableMatch(final ResourceTypeVariant pRTV) {
- return new Mutable(pRTV);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static AbsenceOfResourceInstancesMatch newMatch(final ResourceTypeVariant pRTV) {
- return new Immutable(pRTV);
- }
-
- private static final class Mutable extends AbsenceOfResourceInstancesMatch {
- Mutable(final ResourceTypeVariant pRTV) {
- super(pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends AbsenceOfResourceInstancesMatch {
- Immutable(final ResourceTypeVariant pRTV) {
- super(pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AbsenceOfResourceInstancesMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AbsenceOfResourceInstancesMatcher.java
deleted file mode 100644
index 1ee2c49..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AbsenceOfResourceInstancesMatcher.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AbsenceOfResourceInstancesMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.AbsenceOfResourceInstancesQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.absenceOfResourceInstances pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link AbsenceOfResourceInstancesMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern absenceOfResourceInstances(RTV : ResourceTypeVariant) {
- * neg find instanceOfVariant(_, RTV);
- * Task.variant(_, RTV);
- * }
- * </pre></code>
- *
- * @see AbsenceOfResourceInstancesMatch
- * @see AbsenceOfResourceInstancesProcessor
- * @see AbsenceOfResourceInstancesQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class AbsenceOfResourceInstancesMatcher extends BaseMatcher<AbsenceOfResourceInstancesMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static AbsenceOfResourceInstancesMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- AbsenceOfResourceInstancesMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (AbsenceOfResourceInstancesMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static AbsenceOfResourceInstancesMatcher create() throws ViatraQueryException {
- return new AbsenceOfResourceInstancesMatcher();
- }
-
- private final static int POSITION_RTV = 0;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AbsenceOfResourceInstancesMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private AbsenceOfResourceInstancesMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return matches represented as a AbsenceOfResourceInstancesMatch object.
- *
- */
- public Collection<AbsenceOfResourceInstancesMatch> getAllMatches(final ResourceTypeVariant pRTV) {
- return rawGetAllMatches(new Object[]{pRTV});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return a match represented as a AbsenceOfResourceInstancesMatch object, or null if no match is found.
- *
- */
- public AbsenceOfResourceInstancesMatch getOneArbitraryMatch(final ResourceTypeVariant pRTV) {
- return rawGetOneArbitraryMatch(new Object[]{pRTV});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final ResourceTypeVariant pRTV) {
- return rawHasMatch(new Object[]{pRTV});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final ResourceTypeVariant pRTV) {
- return rawCountMatches(new Object[]{pRTV});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final ResourceTypeVariant pRTV, final IMatchProcessor<? super AbsenceOfResourceInstancesMatch> processor) {
- rawForEachMatch(new Object[]{pRTV}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final ResourceTypeVariant pRTV, final IMatchProcessor<? super AbsenceOfResourceInstancesMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pRTV}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public AbsenceOfResourceInstancesMatch newMatch(final ResourceTypeVariant pRTV) {
- return AbsenceOfResourceInstancesMatch.newMatch(pRTV);
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<ResourceTypeVariant> rawAccumulateAllValuesOfRTV(final Object[] parameters) {
- Set<ResourceTypeVariant> results = new HashSet<ResourceTypeVariant>();
- rawAccumulateAllValues(POSITION_RTV, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV() {
- return rawAccumulateAllValuesOfRTV(emptyArray());
- }
-
- @Override
- protected AbsenceOfResourceInstancesMatch tupleToMatch(final Tuple t) {
- try {
- return AbsenceOfResourceInstancesMatch.newMatch((ResourceTypeVariant) t.get(POSITION_RTV));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected AbsenceOfResourceInstancesMatch arrayToMatch(final Object[] match) {
- try {
- return AbsenceOfResourceInstancesMatch.newMatch((ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected AbsenceOfResourceInstancesMatch arrayToMatchMutable(final Object[] match) {
- try {
- return AbsenceOfResourceInstancesMatch.newMutableMatch((ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<AbsenceOfResourceInstancesMatcher> querySpecification() throws ViatraQueryException {
- return AbsenceOfResourceInstancesQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AllocateTaskToVariantMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AllocateTaskToVariantMatch.java
deleted file mode 100644
index 82cf957..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AllocateTaskToVariantMatch.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.AllocateTaskToVariantQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.allocateTaskToVariant pattern,
- * to be used in conjunction with {@link AllocateTaskToVariantMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see AllocateTaskToVariantMatcher
- * @see AllocateTaskToVariantProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class AllocateTaskToVariantMatch extends BasePatternMatch {
- private Task fT;
-
- private ResourceTypeVariant fRTV;
-
- private static List<String> parameterNames = makeImmutableList("T", "RTV");
-
- private AllocateTaskToVariantMatch(final Task pT, final ResourceTypeVariant pRTV) {
- this.fT = pT;
- this.fRTV = pRTV;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("T".equals(parameterName)) return this.fT;
- if ("RTV".equals(parameterName)) return this.fRTV;
- return null;
- }
-
- public Task getT() {
- return this.fT;
- }
-
- public ResourceTypeVariant getRTV() {
- return this.fRTV;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("T".equals(parameterName) ) {
- this.fT = (Task) newValue;
- return true;
- }
- if ("RTV".equals(parameterName) ) {
- this.fRTV = (ResourceTypeVariant) newValue;
- return true;
- }
- return false;
- }
-
- public void setT(final Task pT) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT = pT;
- }
-
- public void setRTV(final ResourceTypeVariant pRTV) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRTV = pRTV;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.allocateTaskToVariant";
- }
-
- @Override
- public List<String> parameterNames() {
- return AllocateTaskToVariantMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fT, fRTV};
- }
-
- @Override
- public AllocateTaskToVariantMatch toImmutable() {
- return isMutable() ? newMatch(fT, fRTV) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"T\"=" + prettyPrintValue(fT) + ", ");
-
- result.append("\"RTV\"=" + prettyPrintValue(fRTV)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fT == null) ? 0 : fT.hashCode());
- result = prime * result + ((fRTV == null) ? 0 : fRTV.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof AllocateTaskToVariantMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- AllocateTaskToVariantMatch other = (AllocateTaskToVariantMatch) obj;
- if (fT == null) {if (other.fT != null) return false;}
- else if (!fT.equals(other.fT)) return false;
- if (fRTV == null) {if (other.fRTV != null) return false;}
- else if (!fRTV.equals(other.fRTV)) return false;
- return true;
- }
-
- @Override
- public AllocateTaskToVariantQuerySpecification specification() {
- try {
- return AllocateTaskToVariantQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static AllocateTaskToVariantMatch newEmptyMatch() {
- return new Mutable(null, null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static AllocateTaskToVariantMatch newMutableMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return new Mutable(pT, pRTV);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static AllocateTaskToVariantMatch newMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return new Immutable(pT, pRTV);
- }
-
- private static final class Mutable extends AllocateTaskToVariantMatch {
- Mutable(final Task pT, final ResourceTypeVariant pRTV) {
- super(pT, pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends AllocateTaskToVariantMatch {
- Immutable(final Task pT, final ResourceTypeVariant pRTV) {
- super(pT, pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AllocateTaskToVariantMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AllocateTaskToVariantMatcher.java
deleted file mode 100644
index 402d33e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/AllocateTaskToVariantMatcher.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AllocateTaskToVariantMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.AllocateTaskToVariantQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.allocateTaskToVariant pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link AllocateTaskToVariantMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern allocateTaskToVariant(T : Task, RTV : ResourceTypeVariant) {
- * neg find variantAllocatedToTask(T, _);
- * Task.resourceNeeded(T, RT);
- * ResourceType.variants(RT, RTV);
- * }
- * </pre></code>
- *
- * @see AllocateTaskToVariantMatch
- * @see AllocateTaskToVariantProcessor
- * @see AllocateTaskToVariantQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class AllocateTaskToVariantMatcher extends BaseMatcher<AllocateTaskToVariantMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static AllocateTaskToVariantMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- AllocateTaskToVariantMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (AllocateTaskToVariantMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static AllocateTaskToVariantMatcher create() throws ViatraQueryException {
- return new AllocateTaskToVariantMatcher();
- }
-
- private final static int POSITION_T = 0;
-
- private final static int POSITION_RTV = 1;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AllocateTaskToVariantMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private AllocateTaskToVariantMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return matches represented as a AllocateTaskToVariantMatch object.
- *
- */
- public Collection<AllocateTaskToVariantMatch> getAllMatches(final Task pT, final ResourceTypeVariant pRTV) {
- return rawGetAllMatches(new Object[]{pT, pRTV});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return a match represented as a AllocateTaskToVariantMatch object, or null if no match is found.
- *
- */
- public AllocateTaskToVariantMatch getOneArbitraryMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return rawGetOneArbitraryMatch(new Object[]{pT, pRTV});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return rawHasMatch(new Object[]{pT, pRTV});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Task pT, final ResourceTypeVariant pRTV) {
- return rawCountMatches(new Object[]{pT, pRTV});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final Task pT, final ResourceTypeVariant pRTV, final IMatchProcessor<? super AllocateTaskToVariantMatch> processor) {
- rawForEachMatch(new Object[]{pT, pRTV}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Task pT, final ResourceTypeVariant pRTV, final IMatchProcessor<? super AllocateTaskToVariantMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pT, pRTV}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public AllocateTaskToVariantMatch newMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return AllocateTaskToVariantMatch.newMatch(pT, pRTV);
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT() {
- return rawAccumulateAllValuesOfT(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT(final AllocateTaskToVariantMatch partialMatch) {
- return rawAccumulateAllValuesOfT(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT(final ResourceTypeVariant pRTV) {
- return rawAccumulateAllValuesOfT(new Object[]{
- null,
- pRTV
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<ResourceTypeVariant> rawAccumulateAllValuesOfRTV(final Object[] parameters) {
- Set<ResourceTypeVariant> results = new HashSet<ResourceTypeVariant>();
- rawAccumulateAllValues(POSITION_RTV, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV() {
- return rawAccumulateAllValuesOfRTV(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV(final AllocateTaskToVariantMatch partialMatch) {
- return rawAccumulateAllValuesOfRTV(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV(final Task pT) {
- return rawAccumulateAllValuesOfRTV(new Object[]{
- pT,
- null
- });
- }
-
- @Override
- protected AllocateTaskToVariantMatch tupleToMatch(final Tuple t) {
- try {
- return AllocateTaskToVariantMatch.newMatch((Task) t.get(POSITION_T), (ResourceTypeVariant) t.get(POSITION_RTV));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected AllocateTaskToVariantMatch arrayToMatch(final Object[] match) {
- try {
- return AllocateTaskToVariantMatch.newMatch((Task) match[POSITION_T], (ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected AllocateTaskToVariantMatch arrayToMatchMutable(final Object[] match) {
- try {
- return AllocateTaskToVariantMatch.newMutableMatch((Task) match[POSITION_T], (ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<AllocateTaskToVariantMatcher> querySpecification() throws ViatraQueryException {
- return AllocateTaskToVariantQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/CreateResourceMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/CreateResourceMatch.java
deleted file mode 100644
index a5cf2fb..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/CreateResourceMatch.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.CreateResourceQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.createResource pattern,
- * to be used in conjunction with {@link CreateResourceMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see CreateResourceMatcher
- * @see CreateResourceProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class CreateResourceMatch extends BasePatternMatch {
- private ResourceTypeVariant fRTV;
-
- private static List<String> parameterNames = makeImmutableList("RTV");
-
- private CreateResourceMatch(final ResourceTypeVariant pRTV) {
- this.fRTV = pRTV;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("RTV".equals(parameterName)) return this.fRTV;
- return null;
- }
-
- public ResourceTypeVariant getRTV() {
- return this.fRTV;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("RTV".equals(parameterName) ) {
- this.fRTV = (ResourceTypeVariant) newValue;
- return true;
- }
- return false;
- }
-
- public void setRTV(final ResourceTypeVariant pRTV) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRTV = pRTV;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.createResource";
- }
-
- @Override
- public List<String> parameterNames() {
- return CreateResourceMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fRTV};
- }
-
- @Override
- public CreateResourceMatch toImmutable() {
- return isMutable() ? newMatch(fRTV) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"RTV\"=" + prettyPrintValue(fRTV)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fRTV == null) ? 0 : fRTV.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof CreateResourceMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- CreateResourceMatch other = (CreateResourceMatch) obj;
- if (fRTV == null) {if (other.fRTV != null) return false;}
- else if (!fRTV.equals(other.fRTV)) return false;
- return true;
- }
-
- @Override
- public CreateResourceQuerySpecification specification() {
- try {
- return CreateResourceQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static CreateResourceMatch newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static CreateResourceMatch newMutableMatch(final ResourceTypeVariant pRTV) {
- return new Mutable(pRTV);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static CreateResourceMatch newMatch(final ResourceTypeVariant pRTV) {
- return new Immutable(pRTV);
- }
-
- private static final class Mutable extends CreateResourceMatch {
- Mutable(final ResourceTypeVariant pRTV) {
- super(pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends CreateResourceMatch {
- Immutable(final ResourceTypeVariant pRTV) {
- super(pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/CreateResourceMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/CreateResourceMatcher.java
deleted file mode 100644
index 73cfd1e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/CreateResourceMatcher.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.CreateResourceMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.CreateResourceQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.createResource pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link CreateResourceMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern createResource(RTV : ResourceTypeVariant) {
- * ResourceTypeVariant(RTV);
- * }
- * </pre></code>
- *
- * @see CreateResourceMatch
- * @see CreateResourceProcessor
- * @see CreateResourceQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class CreateResourceMatcher extends BaseMatcher<CreateResourceMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static CreateResourceMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- CreateResourceMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (CreateResourceMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static CreateResourceMatcher create() throws ViatraQueryException {
- return new CreateResourceMatcher();
- }
-
- private final static int POSITION_RTV = 0;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CreateResourceMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private CreateResourceMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return matches represented as a CreateResourceMatch object.
- *
- */
- public Collection<CreateResourceMatch> getAllMatches(final ResourceTypeVariant pRTV) {
- return rawGetAllMatches(new Object[]{pRTV});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return a match represented as a CreateResourceMatch object, or null if no match is found.
- *
- */
- public CreateResourceMatch getOneArbitraryMatch(final ResourceTypeVariant pRTV) {
- return rawGetOneArbitraryMatch(new Object[]{pRTV});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final ResourceTypeVariant pRTV) {
- return rawHasMatch(new Object[]{pRTV});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final ResourceTypeVariant pRTV) {
- return rawCountMatches(new Object[]{pRTV});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final ResourceTypeVariant pRTV, final IMatchProcessor<? super CreateResourceMatch> processor) {
- rawForEachMatch(new Object[]{pRTV}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final ResourceTypeVariant pRTV, final IMatchProcessor<? super CreateResourceMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pRTV}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public CreateResourceMatch newMatch(final ResourceTypeVariant pRTV) {
- return CreateResourceMatch.newMatch(pRTV);
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<ResourceTypeVariant> rawAccumulateAllValuesOfRTV(final Object[] parameters) {
- Set<ResourceTypeVariant> results = new HashSet<ResourceTypeVariant>();
- rawAccumulateAllValues(POSITION_RTV, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV() {
- return rawAccumulateAllValuesOfRTV(emptyArray());
- }
-
- @Override
- protected CreateResourceMatch tupleToMatch(final Tuple t) {
- try {
- return CreateResourceMatch.newMatch((ResourceTypeVariant) t.get(POSITION_RTV));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CreateResourceMatch arrayToMatch(final Object[] match) {
- try {
- return CreateResourceMatch.newMatch((ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected CreateResourceMatch arrayToMatchMutable(final Object[] match) {
- try {
- return CreateResourceMatch.newMutableMatch((ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<CreateResourceMatcher> querySpecification() throws ViatraQueryException {
- return CreateResourceQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EnoughResourceInstancesMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EnoughResourceInstancesMatch.java
deleted file mode 100644
index a73f082..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EnoughResourceInstancesMatch.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.EnoughResourceInstancesQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.enoughResourceInstances pattern,
- * to be used in conjunction with {@link EnoughResourceInstancesMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see EnoughResourceInstancesMatcher
- * @see EnoughResourceInstancesProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class EnoughResourceInstancesMatch extends BasePatternMatch {
- private static List<String> parameterNames = makeImmutableList();
-
- private EnoughResourceInstancesMatch() {
-
- }
-
- @Override
- public Object get(final String parameterName) {
- return null;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- return false;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.enoughResourceInstances";
- }
-
- @Override
- public List<String> parameterNames() {
- return EnoughResourceInstancesMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{};
- }
-
- @Override
- public EnoughResourceInstancesMatch toImmutable() {
- return isMutable() ? newMatch() : this;
- }
-
- @Override
- public String prettyPrint() {
- return "[]";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof EnoughResourceInstancesMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- return true;
- }
-
- @Override
- public EnoughResourceInstancesQuerySpecification specification() {
- try {
- return EnoughResourceInstancesQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static EnoughResourceInstancesMatch newEmptyMatch() {
- return new Mutable();
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the new, mutable (partial) match object.
- *
- */
- public static EnoughResourceInstancesMatch newMutableMatch() {
- return new Mutable();
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @return the (partial) match object.
- *
- */
- public static EnoughResourceInstancesMatch newMatch() {
- return new Immutable();
- }
-
- private static final class Mutable extends EnoughResourceInstancesMatch {
- Mutable() {
- super();
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends EnoughResourceInstancesMatch {
- Immutable() {
- super();
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EnoughResourceInstancesMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EnoughResourceInstancesMatcher.java
deleted file mode 100644
index cea949b..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EnoughResourceInstancesMatcher.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EnoughResourceInstancesMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.EnoughResourceInstancesQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.enoughResourceInstances pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link EnoughResourceInstancesMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern enoughResourceInstances() {
- * neg find absenceOfResourceInstances(_);
- * }
- * </pre></code>
- *
- * @see EnoughResourceInstancesMatch
- * @see EnoughResourceInstancesProcessor
- * @see EnoughResourceInstancesQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class EnoughResourceInstancesMatcher extends BaseMatcher<EnoughResourceInstancesMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EnoughResourceInstancesMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- EnoughResourceInstancesMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (EnoughResourceInstancesMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EnoughResourceInstancesMatcher create() throws ViatraQueryException {
- return new EnoughResourceInstancesMatcher();
- }
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(EnoughResourceInstancesMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private EnoughResourceInstancesMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Indicates whether the (parameterless) pattern matches or not.
- * @return true if the pattern has a valid match.
- *
- */
- public boolean hasMatch() {
- return rawHasMatch(new Object[]{});
- }
-
- @Override
- protected EnoughResourceInstancesMatch tupleToMatch(final Tuple t) {
- try {
- return EnoughResourceInstancesMatch.newMatch();
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected EnoughResourceInstancesMatch arrayToMatch(final Object[] match) {
- try {
- return EnoughResourceInstancesMatch.newMatch();
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected EnoughResourceInstancesMatch arrayToMatchMutable(final Object[] match) {
- try {
- return EnoughResourceInstancesMatch.newMutableMatch();
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<EnoughResourceInstancesMatcher> querySpecification() throws ViatraQueryException {
- return EnoughResourceInstancesQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EveryTaskHasVariantMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EveryTaskHasVariantMatch.java
deleted file mode 100644
index ea24a4f..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EveryTaskHasVariantMatch.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.EveryTaskHasVariantQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.everyTaskHasVariant pattern,
- * to be used in conjunction with {@link EveryTaskHasVariantMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see EveryTaskHasVariantMatcher
- * @see EveryTaskHasVariantProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class EveryTaskHasVariantMatch extends BasePatternMatch {
- private static List<String> parameterNames = makeImmutableList();
-
- private EveryTaskHasVariantMatch() {
-
- }
-
- @Override
- public Object get(final String parameterName) {
- return null;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- return false;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.everyTaskHasVariant";
- }
-
- @Override
- public List<String> parameterNames() {
- return EveryTaskHasVariantMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{};
- }
-
- @Override
- public EveryTaskHasVariantMatch toImmutable() {
- return isMutable() ? newMatch() : this;
- }
-
- @Override
- public String prettyPrint() {
- return "[]";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof EveryTaskHasVariantMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- return true;
- }
-
- @Override
- public EveryTaskHasVariantQuerySpecification specification() {
- try {
- return EveryTaskHasVariantQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static EveryTaskHasVariantMatch newEmptyMatch() {
- return new Mutable();
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the new, mutable (partial) match object.
- *
- */
- public static EveryTaskHasVariantMatch newMutableMatch() {
- return new Mutable();
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @return the (partial) match object.
- *
- */
- public static EveryTaskHasVariantMatch newMatch() {
- return new Immutable();
- }
-
- private static final class Mutable extends EveryTaskHasVariantMatch {
- Mutable() {
- super();
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends EveryTaskHasVariantMatch {
- Immutable() {
- super();
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EveryTaskHasVariantMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EveryTaskHasVariantMatcher.java
deleted file mode 100644
index c87347c..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/EveryTaskHasVariantMatcher.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EveryTaskHasVariantMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.EveryTaskHasVariantQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.everyTaskHasVariant pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link EveryTaskHasVariantMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern everyTaskHasVariant() {
- * neg find unassignedTask(_);
- * }
- * </pre></code>
- *
- * @see EveryTaskHasVariantMatch
- * @see EveryTaskHasVariantProcessor
- * @see EveryTaskHasVariantQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class EveryTaskHasVariantMatcher extends BaseMatcher<EveryTaskHasVariantMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EveryTaskHasVariantMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- EveryTaskHasVariantMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (EveryTaskHasVariantMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static EveryTaskHasVariantMatcher create() throws ViatraQueryException {
- return new EveryTaskHasVariantMatcher();
- }
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(EveryTaskHasVariantMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private EveryTaskHasVariantMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Indicates whether the (parameterless) pattern matches or not.
- * @return true if the pattern has a valid match.
- *
- */
- public boolean hasMatch() {
- return rawHasMatch(new Object[]{});
- }
-
- @Override
- protected EveryTaskHasVariantMatch tupleToMatch(final Tuple t) {
- try {
- return EveryTaskHasVariantMatch.newMatch();
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected EveryTaskHasVariantMatch arrayToMatch(final Object[] match) {
- try {
- return EveryTaskHasVariantMatch.newMatch();
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected EveryTaskHasVariantMatch arrayToMatchMutable(final Object[] match) {
- try {
- return EveryTaskHasVariantMatch.newMutableMatch();
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<EveryTaskHasVariantMatcher> querySpecification() throws ViatraQueryException {
- return EveryTaskHasVariantQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/InstanceOfVariantMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/InstanceOfVariantMatch.java
deleted file mode 100644
index 0ebf192..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/InstanceOfVariantMatch.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.InstanceOfVariantQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.instanceOfVariant pattern,
- * to be used in conjunction with {@link InstanceOfVariantMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see InstanceOfVariantMatcher
- * @see InstanceOfVariantProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class InstanceOfVariantMatch extends BasePatternMatch {
- private ResourceInstance fRI;
-
- private ResourceTypeVariant fRTV;
-
- private static List<String> parameterNames = makeImmutableList("RI", "RTV");
-
- private InstanceOfVariantMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- this.fRI = pRI;
- this.fRTV = pRTV;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("RI".equals(parameterName)) return this.fRI;
- if ("RTV".equals(parameterName)) return this.fRTV;
- return null;
- }
-
- public ResourceInstance getRI() {
- return this.fRI;
- }
-
- public ResourceTypeVariant getRTV() {
- return this.fRTV;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("RI".equals(parameterName) ) {
- this.fRI = (ResourceInstance) newValue;
- return true;
- }
- if ("RTV".equals(parameterName) ) {
- this.fRTV = (ResourceTypeVariant) newValue;
- return true;
- }
- return false;
- }
-
- public void setRI(final ResourceInstance pRI) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRI = pRI;
- }
-
- public void setRTV(final ResourceTypeVariant pRTV) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRTV = pRTV;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.instanceOfVariant";
- }
-
- @Override
- public List<String> parameterNames() {
- return InstanceOfVariantMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fRI, fRTV};
- }
-
- @Override
- public InstanceOfVariantMatch toImmutable() {
- return isMutable() ? newMatch(fRI, fRTV) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"RI\"=" + prettyPrintValue(fRI) + ", ");
-
- result.append("\"RTV\"=" + prettyPrintValue(fRTV)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fRI == null) ? 0 : fRI.hashCode());
- result = prime * result + ((fRTV == null) ? 0 : fRTV.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof InstanceOfVariantMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- InstanceOfVariantMatch other = (InstanceOfVariantMatch) obj;
- if (fRI == null) {if (other.fRI != null) return false;}
- else if (!fRI.equals(other.fRI)) return false;
- if (fRTV == null) {if (other.fRTV != null) return false;}
- else if (!fRTV.equals(other.fRTV)) return false;
- return true;
- }
-
- @Override
- public InstanceOfVariantQuerySpecification specification() {
- try {
- return InstanceOfVariantQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static InstanceOfVariantMatch newEmptyMatch() {
- return new Mutable(null, null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static InstanceOfVariantMatch newMutableMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- return new Mutable(pRI, pRTV);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static InstanceOfVariantMatch newMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- return new Immutable(pRI, pRTV);
- }
-
- private static final class Mutable extends InstanceOfVariantMatch {
- Mutable(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- super(pRI, pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends InstanceOfVariantMatch {
- Immutable(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- super(pRI, pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/InstanceOfVariantMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/InstanceOfVariantMatcher.java
deleted file mode 100644
index 77e946f..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/InstanceOfVariantMatcher.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.InstanceOfVariantMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.InstanceOfVariantQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.instanceOfVariant pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link InstanceOfVariantMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern instanceOfVariant(RI : ResourceInstance, RTV : ResourceTypeVariant) {
- * ResourceInstance.resourceTypeVariant(RI, RTV);
- * }
- * </pre></code>
- *
- * @see InstanceOfVariantMatch
- * @see InstanceOfVariantProcessor
- * @see InstanceOfVariantQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class InstanceOfVariantMatcher extends BaseMatcher<InstanceOfVariantMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static InstanceOfVariantMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- InstanceOfVariantMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (InstanceOfVariantMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static InstanceOfVariantMatcher create() throws ViatraQueryException {
- return new InstanceOfVariantMatcher();
- }
-
- private final static int POSITION_RI = 0;
-
- private final static int POSITION_RTV = 1;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(InstanceOfVariantMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private InstanceOfVariantMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return matches represented as a InstanceOfVariantMatch object.
- *
- */
- public Collection<InstanceOfVariantMatch> getAllMatches(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- return rawGetAllMatches(new Object[]{pRI, pRTV});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return a match represented as a InstanceOfVariantMatch object, or null if no match is found.
- *
- */
- public InstanceOfVariantMatch getOneArbitraryMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- return rawGetOneArbitraryMatch(new Object[]{pRI, pRTV});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- return rawHasMatch(new Object[]{pRI, pRTV});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- return rawCountMatches(new Object[]{pRI, pRTV});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV, final IMatchProcessor<? super InstanceOfVariantMatch> processor) {
- rawForEachMatch(new Object[]{pRI, pRTV}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV, final IMatchProcessor<? super InstanceOfVariantMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pRI, pRTV}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public InstanceOfVariantMatch newMatch(final ResourceInstance pRI, final ResourceTypeVariant pRTV) {
- return InstanceOfVariantMatch.newMatch(pRI, pRTV);
- }
-
- /**
- * Retrieve the set of values that occur in matches for RI.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<ResourceInstance> rawAccumulateAllValuesOfRI(final Object[] parameters) {
- Set<ResourceInstance> results = new HashSet<ResourceInstance>();
- rawAccumulateAllValues(POSITION_RI, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for RI.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceInstance> getAllValuesOfRI() {
- return rawAccumulateAllValuesOfRI(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RI.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceInstance> getAllValuesOfRI(final InstanceOfVariantMatch partialMatch) {
- return rawAccumulateAllValuesOfRI(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RI.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceInstance> getAllValuesOfRI(final ResourceTypeVariant pRTV) {
- return rawAccumulateAllValuesOfRI(new Object[]{
- null,
- pRTV
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<ResourceTypeVariant> rawAccumulateAllValuesOfRTV(final Object[] parameters) {
- Set<ResourceTypeVariant> results = new HashSet<ResourceTypeVariant>();
- rawAccumulateAllValues(POSITION_RTV, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV() {
- return rawAccumulateAllValuesOfRTV(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV(final InstanceOfVariantMatch partialMatch) {
- return rawAccumulateAllValuesOfRTV(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV(final ResourceInstance pRI) {
- return rawAccumulateAllValuesOfRTV(new Object[]{
- pRI,
- null
- });
- }
-
- @Override
- protected InstanceOfVariantMatch tupleToMatch(final Tuple t) {
- try {
- return InstanceOfVariantMatch.newMatch((ResourceInstance) t.get(POSITION_RI), (ResourceTypeVariant) t.get(POSITION_RTV));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected InstanceOfVariantMatch arrayToMatch(final Object[] match) {
- try {
- return InstanceOfVariantMatch.newMatch((ResourceInstance) match[POSITION_RI], (ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected InstanceOfVariantMatch arrayToMatchMutable(final Object[] match) {
- try {
- return InstanceOfVariantMatch.newMutableMatch((ResourceInstance) match[POSITION_RI], (ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<InstanceOfVariantMatcher> querySpecification() throws ViatraQueryException {
- return InstanceOfVariantQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeParallelMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeParallelMatch.java
deleted file mode 100644
index d45f520..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeParallelMatch.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.MakeParallelQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.makeParallel pattern,
- * to be used in conjunction with {@link MakeParallelMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see MakeParallelMatcher
- * @see MakeParallelProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class MakeParallelMatch extends BasePatternMatch {
- private Task fT1;
-
- private Task fT2;
-
- private SimplifiedBPMN fRoot;
-
- private static List<String> parameterNames = makeImmutableList("T1", "T2", "Root");
-
- private MakeParallelMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- this.fT1 = pT1;
- this.fT2 = pT2;
- this.fRoot = pRoot;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("T1".equals(parameterName)) return this.fT1;
- if ("T2".equals(parameterName)) return this.fT2;
- if ("Root".equals(parameterName)) return this.fRoot;
- return null;
- }
-
- public Task getT1() {
- return this.fT1;
- }
-
- public Task getT2() {
- return this.fT2;
- }
-
- public SimplifiedBPMN getRoot() {
- return this.fRoot;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("T1".equals(parameterName) ) {
- this.fT1 = (Task) newValue;
- return true;
- }
- if ("T2".equals(parameterName) ) {
- this.fT2 = (Task) newValue;
- return true;
- }
- if ("Root".equals(parameterName) ) {
- this.fRoot = (SimplifiedBPMN) newValue;
- return true;
- }
- return false;
- }
-
- public void setT1(final Task pT1) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT1 = pT1;
- }
-
- public void setT2(final Task pT2) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT2 = pT2;
- }
-
- public void setRoot(final SimplifiedBPMN pRoot) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRoot = pRoot;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.makeParallel";
- }
-
- @Override
- public List<String> parameterNames() {
- return MakeParallelMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fT1, fT2, fRoot};
- }
-
- @Override
- public MakeParallelMatch toImmutable() {
- return isMutable() ? newMatch(fT1, fT2, fRoot) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"T1\"=" + prettyPrintValue(fT1) + ", ");
-
- result.append("\"T2\"=" + prettyPrintValue(fT2) + ", ");
-
- result.append("\"Root\"=" + prettyPrintValue(fRoot)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fT1 == null) ? 0 : fT1.hashCode());
- result = prime * result + ((fT2 == null) ? 0 : fT2.hashCode());
- result = prime * result + ((fRoot == null) ? 0 : fRoot.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof MakeParallelMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- MakeParallelMatch other = (MakeParallelMatch) obj;
- if (fT1 == null) {if (other.fT1 != null) return false;}
- else if (!fT1.equals(other.fT1)) return false;
- if (fT2 == null) {if (other.fT2 != null) return false;}
- else if (!fT2.equals(other.fT2)) return false;
- if (fRoot == null) {if (other.fRoot != null) return false;}
- else if (!fRoot.equals(other.fRoot)) return false;
- return true;
- }
-
- @Override
- public MakeParallelQuerySpecification specification() {
- try {
- return MakeParallelQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static MakeParallelMatch newEmptyMatch() {
- return new Mutable(null, null, null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static MakeParallelMatch newMutableMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return new Mutable(pT1, pT2, pRoot);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static MakeParallelMatch newMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return new Immutable(pT1, pT2, pRoot);
- }
-
- private static final class Mutable extends MakeParallelMatch {
- Mutable(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- super(pT1, pT2, pRoot);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends MakeParallelMatch {
- Immutable(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- super(pT1, pT2, pRoot);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeParallelMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeParallelMatcher.java
deleted file mode 100644
index 7b2455c..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeParallelMatcher.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeParallelMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.MakeParallelQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.makeParallel pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link MakeParallelMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern makeParallel(T1 : Task, T2 : Task, Root : SimplifiedBPMN) {
- * SimplifiedBPMN(Root);
- * Task.outFlows(T1, outflow);
- * SequenceFlow.isDataFlow(outflow, false);
- * SequenceFlow.target(outflow, T2);
- * T1 != T2;
- * find taskOrder(T1,T2);
- * 1 == count find inFlow(T2, _);
- * 1 == count find outFlow(T1, _);
- * }
- * </pre></code>
- *
- * @see MakeParallelMatch
- * @see MakeParallelProcessor
- * @see MakeParallelQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class MakeParallelMatcher extends BaseMatcher<MakeParallelMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static MakeParallelMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- MakeParallelMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (MakeParallelMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static MakeParallelMatcher create() throws ViatraQueryException {
- return new MakeParallelMatcher();
- }
-
- private final static int POSITION_T1 = 0;
-
- private final static int POSITION_T2 = 1;
-
- private final static int POSITION_ROOT = 2;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(MakeParallelMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private MakeParallelMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return matches represented as a MakeParallelMatch object.
- *
- */
- public Collection<MakeParallelMatch> getAllMatches(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawGetAllMatches(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return a match represented as a MakeParallelMatch object, or null if no match is found.
- *
- */
- public MakeParallelMatch getOneArbitraryMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawGetOneArbitraryMatch(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawHasMatch(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawCountMatches(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot, final IMatchProcessor<? super MakeParallelMatch> processor) {
- rawForEachMatch(new Object[]{pT1, pT2, pRoot}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot, final IMatchProcessor<? super MakeParallelMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pT1, pT2, pRoot}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public MakeParallelMatch newMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return MakeParallelMatch.newMatch(pT1, pT2, pRoot);
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT1(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T1, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1() {
- return rawAccumulateAllValuesOfT1(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1(final MakeParallelMatch partialMatch) {
- return rawAccumulateAllValuesOfT1(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1(final Task pT2, final SimplifiedBPMN pRoot) {
- return rawAccumulateAllValuesOfT1(new Object[]{
- null,
- pT2,
- pRoot
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT2(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T2, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2() {
- return rawAccumulateAllValuesOfT2(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2(final MakeParallelMatch partialMatch) {
- return rawAccumulateAllValuesOfT2(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2(final Task pT1, final SimplifiedBPMN pRoot) {
- return rawAccumulateAllValuesOfT2(new Object[]{
- pT1,
- null,
- pRoot
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<SimplifiedBPMN> rawAccumulateAllValuesOfRoot(final Object[] parameters) {
- Set<SimplifiedBPMN> results = new HashSet<SimplifiedBPMN>();
- rawAccumulateAllValues(POSITION_ROOT, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<SimplifiedBPMN> getAllValuesOfRoot() {
- return rawAccumulateAllValuesOfRoot(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<SimplifiedBPMN> getAllValuesOfRoot(final MakeParallelMatch partialMatch) {
- return rawAccumulateAllValuesOfRoot(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<SimplifiedBPMN> getAllValuesOfRoot(final Task pT1, final Task pT2) {
- return rawAccumulateAllValuesOfRoot(new Object[]{
- pT1,
- pT2,
- null
- });
- }
-
- @Override
- protected MakeParallelMatch tupleToMatch(final Tuple t) {
- try {
- return MakeParallelMatch.newMatch((Task) t.get(POSITION_T1), (Task) t.get(POSITION_T2), (SimplifiedBPMN) t.get(POSITION_ROOT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected MakeParallelMatch arrayToMatch(final Object[] match) {
- try {
- return MakeParallelMatch.newMatch((Task) match[POSITION_T1], (Task) match[POSITION_T2], (SimplifiedBPMN) match[POSITION_ROOT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected MakeParallelMatch arrayToMatchMutable(final Object[] match) {
- try {
- return MakeParallelMatch.newMutableMatch((Task) match[POSITION_T1], (Task) match[POSITION_T2], (SimplifiedBPMN) match[POSITION_ROOT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<MakeParallelMatcher> querySpecification() throws ViatraQueryException {
- return MakeParallelQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeSequentialMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeSequentialMatch.java
deleted file mode 100644
index d3026f5..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeSequentialMatch.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.MakeSequentialQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.makeSequential pattern,
- * to be used in conjunction with {@link MakeSequentialMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see MakeSequentialMatcher
- * @see MakeSequentialProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class MakeSequentialMatch extends BasePatternMatch {
- private Task fT1;
-
- private Task fT2;
-
- private SimplifiedBPMN fRoot;
-
- private static List<String> parameterNames = makeImmutableList("T1", "T2", "Root");
-
- private MakeSequentialMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- this.fT1 = pT1;
- this.fT2 = pT2;
- this.fRoot = pRoot;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("T1".equals(parameterName)) return this.fT1;
- if ("T2".equals(parameterName)) return this.fT2;
- if ("Root".equals(parameterName)) return this.fRoot;
- return null;
- }
-
- public Task getT1() {
- return this.fT1;
- }
-
- public Task getT2() {
- return this.fT2;
- }
-
- public SimplifiedBPMN getRoot() {
- return this.fRoot;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("T1".equals(parameterName) ) {
- this.fT1 = (Task) newValue;
- return true;
- }
- if ("T2".equals(parameterName) ) {
- this.fT2 = (Task) newValue;
- return true;
- }
- if ("Root".equals(parameterName) ) {
- this.fRoot = (SimplifiedBPMN) newValue;
- return true;
- }
- return false;
- }
-
- public void setT1(final Task pT1) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT1 = pT1;
- }
-
- public void setT2(final Task pT2) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT2 = pT2;
- }
-
- public void setRoot(final SimplifiedBPMN pRoot) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRoot = pRoot;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.makeSequential";
- }
-
- @Override
- public List<String> parameterNames() {
- return MakeSequentialMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fT1, fT2, fRoot};
- }
-
- @Override
- public MakeSequentialMatch toImmutable() {
- return isMutable() ? newMatch(fT1, fT2, fRoot) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"T1\"=" + prettyPrintValue(fT1) + ", ");
-
- result.append("\"T2\"=" + prettyPrintValue(fT2) + ", ");
-
- result.append("\"Root\"=" + prettyPrintValue(fRoot)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fT1 == null) ? 0 : fT1.hashCode());
- result = prime * result + ((fT2 == null) ? 0 : fT2.hashCode());
- result = prime * result + ((fRoot == null) ? 0 : fRoot.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof MakeSequentialMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- MakeSequentialMatch other = (MakeSequentialMatch) obj;
- if (fT1 == null) {if (other.fT1 != null) return false;}
- else if (!fT1.equals(other.fT1)) return false;
- if (fT2 == null) {if (other.fT2 != null) return false;}
- else if (!fT2.equals(other.fT2)) return false;
- if (fRoot == null) {if (other.fRoot != null) return false;}
- else if (!fRoot.equals(other.fRoot)) return false;
- return true;
- }
-
- @Override
- public MakeSequentialQuerySpecification specification() {
- try {
- return MakeSequentialQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static MakeSequentialMatch newEmptyMatch() {
- return new Mutable(null, null, null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static MakeSequentialMatch newMutableMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return new Mutable(pT1, pT2, pRoot);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static MakeSequentialMatch newMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return new Immutable(pT1, pT2, pRoot);
- }
-
- private static final class Mutable extends MakeSequentialMatch {
- Mutable(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- super(pT1, pT2, pRoot);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends MakeSequentialMatch {
- Immutable(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- super(pT1, pT2, pRoot);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeSequentialMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeSequentialMatcher.java
deleted file mode 100644
index 680e980..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/MakeSequentialMatcher.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeSequentialMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.MakeSequentialQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.makeSequential pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link MakeSequentialMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern makeSequential(T1 : Task, T2 : Task, Root : SimplifiedBPMN) {
- * SimplifiedBPMN(Root);
- * ParallelGateway.outFlows.target(pg, T1);
- * ParallelGateway.outFlows.target(pg, T2);
- * T1 != T2;
- * find taskOrder(T1,T2);
- * N == count find parallelGatewayOutFlow(pg, _);
- * N == 2;
- * Task.outFlows.target(T1, pg2);
- * Task.outFlows.target(T2, pg2);
- * }
- * </pre></code>
- *
- * @see MakeSequentialMatch
- * @see MakeSequentialProcessor
- * @see MakeSequentialQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class MakeSequentialMatcher extends BaseMatcher<MakeSequentialMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static MakeSequentialMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- MakeSequentialMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (MakeSequentialMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static MakeSequentialMatcher create() throws ViatraQueryException {
- return new MakeSequentialMatcher();
- }
-
- private final static int POSITION_T1 = 0;
-
- private final static int POSITION_T2 = 1;
-
- private final static int POSITION_ROOT = 2;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(MakeSequentialMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private MakeSequentialMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return matches represented as a MakeSequentialMatch object.
- *
- */
- public Collection<MakeSequentialMatch> getAllMatches(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawGetAllMatches(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return a match represented as a MakeSequentialMatch object, or null if no match is found.
- *
- */
- public MakeSequentialMatch getOneArbitraryMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawGetOneArbitraryMatch(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawHasMatch(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return rawCountMatches(new Object[]{pT1, pT2, pRoot});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot, final IMatchProcessor<? super MakeSequentialMatch> processor) {
- rawForEachMatch(new Object[]{pT1, pT2, pRoot}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot, final IMatchProcessor<? super MakeSequentialMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pT1, pT2, pRoot}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param pRoot the fixed value of pattern parameter Root, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public MakeSequentialMatch newMatch(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot) {
- return MakeSequentialMatch.newMatch(pT1, pT2, pRoot);
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT1(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T1, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1() {
- return rawAccumulateAllValuesOfT1(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1(final MakeSequentialMatch partialMatch) {
- return rawAccumulateAllValuesOfT1(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1(final Task pT2, final SimplifiedBPMN pRoot) {
- return rawAccumulateAllValuesOfT1(new Object[]{
- null,
- pT2,
- pRoot
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT2(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T2, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2() {
- return rawAccumulateAllValuesOfT2(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2(final MakeSequentialMatch partialMatch) {
- return rawAccumulateAllValuesOfT2(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2(final Task pT1, final SimplifiedBPMN pRoot) {
- return rawAccumulateAllValuesOfT2(new Object[]{
- pT1,
- null,
- pRoot
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<SimplifiedBPMN> rawAccumulateAllValuesOfRoot(final Object[] parameters) {
- Set<SimplifiedBPMN> results = new HashSet<SimplifiedBPMN>();
- rawAccumulateAllValues(POSITION_ROOT, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<SimplifiedBPMN> getAllValuesOfRoot() {
- return rawAccumulateAllValuesOfRoot(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<SimplifiedBPMN> getAllValuesOfRoot(final MakeSequentialMatch partialMatch) {
- return rawAccumulateAllValuesOfRoot(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for Root.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<SimplifiedBPMN> getAllValuesOfRoot(final Task pT1, final Task pT2) {
- return rawAccumulateAllValuesOfRoot(new Object[]{
- pT1,
- pT2,
- null
- });
- }
-
- @Override
- protected MakeSequentialMatch tupleToMatch(final Tuple t) {
- try {
- return MakeSequentialMatch.newMatch((Task) t.get(POSITION_T1), (Task) t.get(POSITION_T2), (SimplifiedBPMN) t.get(POSITION_ROOT));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected MakeSequentialMatch arrayToMatch(final Object[] match) {
- try {
- return MakeSequentialMatch.newMatch((Task) match[POSITION_T1], (Task) match[POSITION_T2], (SimplifiedBPMN) match[POSITION_ROOT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected MakeSequentialMatch arrayToMatchMutable(final Object[] match) {
- try {
- return MakeSequentialMatch.newMutableMatch((Task) match[POSITION_T1], (Task) match[POSITION_T2], (SimplifiedBPMN) match[POSITION_ROOT]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<MakeSequentialMatcher> querySpecification() throws ViatraQueryException {
- return MakeSequentialQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/Patterns.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/Patterns.java
deleted file mode 100644
index bdd60a2..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/Patterns.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AbsenceOfResourceInstancesMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AllocateTaskToVariantMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.CreateResourceMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EnoughResourceInstancesMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EveryTaskHasVariantMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.InstanceOfVariantMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeParallelMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeSequentialMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.TaskOrderMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnassignedTaskMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnrequiredResourceInstanceMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.VariantAllocatedToTaskMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.AbsenceOfResourceInstancesQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.AllocateTaskToVariantQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.CreateResourceQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.EnoughResourceInstancesQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.EveryTaskHasVariantQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.InstanceOfVariantQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.MakeParallelQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.MakeSequentialQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.TaskOrderQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.UnassignedTaskQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.UnrequiredResourceInstanceQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.VariantAllocatedToTaskQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * A pattern group formed of all patterns defined in patterns.vql.
- *
- * <p>Use the static instance as any {@link org.eclipse.viatra.query.runtime.api.IPatternGroup}, to conveniently prepare
- * a VIATRA Query engine for matching all patterns originally defined in file patterns.vql,
- * in order to achieve better performance than one-by-one on-demand matcher initialization.
- *
- * <p> From package org.eclipse.viatra.dse.examples.bpmn.patterns, the group contains the definition of the following patterns: <ul>
- * <li>createResource</li>
- * <li>variantAllocatedToTask</li>
- * <li>allocateTaskToVariant</li>
- * <li>inFlow</li>
- * <li>outFlow</li>
- * <li>makeParallel</li>
- * <li>parallelGatewayOutFlow</li>
- * <li>makeSequential</li>
- * <li>unassignedTask</li>
- * <li>instanceOfVariant</li>
- * <li>absenceOfResourceInstances</li>
- * <li>unrequiredResourceInstance</li>
- * <li>taskNeedsVariant</li>
- * <li>enoughResourceInstances</li>
- * <li>everyTaskHasVariant</li>
- * <li>taskOrder</li>
- * </ul>
- *
- * @see IPatternGroup
- *
- */
-@SuppressWarnings("all")
-public final class Patterns extends BaseGeneratedPatternGroup {
- /**
- * Access the pattern group.
- *
- * @return the singleton instance of the group
- * @throws ViatraQueryException if there was an error loading the generated code of pattern specifications
- *
- */
- public static Patterns instance() throws ViatraQueryException {
- if (INSTANCE == null) {
- INSTANCE = new Patterns();
- }
- return INSTANCE;
- }
-
- private static Patterns INSTANCE;
-
- private Patterns() throws ViatraQueryException {
- querySpecifications.add(CreateResourceQuerySpecification.instance());
- querySpecifications.add(VariantAllocatedToTaskQuerySpecification.instance());
- querySpecifications.add(AllocateTaskToVariantQuerySpecification.instance());
- querySpecifications.add(MakeParallelQuerySpecification.instance());
- querySpecifications.add(MakeSequentialQuerySpecification.instance());
- querySpecifications.add(UnassignedTaskQuerySpecification.instance());
- querySpecifications.add(InstanceOfVariantQuerySpecification.instance());
- querySpecifications.add(AbsenceOfResourceInstancesQuerySpecification.instance());
- querySpecifications.add(UnrequiredResourceInstanceQuerySpecification.instance());
- querySpecifications.add(EnoughResourceInstancesQuerySpecification.instance());
- querySpecifications.add(EveryTaskHasVariantQuerySpecification.instance());
- querySpecifications.add(TaskOrderQuerySpecification.instance());
- }
-
- public CreateResourceQuerySpecification getCreateResource() throws ViatraQueryException {
- return CreateResourceQuerySpecification.instance();
- }
-
- public CreateResourceMatcher getCreateResource(final ViatraQueryEngine engine) throws ViatraQueryException {
- return CreateResourceMatcher.on(engine);
- }
-
- public VariantAllocatedToTaskQuerySpecification getVariantAllocatedToTask() throws ViatraQueryException {
- return VariantAllocatedToTaskQuerySpecification.instance();
- }
-
- public VariantAllocatedToTaskMatcher getVariantAllocatedToTask(final ViatraQueryEngine engine) throws ViatraQueryException {
- return VariantAllocatedToTaskMatcher.on(engine);
- }
-
- public AllocateTaskToVariantQuerySpecification getAllocateTaskToVariant() throws ViatraQueryException {
- return AllocateTaskToVariantQuerySpecification.instance();
- }
-
- public AllocateTaskToVariantMatcher getAllocateTaskToVariant(final ViatraQueryEngine engine) throws ViatraQueryException {
- return AllocateTaskToVariantMatcher.on(engine);
- }
-
- public MakeParallelQuerySpecification getMakeParallel() throws ViatraQueryException {
- return MakeParallelQuerySpecification.instance();
- }
-
- public MakeParallelMatcher getMakeParallel(final ViatraQueryEngine engine) throws ViatraQueryException {
- return MakeParallelMatcher.on(engine);
- }
-
- public MakeSequentialQuerySpecification getMakeSequential() throws ViatraQueryException {
- return MakeSequentialQuerySpecification.instance();
- }
-
- public MakeSequentialMatcher getMakeSequential(final ViatraQueryEngine engine) throws ViatraQueryException {
- return MakeSequentialMatcher.on(engine);
- }
-
- public UnassignedTaskQuerySpecification getUnassignedTask() throws ViatraQueryException {
- return UnassignedTaskQuerySpecification.instance();
- }
-
- public UnassignedTaskMatcher getUnassignedTask(final ViatraQueryEngine engine) throws ViatraQueryException {
- return UnassignedTaskMatcher.on(engine);
- }
-
- public InstanceOfVariantQuerySpecification getInstanceOfVariant() throws ViatraQueryException {
- return InstanceOfVariantQuerySpecification.instance();
- }
-
- public InstanceOfVariantMatcher getInstanceOfVariant(final ViatraQueryEngine engine) throws ViatraQueryException {
- return InstanceOfVariantMatcher.on(engine);
- }
-
- public AbsenceOfResourceInstancesQuerySpecification getAbsenceOfResourceInstances() throws ViatraQueryException {
- return AbsenceOfResourceInstancesQuerySpecification.instance();
- }
-
- public AbsenceOfResourceInstancesMatcher getAbsenceOfResourceInstances(final ViatraQueryEngine engine) throws ViatraQueryException {
- return AbsenceOfResourceInstancesMatcher.on(engine);
- }
-
- public UnrequiredResourceInstanceQuerySpecification getUnrequiredResourceInstance() throws ViatraQueryException {
- return UnrequiredResourceInstanceQuerySpecification.instance();
- }
-
- public UnrequiredResourceInstanceMatcher getUnrequiredResourceInstance(final ViatraQueryEngine engine) throws ViatraQueryException {
- return UnrequiredResourceInstanceMatcher.on(engine);
- }
-
- public EnoughResourceInstancesQuerySpecification getEnoughResourceInstances() throws ViatraQueryException {
- return EnoughResourceInstancesQuerySpecification.instance();
- }
-
- public EnoughResourceInstancesMatcher getEnoughResourceInstances(final ViatraQueryEngine engine) throws ViatraQueryException {
- return EnoughResourceInstancesMatcher.on(engine);
- }
-
- public EveryTaskHasVariantQuerySpecification getEveryTaskHasVariant() throws ViatraQueryException {
- return EveryTaskHasVariantQuerySpecification.instance();
- }
-
- public EveryTaskHasVariantMatcher getEveryTaskHasVariant(final ViatraQueryEngine engine) throws ViatraQueryException {
- return EveryTaskHasVariantMatcher.on(engine);
- }
-
- public TaskOrderQuerySpecification getTaskOrder() throws ViatraQueryException {
- return TaskOrderQuerySpecification.instance();
- }
-
- public TaskOrderMatcher getTaskOrder(final ViatraQueryEngine engine) throws ViatraQueryException {
- return TaskOrderMatcher.on(engine);
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/TaskOrderMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/TaskOrderMatch.java
deleted file mode 100644
index 0d167d3..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/TaskOrderMatch.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.TaskOrderQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.taskOrder pattern,
- * to be used in conjunction with {@link TaskOrderMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see TaskOrderMatcher
- * @see TaskOrderProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class TaskOrderMatch extends BasePatternMatch {
- private Task fT1;
-
- private Task fT2;
-
- private static List<String> parameterNames = makeImmutableList("T1", "T2");
-
- private TaskOrderMatch(final Task pT1, final Task pT2) {
- this.fT1 = pT1;
- this.fT2 = pT2;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("T1".equals(parameterName)) return this.fT1;
- if ("T2".equals(parameterName)) return this.fT2;
- return null;
- }
-
- public Task getT1() {
- return this.fT1;
- }
-
- public Task getT2() {
- return this.fT2;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("T1".equals(parameterName) ) {
- this.fT1 = (Task) newValue;
- return true;
- }
- if ("T2".equals(parameterName) ) {
- this.fT2 = (Task) newValue;
- return true;
- }
- return false;
- }
-
- public void setT1(final Task pT1) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT1 = pT1;
- }
-
- public void setT2(final Task pT2) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT2 = pT2;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.taskOrder";
- }
-
- @Override
- public List<String> parameterNames() {
- return TaskOrderMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fT1, fT2};
- }
-
- @Override
- public TaskOrderMatch toImmutable() {
- return isMutable() ? newMatch(fT1, fT2) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"T1\"=" + prettyPrintValue(fT1) + ", ");
-
- result.append("\"T2\"=" + prettyPrintValue(fT2)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fT1 == null) ? 0 : fT1.hashCode());
- result = prime * result + ((fT2 == null) ? 0 : fT2.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof TaskOrderMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- TaskOrderMatch other = (TaskOrderMatch) obj;
- if (fT1 == null) {if (other.fT1 != null) return false;}
- else if (!fT1.equals(other.fT1)) return false;
- if (fT2 == null) {if (other.fT2 != null) return false;}
- else if (!fT2.equals(other.fT2)) return false;
- return true;
- }
-
- @Override
- public TaskOrderQuerySpecification specification() {
- try {
- return TaskOrderQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static TaskOrderMatch newEmptyMatch() {
- return new Mutable(null, null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static TaskOrderMatch newMutableMatch(final Task pT1, final Task pT2) {
- return new Mutable(pT1, pT2);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static TaskOrderMatch newMatch(final Task pT1, final Task pT2) {
- return new Immutable(pT1, pT2);
- }
-
- private static final class Mutable extends TaskOrderMatch {
- Mutable(final Task pT1, final Task pT2) {
- super(pT1, pT2);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends TaskOrderMatch {
- Immutable(final Task pT1, final Task pT2) {
- super(pT1, pT2);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/TaskOrderMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/TaskOrderMatcher.java
deleted file mode 100644
index 57b9800..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/TaskOrderMatcher.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.TaskOrderMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.TaskOrderQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.taskOrder pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link TaskOrderMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern taskOrder(T1:Task, T2:Task) {
- * Task.name(T1,name1);
- * Task.name(T2,name2);
- * check(name1 {@literal >} name2);
- * }
- * </pre></code>
- *
- * @see TaskOrderMatch
- * @see TaskOrderProcessor
- * @see TaskOrderQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class TaskOrderMatcher extends BaseMatcher<TaskOrderMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static TaskOrderMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- TaskOrderMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (TaskOrderMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static TaskOrderMatcher create() throws ViatraQueryException {
- return new TaskOrderMatcher();
- }
-
- private final static int POSITION_T1 = 0;
-
- private final static int POSITION_T2 = 1;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TaskOrderMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private TaskOrderMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @return matches represented as a TaskOrderMatch object.
- *
- */
- public Collection<TaskOrderMatch> getAllMatches(final Task pT1, final Task pT2) {
- return rawGetAllMatches(new Object[]{pT1, pT2});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @return a match represented as a TaskOrderMatch object, or null if no match is found.
- *
- */
- public TaskOrderMatch getOneArbitraryMatch(final Task pT1, final Task pT2) {
- return rawGetOneArbitraryMatch(new Object[]{pT1, pT2});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Task pT1, final Task pT2) {
- return rawHasMatch(new Object[]{pT1, pT2});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Task pT1, final Task pT2) {
- return rawCountMatches(new Object[]{pT1, pT2});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final Task pT1, final Task pT2, final IMatchProcessor<? super TaskOrderMatch> processor) {
- rawForEachMatch(new Object[]{pT1, pT2}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Task pT1, final Task pT2, final IMatchProcessor<? super TaskOrderMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pT1, pT2}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT1 the fixed value of pattern parameter T1, or null if not bound.
- * @param pT2 the fixed value of pattern parameter T2, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public TaskOrderMatch newMatch(final Task pT1, final Task pT2) {
- return TaskOrderMatch.newMatch(pT1, pT2);
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT1(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T1, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1() {
- return rawAccumulateAllValuesOfT1(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1(final TaskOrderMatch partialMatch) {
- return rawAccumulateAllValuesOfT1(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T1.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT1(final Task pT2) {
- return rawAccumulateAllValuesOfT1(new Object[]{
- null,
- pT2
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT2(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T2, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2() {
- return rawAccumulateAllValuesOfT2(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2(final TaskOrderMatch partialMatch) {
- return rawAccumulateAllValuesOfT2(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T2.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT2(final Task pT1) {
- return rawAccumulateAllValuesOfT2(new Object[]{
- pT1,
- null
- });
- }
-
- @Override
- protected TaskOrderMatch tupleToMatch(final Tuple t) {
- try {
- return TaskOrderMatch.newMatch((Task) t.get(POSITION_T1), (Task) t.get(POSITION_T2));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected TaskOrderMatch arrayToMatch(final Object[] match) {
- try {
- return TaskOrderMatch.newMatch((Task) match[POSITION_T1], (Task) match[POSITION_T2]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected TaskOrderMatch arrayToMatchMutable(final Object[] match) {
- try {
- return TaskOrderMatch.newMutableMatch((Task) match[POSITION_T1], (Task) match[POSITION_T2]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<TaskOrderMatcher> querySpecification() throws ViatraQueryException {
- return TaskOrderQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnassignedTaskMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnassignedTaskMatch.java
deleted file mode 100644
index db77525..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnassignedTaskMatch.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.UnassignedTaskQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.unassignedTask pattern,
- * to be used in conjunction with {@link UnassignedTaskMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see UnassignedTaskMatcher
- * @see UnassignedTaskProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class UnassignedTaskMatch extends BasePatternMatch {
- private Task fT;
-
- private static List<String> parameterNames = makeImmutableList("T");
-
- private UnassignedTaskMatch(final Task pT) {
- this.fT = pT;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("T".equals(parameterName)) return this.fT;
- return null;
- }
-
- public Task getT() {
- return this.fT;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("T".equals(parameterName) ) {
- this.fT = (Task) newValue;
- return true;
- }
- return false;
- }
-
- public void setT(final Task pT) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT = pT;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.unassignedTask";
- }
-
- @Override
- public List<String> parameterNames() {
- return UnassignedTaskMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fT};
- }
-
- @Override
- public UnassignedTaskMatch toImmutable() {
- return isMutable() ? newMatch(fT) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"T\"=" + prettyPrintValue(fT)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fT == null) ? 0 : fT.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof UnassignedTaskMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- UnassignedTaskMatch other = (UnassignedTaskMatch) obj;
- if (fT == null) {if (other.fT != null) return false;}
- else if (!fT.equals(other.fT)) return false;
- return true;
- }
-
- @Override
- public UnassignedTaskQuerySpecification specification() {
- try {
- return UnassignedTaskQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static UnassignedTaskMatch newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static UnassignedTaskMatch newMutableMatch(final Task pT) {
- return new Mutable(pT);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static UnassignedTaskMatch newMatch(final Task pT) {
- return new Immutable(pT);
- }
-
- private static final class Mutable extends UnassignedTaskMatch {
- Mutable(final Task pT) {
- super(pT);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends UnassignedTaskMatch {
- Immutable(final Task pT) {
- super(pT);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnassignedTaskMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnassignedTaskMatcher.java
deleted file mode 100644
index 3fa5222..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnassignedTaskMatcher.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnassignedTaskMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.UnassignedTaskQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.unassignedTask pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link UnassignedTaskMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern unassignedTask(T : Task) {
- * neg find variantAllocatedToTask(T, _);
- * }
- * </pre></code>
- *
- * @see UnassignedTaskMatch
- * @see UnassignedTaskProcessor
- * @see UnassignedTaskQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class UnassignedTaskMatcher extends BaseMatcher<UnassignedTaskMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static UnassignedTaskMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- UnassignedTaskMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (UnassignedTaskMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static UnassignedTaskMatcher create() throws ViatraQueryException {
- return new UnassignedTaskMatcher();
- }
-
- private final static int POSITION_T = 0;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(UnassignedTaskMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private UnassignedTaskMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @return matches represented as a UnassignedTaskMatch object.
- *
- */
- public Collection<UnassignedTaskMatch> getAllMatches(final Task pT) {
- return rawGetAllMatches(new Object[]{pT});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @return a match represented as a UnassignedTaskMatch object, or null if no match is found.
- *
- */
- public UnassignedTaskMatch getOneArbitraryMatch(final Task pT) {
- return rawGetOneArbitraryMatch(new Object[]{pT});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Task pT) {
- return rawHasMatch(new Object[]{pT});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Task pT) {
- return rawCountMatches(new Object[]{pT});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final Task pT, final IMatchProcessor<? super UnassignedTaskMatch> processor) {
- rawForEachMatch(new Object[]{pT}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Task pT, final IMatchProcessor<? super UnassignedTaskMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pT}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public UnassignedTaskMatch newMatch(final Task pT) {
- return UnassignedTaskMatch.newMatch(pT);
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT() {
- return rawAccumulateAllValuesOfT(emptyArray());
- }
-
- @Override
- protected UnassignedTaskMatch tupleToMatch(final Tuple t) {
- try {
- return UnassignedTaskMatch.newMatch((Task) t.get(POSITION_T));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected UnassignedTaskMatch arrayToMatch(final Object[] match) {
- try {
- return UnassignedTaskMatch.newMatch((Task) match[POSITION_T]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected UnassignedTaskMatch arrayToMatchMutable(final Object[] match) {
- try {
- return UnassignedTaskMatch.newMutableMatch((Task) match[POSITION_T]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<UnassignedTaskMatcher> querySpecification() throws ViatraQueryException {
- return UnassignedTaskQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnrequiredResourceInstanceMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnrequiredResourceInstanceMatch.java
deleted file mode 100644
index 770d18f..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnrequiredResourceInstanceMatch.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.UnrequiredResourceInstanceQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.unrequiredResourceInstance pattern,
- * to be used in conjunction with {@link UnrequiredResourceInstanceMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see UnrequiredResourceInstanceMatcher
- * @see UnrequiredResourceInstanceProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class UnrequiredResourceInstanceMatch extends BasePatternMatch {
- private ResourceInstance fRI;
-
- private static List<String> parameterNames = makeImmutableList("RI");
-
- private UnrequiredResourceInstanceMatch(final ResourceInstance pRI) {
- this.fRI = pRI;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("RI".equals(parameterName)) return this.fRI;
- return null;
- }
-
- public ResourceInstance getRI() {
- return this.fRI;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("RI".equals(parameterName) ) {
- this.fRI = (ResourceInstance) newValue;
- return true;
- }
- return false;
- }
-
- public void setRI(final ResourceInstance pRI) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRI = pRI;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.unrequiredResourceInstance";
- }
-
- @Override
- public List<String> parameterNames() {
- return UnrequiredResourceInstanceMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fRI};
- }
-
- @Override
- public UnrequiredResourceInstanceMatch toImmutable() {
- return isMutable() ? newMatch(fRI) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"RI\"=" + prettyPrintValue(fRI)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fRI == null) ? 0 : fRI.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof UnrequiredResourceInstanceMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- UnrequiredResourceInstanceMatch other = (UnrequiredResourceInstanceMatch) obj;
- if (fRI == null) {if (other.fRI != null) return false;}
- else if (!fRI.equals(other.fRI)) return false;
- return true;
- }
-
- @Override
- public UnrequiredResourceInstanceQuerySpecification specification() {
- try {
- return UnrequiredResourceInstanceQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static UnrequiredResourceInstanceMatch newEmptyMatch() {
- return new Mutable(null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static UnrequiredResourceInstanceMatch newMutableMatch(final ResourceInstance pRI) {
- return new Mutable(pRI);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static UnrequiredResourceInstanceMatch newMatch(final ResourceInstance pRI) {
- return new Immutable(pRI);
- }
-
- private static final class Mutable extends UnrequiredResourceInstanceMatch {
- Mutable(final ResourceInstance pRI) {
- super(pRI);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends UnrequiredResourceInstanceMatch {
- Immutable(final ResourceInstance pRI) {
- super(pRI);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnrequiredResourceInstanceMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnrequiredResourceInstanceMatcher.java
deleted file mode 100644
index c180256..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/UnrequiredResourceInstanceMatcher.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnrequiredResourceInstanceMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.UnrequiredResourceInstanceQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.unrequiredResourceInstance pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link UnrequiredResourceInstanceMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern unrequiredResourceInstance(RI : ResourceInstance) {
- * ResourceInstance.resourceTypeVariant(RI, RTV);
- * neg find taskNeedsVariant(_, RTV);
- * }
- * </pre></code>
- *
- * @see UnrequiredResourceInstanceMatch
- * @see UnrequiredResourceInstanceProcessor
- * @see UnrequiredResourceInstanceQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class UnrequiredResourceInstanceMatcher extends BaseMatcher<UnrequiredResourceInstanceMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static UnrequiredResourceInstanceMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- UnrequiredResourceInstanceMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (UnrequiredResourceInstanceMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static UnrequiredResourceInstanceMatcher create() throws ViatraQueryException {
- return new UnrequiredResourceInstanceMatcher();
- }
-
- private final static int POSITION_RI = 0;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(UnrequiredResourceInstanceMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private UnrequiredResourceInstanceMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @return matches represented as a UnrequiredResourceInstanceMatch object.
- *
- */
- public Collection<UnrequiredResourceInstanceMatch> getAllMatches(final ResourceInstance pRI) {
- return rawGetAllMatches(new Object[]{pRI});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @return a match represented as a UnrequiredResourceInstanceMatch object, or null if no match is found.
- *
- */
- public UnrequiredResourceInstanceMatch getOneArbitraryMatch(final ResourceInstance pRI) {
- return rawGetOneArbitraryMatch(new Object[]{pRI});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final ResourceInstance pRI) {
- return rawHasMatch(new Object[]{pRI});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final ResourceInstance pRI) {
- return rawCountMatches(new Object[]{pRI});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final ResourceInstance pRI, final IMatchProcessor<? super UnrequiredResourceInstanceMatch> processor) {
- rawForEachMatch(new Object[]{pRI}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final ResourceInstance pRI, final IMatchProcessor<? super UnrequiredResourceInstanceMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pRI}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pRI the fixed value of pattern parameter RI, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public UnrequiredResourceInstanceMatch newMatch(final ResourceInstance pRI) {
- return UnrequiredResourceInstanceMatch.newMatch(pRI);
- }
-
- /**
- * Retrieve the set of values that occur in matches for RI.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<ResourceInstance> rawAccumulateAllValuesOfRI(final Object[] parameters) {
- Set<ResourceInstance> results = new HashSet<ResourceInstance>();
- rawAccumulateAllValues(POSITION_RI, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for RI.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceInstance> getAllValuesOfRI() {
- return rawAccumulateAllValuesOfRI(emptyArray());
- }
-
- @Override
- protected UnrequiredResourceInstanceMatch tupleToMatch(final Tuple t) {
- try {
- return UnrequiredResourceInstanceMatch.newMatch((ResourceInstance) t.get(POSITION_RI));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected UnrequiredResourceInstanceMatch arrayToMatch(final Object[] match) {
- try {
- return UnrequiredResourceInstanceMatch.newMatch((ResourceInstance) match[POSITION_RI]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected UnrequiredResourceInstanceMatch arrayToMatchMutable(final Object[] match) {
- try {
- return UnrequiredResourceInstanceMatch.newMutableMatch((ResourceInstance) match[POSITION_RI]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<UnrequiredResourceInstanceMatcher> querySpecification() throws ViatraQueryException {
- return UnrequiredResourceInstanceQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/VariantAllocatedToTaskMatch.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/VariantAllocatedToTaskMatch.java
deleted file mode 100644
index f1e739e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/VariantAllocatedToTaskMatch.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.VariantAllocatedToTaskQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-
-/**
- * Pattern-specific match representation of the org.eclipse.viatra.dse.examples.bpmn.patterns.variantAllocatedToTask pattern,
- * to be used in conjunction with {@link VariantAllocatedToTaskMatcher}.
- *
- * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
- * Each instance is a (possibly partial) substitution of pattern parameters,
- * usable to represent a match of the pattern in the result of a query,
- * or to specify the bound (fixed) input parameters when issuing a query.
- *
- * @see VariantAllocatedToTaskMatcher
- * @see VariantAllocatedToTaskProcessor
- *
- */
-@SuppressWarnings("all")
-public abstract class VariantAllocatedToTaskMatch extends BasePatternMatch {
- private Task fT;
-
- private ResourceTypeVariant fRTV;
-
- private static List<String> parameterNames = makeImmutableList("T", "RTV");
-
- private VariantAllocatedToTaskMatch(final Task pT, final ResourceTypeVariant pRTV) {
- this.fT = pT;
- this.fRTV = pRTV;
- }
-
- @Override
- public Object get(final String parameterName) {
- if ("T".equals(parameterName)) return this.fT;
- if ("RTV".equals(parameterName)) return this.fRTV;
- return null;
- }
-
- public Task getT() {
- return this.fT;
- }
-
- public ResourceTypeVariant getRTV() {
- return this.fRTV;
- }
-
- @Override
- public boolean set(final String parameterName, final Object newValue) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- if ("T".equals(parameterName) ) {
- this.fT = (Task) newValue;
- return true;
- }
- if ("RTV".equals(parameterName) ) {
- this.fRTV = (ResourceTypeVariant) newValue;
- return true;
- }
- return false;
- }
-
- public void setT(final Task pT) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fT = pT;
- }
-
- public void setRTV(final ResourceTypeVariant pRTV) {
- if (!isMutable()) throw new java.lang.UnsupportedOperationException();
- this.fRTV = pRTV;
- }
-
- @Override
- public String patternName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.variantAllocatedToTask";
- }
-
- @Override
- public List<String> parameterNames() {
- return VariantAllocatedToTaskMatch.parameterNames;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[]{fT, fRTV};
- }
-
- @Override
- public VariantAllocatedToTaskMatch toImmutable() {
- return isMutable() ? newMatch(fT, fRTV) : this;
- }
-
- @Override
- public String prettyPrint() {
- StringBuilder result = new StringBuilder();
- result.append("\"T\"=" + prettyPrintValue(fT) + ", ");
-
- result.append("\"RTV\"=" + prettyPrintValue(fRTV)
- );
- return result.toString();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fT == null) ? 0 : fT.hashCode());
- result = prime * result + ((fRTV == null) ? 0 : fRTV.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof VariantAllocatedToTaskMatch)) { // this should be infrequent
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof IPatternMatch)) {
- return false;
- }
- IPatternMatch otherSig = (IPatternMatch) obj;
- if (!specification().equals(otherSig.specification()))
- return false;
- return Arrays.deepEquals(toArray(), otherSig.toArray());
- }
- VariantAllocatedToTaskMatch other = (VariantAllocatedToTaskMatch) obj;
- if (fT == null) {if (other.fT != null) return false;}
- else if (!fT.equals(other.fT)) return false;
- if (fRTV == null) {if (other.fRTV != null) return false;}
- else if (!fRTV.equals(other.fRTV)) return false;
- return true;
- }
-
- @Override
- public VariantAllocatedToTaskQuerySpecification specification() {
- try {
- return VariantAllocatedToTaskQuerySpecification.instance();
- } catch (ViatraQueryException ex) {
- // This cannot happen, as the match object can only be instantiated if the query specification exists
- throw new IllegalStateException (ex);
- }
- }
-
- /**
- * Returns an empty, mutable match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @return the empty match.
- *
- */
- public static VariantAllocatedToTaskMatch newEmptyMatch() {
- return new Mutable(null, null);
- }
-
- /**
- * Returns a mutable (partial) match.
- * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
- *
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the new, mutable (partial) match object.
- *
- */
- public static VariantAllocatedToTaskMatch newMutableMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return new Mutable(pT, pRTV);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public static VariantAllocatedToTaskMatch newMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return new Immutable(pT, pRTV);
- }
-
- private static final class Mutable extends VariantAllocatedToTaskMatch {
- Mutable(final Task pT, final ResourceTypeVariant pRTV) {
- super(pT, pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return true;
- }
- }
-
- private static final class Immutable extends VariantAllocatedToTaskMatch {
- Immutable(final Task pT, final ResourceTypeVariant pRTV) {
- super(pT, pRTV);
- }
-
- @Override
- public boolean isMutable() {
- return false;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/VariantAllocatedToTaskMatcher.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/VariantAllocatedToTaskMatcher.java
deleted file mode 100644
index ca024ce..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/VariantAllocatedToTaskMatcher.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.log4j.Logger;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.VariantAllocatedToTaskMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.VariantAllocatedToTaskQuerySpecification;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
-import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
-
-/**
- * Generated pattern matcher API of the org.eclipse.viatra.dse.examples.bpmn.patterns.variantAllocatedToTask pattern,
- * providing pattern-specific query methods.
- *
- * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
- * e.g. in conjunction with {@link ViatraQueryEngine#on(Notifier)}.
- *
- * <p>Matches of the pattern will be represented as {@link VariantAllocatedToTaskMatch}.
- *
- * <p>Original source:
- * <code><pre>
- * pattern variantAllocatedToTask(T : Task, RTV : ResourceTypeVariant) {
- * Task.variant(T, RTV);
- * }
- * </pre></code>
- *
- * @see VariantAllocatedToTaskMatch
- * @see VariantAllocatedToTaskProcessor
- * @see VariantAllocatedToTaskQuerySpecification
- *
- */
-@SuppressWarnings("all")
-public class VariantAllocatedToTaskMatcher extends BaseMatcher<VariantAllocatedToTaskMatch> {
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static VariantAllocatedToTaskMatcher on(final ViatraQueryEngine engine) throws ViatraQueryException {
- // check if matcher already exists
- VariantAllocatedToTaskMatcher matcher = engine.getExistingMatcher(querySpecification());
- if (matcher == null) {
- matcher = (VariantAllocatedToTaskMatcher)engine.getMatcher(querySpecification());
- }
- return matcher;
- }
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- public static VariantAllocatedToTaskMatcher create() throws ViatraQueryException {
- return new VariantAllocatedToTaskMatcher();
- }
-
- private final static int POSITION_T = 0;
-
- private final static int POSITION_RTV = 1;
-
- private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(VariantAllocatedToTaskMatcher.class);
-
- /**
- * Initializes the pattern matcher within an existing VIATRA Query engine.
- * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
- * The match set will be incrementally refreshed upon updates.
- * @param engine the existing VIATRA Query engine in which this matcher will be created.
- * @throws ViatraQueryException if an error occurs during pattern matcher creation
- *
- */
- private VariantAllocatedToTaskMatcher() throws ViatraQueryException {
- super(querySpecification());
- }
-
- /**
- * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return matches represented as a VariantAllocatedToTaskMatch object.
- *
- */
- public Collection<VariantAllocatedToTaskMatch> getAllMatches(final Task pT, final ResourceTypeVariant pRTV) {
- return rawGetAllMatches(new Object[]{pT, pRTV});
- }
-
- /**
- * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return a match represented as a VariantAllocatedToTaskMatch object, or null if no match is found.
- *
- */
- public VariantAllocatedToTaskMatch getOneArbitraryMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return rawGetOneArbitraryMatch(new Object[]{pT, pRTV});
- }
-
- /**
- * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
- * under any possible substitution of the unspecified parameters (if any).
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return true if the input is a valid (partial) match of the pattern.
- *
- */
- public boolean hasMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return rawHasMatch(new Object[]{pT, pRTV});
- }
-
- /**
- * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the number of pattern matches found.
- *
- */
- public int countMatches(final Task pT, final ResourceTypeVariant pRTV) {
- return rawCountMatches(new Object[]{pT, pRTV});
- }
-
- /**
- * Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process each pattern match.
- *
- */
- public void forEachMatch(final Task pT, final ResourceTypeVariant pRTV, final IMatchProcessor<? super VariantAllocatedToTaskMatch> processor) {
- rawForEachMatch(new Object[]{pT, pRTV}, processor);
- }
-
- /**
- * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
- * Neither determinism nor randomness of selection is guaranteed.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @param processor the action that will process the selected match.
- * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
- *
- */
- public boolean forOneArbitraryMatch(final Task pT, final ResourceTypeVariant pRTV, final IMatchProcessor<? super VariantAllocatedToTaskMatch> processor) {
- return rawForOneArbitraryMatch(new Object[]{pT, pRTV}, processor);
- }
-
- /**
- * Returns a new (partial) match.
- * This can be used e.g. to call the matcher with a partial match.
- * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
- * @param pT the fixed value of pattern parameter T, or null if not bound.
- * @param pRTV the fixed value of pattern parameter RTV, or null if not bound.
- * @return the (partial) match object.
- *
- */
- public VariantAllocatedToTaskMatch newMatch(final Task pT, final ResourceTypeVariant pRTV) {
- return VariantAllocatedToTaskMatch.newMatch(pT, pRTV);
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<Task> rawAccumulateAllValuesOfT(final Object[] parameters) {
- Set<Task> results = new HashSet<Task>();
- rawAccumulateAllValues(POSITION_T, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT() {
- return rawAccumulateAllValuesOfT(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT(final VariantAllocatedToTaskMatch partialMatch) {
- return rawAccumulateAllValuesOfT(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for T.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<Task> getAllValuesOfT(final ResourceTypeVariant pRTV) {
- return rawAccumulateAllValuesOfT(new Object[]{
- null,
- pRTV
- });
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- protected Set<ResourceTypeVariant> rawAccumulateAllValuesOfRTV(final Object[] parameters) {
- Set<ResourceTypeVariant> results = new HashSet<ResourceTypeVariant>();
- rawAccumulateAllValues(POSITION_RTV, parameters, results);
- return results;
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV() {
- return rawAccumulateAllValuesOfRTV(emptyArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV(final VariantAllocatedToTaskMatch partialMatch) {
- return rawAccumulateAllValuesOfRTV(partialMatch.toArray());
- }
-
- /**
- * Retrieve the set of values that occur in matches for RTV.
- * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
- *
- */
- public Set<ResourceTypeVariant> getAllValuesOfRTV(final Task pT) {
- return rawAccumulateAllValuesOfRTV(new Object[]{
- pT,
- null
- });
- }
-
- @Override
- protected VariantAllocatedToTaskMatch tupleToMatch(final Tuple t) {
- try {
- return VariantAllocatedToTaskMatch.newMatch((Task) t.get(POSITION_T), (ResourceTypeVariant) t.get(POSITION_RTV));
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in tuple not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected VariantAllocatedToTaskMatch arrayToMatch(final Object[] match) {
- try {
- return VariantAllocatedToTaskMatch.newMatch((Task) match[POSITION_T], (ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- @Override
- protected VariantAllocatedToTaskMatch arrayToMatchMutable(final Object[] match) {
- try {
- return VariantAllocatedToTaskMatch.newMutableMatch((Task) match[POSITION_T], (ResourceTypeVariant) match[POSITION_RTV]);
- } catch(ClassCastException e) {
- LOGGER.error("Element(s) in array not properly typed!",e);
- return null;
- }
- }
-
- /**
- * @return the singleton instance of the query specification of this pattern
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static IQuerySpecification<VariantAllocatedToTaskMatcher> querySpecification() throws ViatraQueryException {
- return VariantAllocatedToTaskQuerySpecification.instance();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/.gitignore b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/.gitignore
deleted file mode 100644
index 4a5335e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*._trace
\ No newline at end of file
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AbsenceOfResourceInstancesProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AbsenceOfResourceInstancesProcessor.java
deleted file mode 100644
index a8695a3..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AbsenceOfResourceInstancesProcessor.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AbsenceOfResourceInstancesMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.absenceOfResourceInstances pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class AbsenceOfResourceInstancesProcessor implements IMatchProcessor<AbsenceOfResourceInstancesMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pRTV the value of pattern parameter RTV in the currently processed match
- *
- */
- public abstract void process(final ResourceTypeVariant pRTV);
-
- @Override
- public void process(final AbsenceOfResourceInstancesMatch match) {
- process(match.getRTV());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AbsenceOfResourceInstancesQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AbsenceOfResourceInstancesQuerySpecification.java
deleted file mode 100644
index 38c68ae..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AbsenceOfResourceInstancesQuerySpecification.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AbsenceOfResourceInstancesMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AbsenceOfResourceInstancesMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.InstanceOfVariantQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate AbsenceOfResourceInstancesMatcher in a type-safe way.
- *
- * @see AbsenceOfResourceInstancesMatcher
- * @see AbsenceOfResourceInstancesMatch
- *
- */
-@SuppressWarnings("all")
-public final class AbsenceOfResourceInstancesQuerySpecification extends BaseGeneratedEMFQuerySpecification<AbsenceOfResourceInstancesMatcher> {
- private AbsenceOfResourceInstancesQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static AbsenceOfResourceInstancesQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected AbsenceOfResourceInstancesMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return AbsenceOfResourceInstancesMatcher.on(engine);
- }
-
- @Override
- public AbsenceOfResourceInstancesMatcher instantiate() throws ViatraQueryException {
- return AbsenceOfResourceInstancesMatcher.create();
- }
-
- @Override
- public AbsenceOfResourceInstancesMatch newEmptyMatch() {
- return AbsenceOfResourceInstancesMatch.newEmptyMatch();
- }
-
- @Override
- public AbsenceOfResourceInstancesMatch newMatch(final Object... parameters) {
- return AbsenceOfResourceInstancesMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link AbsenceOfResourceInstancesQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link AbsenceOfResourceInstancesQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static AbsenceOfResourceInstancesQuerySpecification INSTANCE = new AbsenceOfResourceInstancesQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static AbsenceOfResourceInstancesQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pRTV = new PParameter("RTV", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pRTV);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.absenceOfResourceInstances";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("RTV");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_RTV = body.getOrCreateVariableByName("RTV");
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
- new TypeConstraint(body, new FlatTuple(var_RTV), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_RTV, parameter_pRTV)
- ));
- // neg find instanceOfVariant(_, RTV)
- new NegativePatternCall(body, new FlatTuple(var___0_, var_RTV), InstanceOfVariantQuerySpecification.instance().getInternalQueryRepresentation());
- // Task.variant(_, RTV)
- new TypeConstraint(body, new FlatTuple(var___1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var___1_, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task", "variant")));
- new Equality(body, var__virtual_0_, var_RTV);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AllocateTaskToVariantProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AllocateTaskToVariantProcessor.java
deleted file mode 100644
index 90085e5..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AllocateTaskToVariantProcessor.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AllocateTaskToVariantMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.allocateTaskToVariant pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class AllocateTaskToVariantProcessor implements IMatchProcessor<AllocateTaskToVariantMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pT the value of pattern parameter T in the currently processed match
- * @param pRTV the value of pattern parameter RTV in the currently processed match
- *
- */
- public abstract void process(final Task pT, final ResourceTypeVariant pRTV);
-
- @Override
- public void process(final AllocateTaskToVariantMatch match) {
- process(match.getT(), match.getRTV());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AllocateTaskToVariantQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AllocateTaskToVariantQuerySpecification.java
deleted file mode 100644
index 2b1db9a..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/AllocateTaskToVariantQuerySpecification.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AllocateTaskToVariantMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.AllocateTaskToVariantMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.VariantAllocatedToTaskQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate AllocateTaskToVariantMatcher in a type-safe way.
- *
- * @see AllocateTaskToVariantMatcher
- * @see AllocateTaskToVariantMatch
- *
- */
-@SuppressWarnings("all")
-public final class AllocateTaskToVariantQuerySpecification extends BaseGeneratedEMFQuerySpecification<AllocateTaskToVariantMatcher> {
- private AllocateTaskToVariantQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static AllocateTaskToVariantQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected AllocateTaskToVariantMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return AllocateTaskToVariantMatcher.on(engine);
- }
-
- @Override
- public AllocateTaskToVariantMatcher instantiate() throws ViatraQueryException {
- return AllocateTaskToVariantMatcher.create();
- }
-
- @Override
- public AllocateTaskToVariantMatch newEmptyMatch() {
- return AllocateTaskToVariantMatch.newEmptyMatch();
- }
-
- @Override
- public AllocateTaskToVariantMatch newMatch(final Object... parameters) {
- return AllocateTaskToVariantMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[0], (org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant) parameters[1]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link AllocateTaskToVariantQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link AllocateTaskToVariantQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static AllocateTaskToVariantQuerySpecification INSTANCE = new AllocateTaskToVariantQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static AllocateTaskToVariantQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pT = new PParameter("T", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pRTV = new PParameter("RTV", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pT, parameter_pRTV);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.allocateTaskToVariant";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("T","RTV");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_T = body.getOrCreateVariableByName("T");
- PVariable var_RTV = body.getOrCreateVariableByName("RTV");
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- PVariable var_RT = body.getOrCreateVariableByName("RT");
- new TypeConstraint(body, new FlatTuple(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_RTV), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_T, parameter_pT),
- new ExportedParameter(body, var_RTV, parameter_pRTV)
- ));
- // neg find variantAllocatedToTask(T, _)
- new NegativePatternCall(body, new FlatTuple(var_T, var___0_), VariantAllocatedToTaskQuerySpecification.instance().getInternalQueryRepresentation());
- // Task.resourceNeeded(T, RT)
- new TypeConstraint(body, new FlatTuple(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task", "resourceNeeded")));
- new Equality(body, var__virtual_0_, var_RT);
- // ResourceType.variants(RT, RTV)
- new TypeConstraint(body, new FlatTuple(var_RT), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceType")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, new FlatTuple(var_RT, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceType", "variants")));
- new Equality(body, var__virtual_1_, var_RTV);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/CreateResourceProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/CreateResourceProcessor.java
deleted file mode 100644
index f404203..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/CreateResourceProcessor.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.CreateResourceMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.createResource pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class CreateResourceProcessor implements IMatchProcessor<CreateResourceMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pRTV the value of pattern parameter RTV in the currently processed match
- *
- */
- public abstract void process(final ResourceTypeVariant pRTV);
-
- @Override
- public void process(final CreateResourceMatch match) {
- process(match.getRTV());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/CreateResourceQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/CreateResourceQuerySpecification.java
deleted file mode 100644
index ce303ef..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/CreateResourceQuerySpecification.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.CreateResourceMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.CreateResourceMatcher;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate CreateResourceMatcher in a type-safe way.
- *
- * @see CreateResourceMatcher
- * @see CreateResourceMatch
- *
- */
-@SuppressWarnings("all")
-public final class CreateResourceQuerySpecification extends BaseGeneratedEMFQuerySpecification<CreateResourceMatcher> {
- private CreateResourceQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static CreateResourceQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected CreateResourceMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return CreateResourceMatcher.on(engine);
- }
-
- @Override
- public CreateResourceMatcher instantiate() throws ViatraQueryException {
- return CreateResourceMatcher.create();
- }
-
- @Override
- public CreateResourceMatch newEmptyMatch() {
- return CreateResourceMatch.newEmptyMatch();
- }
-
- @Override
- public CreateResourceMatch newMatch(final Object... parameters) {
- return CreateResourceMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link CreateResourceQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link CreateResourceQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static CreateResourceQuerySpecification INSTANCE = new CreateResourceQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static CreateResourceQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pRTV = new PParameter("RTV", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pRTV);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.createResource";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("RTV");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_RTV = body.getOrCreateVariableByName("RTV");
- new TypeConstraint(body, new FlatTuple(var_RTV), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_RTV, parameter_pRTV)
- ));
- // ResourceTypeVariant(RTV)
- new TypeConstraint(body, new FlatTuple(var_RTV), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")));
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EnoughResourceInstancesProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EnoughResourceInstancesProcessor.java
deleted file mode 100644
index 371169a..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EnoughResourceInstancesProcessor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EnoughResourceInstancesMatch;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.enoughResourceInstances pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class EnoughResourceInstancesProcessor implements IMatchProcessor<EnoughResourceInstancesMatch> {
- /**
- * Defines the action that is to be executed on each match.
- *
- */
- public abstract void process();
-
- @Override
- public void process(final EnoughResourceInstancesMatch match) {
- process();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EnoughResourceInstancesQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EnoughResourceInstancesQuerySpecification.java
deleted file mode 100644
index f013355..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EnoughResourceInstancesQuerySpecification.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EnoughResourceInstancesMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EnoughResourceInstancesMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.AbsenceOfResourceInstancesQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate EnoughResourceInstancesMatcher in a type-safe way.
- *
- * @see EnoughResourceInstancesMatcher
- * @see EnoughResourceInstancesMatch
- *
- */
-@SuppressWarnings("all")
-public final class EnoughResourceInstancesQuerySpecification extends BaseGeneratedEMFQuerySpecification<EnoughResourceInstancesMatcher> {
- private EnoughResourceInstancesQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static EnoughResourceInstancesQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected EnoughResourceInstancesMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return EnoughResourceInstancesMatcher.on(engine);
- }
-
- @Override
- public EnoughResourceInstancesMatcher instantiate() throws ViatraQueryException {
- return EnoughResourceInstancesMatcher.create();
- }
-
- @Override
- public EnoughResourceInstancesMatch newEmptyMatch() {
- return EnoughResourceInstancesMatch.newEmptyMatch();
- }
-
- @Override
- public EnoughResourceInstancesMatch newMatch(final Object... parameters) {
- return EnoughResourceInstancesMatch.newMatch();
- }
-
- /**
- * Inner class allowing the singleton instance of {@link EnoughResourceInstancesQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link EnoughResourceInstancesQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static EnoughResourceInstancesQuerySpecification INSTANCE = new EnoughResourceInstancesQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static EnoughResourceInstancesQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final List<PParameter> parameters = Arrays.asList();
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.enoughResourceInstances";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList();
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- ));
- // neg find absenceOfResourceInstances(_)
- new NegativePatternCall(body, new FlatTuple(var___0_), AbsenceOfResourceInstancesQuerySpecification.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EveryTaskHasVariantProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EveryTaskHasVariantProcessor.java
deleted file mode 100644
index 02e3f98..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EveryTaskHasVariantProcessor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EveryTaskHasVariantMatch;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.everyTaskHasVariant pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class EveryTaskHasVariantProcessor implements IMatchProcessor<EveryTaskHasVariantMatch> {
- /**
- * Defines the action that is to be executed on each match.
- *
- */
- public abstract void process();
-
- @Override
- public void process(final EveryTaskHasVariantMatch match) {
- process();
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EveryTaskHasVariantQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EveryTaskHasVariantQuerySpecification.java
deleted file mode 100644
index d620c32..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/EveryTaskHasVariantQuerySpecification.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EveryTaskHasVariantMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.EveryTaskHasVariantMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.UnassignedTaskQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate EveryTaskHasVariantMatcher in a type-safe way.
- *
- * @see EveryTaskHasVariantMatcher
- * @see EveryTaskHasVariantMatch
- *
- */
-@SuppressWarnings("all")
-public final class EveryTaskHasVariantQuerySpecification extends BaseGeneratedEMFQuerySpecification<EveryTaskHasVariantMatcher> {
- private EveryTaskHasVariantQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static EveryTaskHasVariantQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected EveryTaskHasVariantMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return EveryTaskHasVariantMatcher.on(engine);
- }
-
- @Override
- public EveryTaskHasVariantMatcher instantiate() throws ViatraQueryException {
- return EveryTaskHasVariantMatcher.create();
- }
-
- @Override
- public EveryTaskHasVariantMatch newEmptyMatch() {
- return EveryTaskHasVariantMatch.newEmptyMatch();
- }
-
- @Override
- public EveryTaskHasVariantMatch newMatch(final Object... parameters) {
- return EveryTaskHasVariantMatch.newMatch();
- }
-
- /**
- * Inner class allowing the singleton instance of {@link EveryTaskHasVariantQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link EveryTaskHasVariantQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static EveryTaskHasVariantQuerySpecification INSTANCE = new EveryTaskHasVariantQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static EveryTaskHasVariantQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final List<PParameter> parameters = Arrays.asList();
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.everyTaskHasVariant";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList();
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- ));
- // neg find unassignedTask(_)
- new NegativePatternCall(body, new FlatTuple(var___0_), UnassignedTaskQuerySpecification.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InFlowQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InFlowQuerySpecification.java
deleted file mode 100644
index e2238ed..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InFlowQuerySpecification.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate InFlowMatcher in a type-safe way.
- *
- * @see InFlowMatcher
- * @see InFlowMatch
- *
- */
-@SuppressWarnings("all")
-final class InFlowQuerySpecification extends BaseGeneratedEMFQuerySpecification<ViatraQueryMatcher<IPatternMatch>> {
- private InFlowQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static InFlowQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected ViatraQueryMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ViatraQueryMatcher instantiate() throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newEmptyMatch() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newMatch(final Object... parameters) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Inner class allowing the singleton instance of {@link InFlowQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link InFlowQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static InFlowQuerySpecification INSTANCE = new InFlowQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static InFlowQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pElement = new PParameter("Element", "org.eclipse.viatra.dse.examples.simplifiedbpmn.BaseElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "BaseElement")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pFlow = new PParameter("Flow", "org.eclipse.viatra.dse.examples.simplifiedbpmn.SequenceFlow", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pElement, parameter_pFlow);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.inFlow";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("Element","Flow");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_Element = body.getOrCreateVariableByName("Element");
- PVariable var_Flow = body.getOrCreateVariableByName("Flow");
- new TypeConstraint(body, new FlatTuple(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement")));
- new TypeConstraint(body, new FlatTuple(var_Flow), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_Element, parameter_pElement),
- new ExportedParameter(body, var_Flow, parameter_pFlow)
- ));
- // BaseElement.inFlows(Element, Flow)
- new TypeConstraint(body, new FlatTuple(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_Element, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "inFlows")));
- new Equality(body, var__virtual_0_, var_Flow);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InstanceOfVariantProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InstanceOfVariantProcessor.java
deleted file mode 100644
index 9296f17..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InstanceOfVariantProcessor.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.InstanceOfVariantMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.instanceOfVariant pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class InstanceOfVariantProcessor implements IMatchProcessor<InstanceOfVariantMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pRI the value of pattern parameter RI in the currently processed match
- * @param pRTV the value of pattern parameter RTV in the currently processed match
- *
- */
- public abstract void process(final ResourceInstance pRI, final ResourceTypeVariant pRTV);
-
- @Override
- public void process(final InstanceOfVariantMatch match) {
- process(match.getRI(), match.getRTV());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InstanceOfVariantQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InstanceOfVariantQuerySpecification.java
deleted file mode 100644
index 4fcd88b..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/InstanceOfVariantQuerySpecification.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.InstanceOfVariantMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.InstanceOfVariantMatcher;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate InstanceOfVariantMatcher in a type-safe way.
- *
- * @see InstanceOfVariantMatcher
- * @see InstanceOfVariantMatch
- *
- */
-@SuppressWarnings("all")
-public final class InstanceOfVariantQuerySpecification extends BaseGeneratedEMFQuerySpecification<InstanceOfVariantMatcher> {
- private InstanceOfVariantQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static InstanceOfVariantQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected InstanceOfVariantMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return InstanceOfVariantMatcher.on(engine);
- }
-
- @Override
- public InstanceOfVariantMatcher instantiate() throws ViatraQueryException {
- return InstanceOfVariantMatcher.create();
- }
-
- @Override
- public InstanceOfVariantMatch newEmptyMatch() {
- return InstanceOfVariantMatch.newEmptyMatch();
- }
-
- @Override
- public InstanceOfVariantMatch newMatch(final Object... parameters) {
- return InstanceOfVariantMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance) parameters[0], (org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant) parameters[1]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link InstanceOfVariantQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link InstanceOfVariantQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static InstanceOfVariantQuerySpecification INSTANCE = new InstanceOfVariantQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static InstanceOfVariantQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pRI = new PParameter("RI", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pRTV = new PParameter("RTV", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pRI, parameter_pRTV);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.instanceOfVariant";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("RI","RTV");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_RI = body.getOrCreateVariableByName("RI");
- PVariable var_RTV = body.getOrCreateVariableByName("RTV");
- new TypeConstraint(body, new FlatTuple(var_RI), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance")));
- new TypeConstraint(body, new FlatTuple(var_RTV), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_RI, parameter_pRI),
- new ExportedParameter(body, var_RTV, parameter_pRTV)
- ));
- // ResourceInstance.resourceTypeVariant(RI, RTV)
- new TypeConstraint(body, new FlatTuple(var_RI), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_RI, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance", "resourceTypeVariant")));
- new Equality(body, var__virtual_0_, var_RTV);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeParallelProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeParallelProcessor.java
deleted file mode 100644
index 2efaa1f..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeParallelProcessor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeParallelMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.makeParallel pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class MakeParallelProcessor implements IMatchProcessor<MakeParallelMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pT1 the value of pattern parameter T1 in the currently processed match
- * @param pT2 the value of pattern parameter T2 in the currently processed match
- * @param pRoot the value of pattern parameter Root in the currently processed match
- *
- */
- public abstract void process(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot);
-
- @Override
- public void process(final MakeParallelMatch match) {
- process(match.getT1(), match.getT2(), match.getRoot());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeParallelQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeParallelQuerySpecification.java
deleted file mode 100644
index eae3e2e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeParallelQuerySpecification.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeParallelMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeParallelMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.InFlowQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.OutFlowQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.TaskOrderQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate MakeParallelMatcher in a type-safe way.
- *
- * @see MakeParallelMatcher
- * @see MakeParallelMatch
- *
- */
-@SuppressWarnings("all")
-public final class MakeParallelQuerySpecification extends BaseGeneratedEMFQuerySpecification<MakeParallelMatcher> {
- private MakeParallelQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static MakeParallelQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected MakeParallelMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return MakeParallelMatcher.on(engine);
- }
-
- @Override
- public MakeParallelMatcher instantiate() throws ViatraQueryException {
- return MakeParallelMatcher.create();
- }
-
- @Override
- public MakeParallelMatch newEmptyMatch() {
- return MakeParallelMatch.newEmptyMatch();
- }
-
- @Override
- public MakeParallelMatch newMatch(final Object... parameters) {
- return MakeParallelMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[0], (org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[1], (org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN) parameters[2]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link MakeParallelQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link MakeParallelQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static MakeParallelQuerySpecification INSTANCE = new MakeParallelQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static MakeParallelQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pT1 = new PParameter("T1", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pT2 = new PParameter("T2", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pRoot = new PParameter("Root", "org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "SimplifiedBPMN")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pT1, parameter_pT2, parameter_pRoot);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.makeParallel";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("T1","T2","Root");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_T1 = body.getOrCreateVariableByName("T1");
- PVariable var_T2 = body.getOrCreateVariableByName("T2");
- PVariable var_Root = body.getOrCreateVariableByName("Root");
- PVariable var_outflow = body.getOrCreateVariableByName("outflow");
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
- new TypeConstraint(body, new FlatTuple(var_T1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_T2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_Root), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SimplifiedBPMN")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_T1, parameter_pT1),
- new ExportedParameter(body, var_T2, parameter_pT2),
- new ExportedParameter(body, var_Root, parameter_pRoot)
- ));
- // SimplifiedBPMN(Root)
- new TypeConstraint(body, new FlatTuple(var_Root), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SimplifiedBPMN")));
- // Task.outFlows(T1, outflow)
- new TypeConstraint(body, new FlatTuple(var_T1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_T1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "outFlows")));
- new Equality(body, var__virtual_0_, var_outflow);
- // SequenceFlow.isDataFlow(outflow, false)
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new ConstantValue(body, var__virtual_1_, false);
- new TypeConstraint(body, new FlatTuple(var_outflow), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")));
- PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
- new TypeConstraint(body, new FlatTuple(var_outflow, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow", "isDataFlow")));
- new Equality(body, var__virtual_2_, var__virtual_1_);
- // SequenceFlow.target(outflow, T2)
- new TypeConstraint(body, new FlatTuple(var_outflow), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")));
- PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
- new TypeConstraint(body, new FlatTuple(var_outflow, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow", "target")));
- new Equality(body, var__virtual_3_, var_T2);
- // T1 != T2
- new Inequality(body, var_T1, var_T2);
- // find taskOrder(T1,T2)
- new PositivePatternCall(body, new FlatTuple(var_T1, var_T2), TaskOrderQuerySpecification.instance().getInternalQueryRepresentation());
- // 1 == count find inFlow(T2, _)
- PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}");
- new ConstantValue(body, var__virtual_4_, 1);
- PVariable var__virtual_5_ = body.getOrCreateVariableByName(".virtual{5}");
- new PatternMatchCounter(body, new FlatTuple(var_T2, var___0_), InFlowQuerySpecification.instance().getInternalQueryRepresentation(), var__virtual_5_);
- new Equality(body, var__virtual_4_, var__virtual_5_);
- // 1 == count find outFlow(T1, _)
- PVariable var__virtual_6_ = body.getOrCreateVariableByName(".virtual{6}");
- new ConstantValue(body, var__virtual_6_, 1);
- PVariable var__virtual_7_ = body.getOrCreateVariableByName(".virtual{7}");
- new PatternMatchCounter(body, new FlatTuple(var_T1, var___1_), OutFlowQuerySpecification.instance().getInternalQueryRepresentation(), var__virtual_7_);
- new Equality(body, var__virtual_6_, var__virtual_7_);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeSequentialProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeSequentialProcessor.java
deleted file mode 100644
index 61c092e..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeSequentialProcessor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeSequentialMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.makeSequential pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class MakeSequentialProcessor implements IMatchProcessor<MakeSequentialMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pT1 the value of pattern parameter T1 in the currently processed match
- * @param pT2 the value of pattern parameter T2 in the currently processed match
- * @param pRoot the value of pattern parameter Root in the currently processed match
- *
- */
- public abstract void process(final Task pT1, final Task pT2, final SimplifiedBPMN pRoot);
-
- @Override
- public void process(final MakeSequentialMatch match) {
- process(match.getT1(), match.getT2(), match.getRoot());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeSequentialQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeSequentialQuerySpecification.java
deleted file mode 100644
index 063e819..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/MakeSequentialQuerySpecification.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeSequentialMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.MakeSequentialMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.ParallelGatewayOutFlowQuerySpecification;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.TaskOrderQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate MakeSequentialMatcher in a type-safe way.
- *
- * @see MakeSequentialMatcher
- * @see MakeSequentialMatch
- *
- */
-@SuppressWarnings("all")
-public final class MakeSequentialQuerySpecification extends BaseGeneratedEMFQuerySpecification<MakeSequentialMatcher> {
- private MakeSequentialQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static MakeSequentialQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected MakeSequentialMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return MakeSequentialMatcher.on(engine);
- }
-
- @Override
- public MakeSequentialMatcher instantiate() throws ViatraQueryException {
- return MakeSequentialMatcher.create();
- }
-
- @Override
- public MakeSequentialMatch newEmptyMatch() {
- return MakeSequentialMatch.newEmptyMatch();
- }
-
- @Override
- public MakeSequentialMatch newMatch(final Object... parameters) {
- return MakeSequentialMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[0], (org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[1], (org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN) parameters[2]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link MakeSequentialQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link MakeSequentialQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static MakeSequentialQuerySpecification INSTANCE = new MakeSequentialQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static MakeSequentialQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pT1 = new PParameter("T1", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pT2 = new PParameter("T2", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pRoot = new PParameter("Root", "org.eclipse.viatra.dse.examples.simplifiedbpmn.SimplifiedBPMN", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "SimplifiedBPMN")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pT1, parameter_pT2, parameter_pRoot);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.makeSequential";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("T1","T2","Root");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_T1 = body.getOrCreateVariableByName("T1");
- PVariable var_T2 = body.getOrCreateVariableByName("T2");
- PVariable var_Root = body.getOrCreateVariableByName("Root");
- PVariable var_pg = body.getOrCreateVariableByName("pg");
- PVariable var_N = body.getOrCreateVariableByName("N");
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- PVariable var_pg2 = body.getOrCreateVariableByName("pg2");
- new TypeConstraint(body, new FlatTuple(var_T1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_T2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_Root), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SimplifiedBPMN")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_T1, parameter_pT1),
- new ExportedParameter(body, var_T2, parameter_pT2),
- new ExportedParameter(body, var_Root, parameter_pRoot)
- ));
- // SimplifiedBPMN(Root)
- new TypeConstraint(body, new FlatTuple(var_Root), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SimplifiedBPMN")));
- // ParallelGateway.outFlows.target(pg, T1)
- new TypeConstraint(body, new FlatTuple(var_pg), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ParallelGateway")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_pg, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "outFlows")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, new FlatTuple(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow", "target")));
- new Equality(body, var__virtual_1_, var_T1);
- // ParallelGateway.outFlows.target(pg, T2)
- new TypeConstraint(body, new FlatTuple(var_pg), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ParallelGateway")));
- PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
- new TypeConstraint(body, new FlatTuple(var_pg, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "outFlows")));
- PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
- new TypeConstraint(body, new FlatTuple(var__virtual_2_, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow", "target")));
- new Equality(body, var__virtual_3_, var_T2);
- // T1 != T2
- new Inequality(body, var_T1, var_T2);
- // find taskOrder(T1,T2)
- new PositivePatternCall(body, new FlatTuple(var_T1, var_T2), TaskOrderQuerySpecification.instance().getInternalQueryRepresentation());
- // N == count find parallelGatewayOutFlow(pg, _)
- PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}");
- new PatternMatchCounter(body, new FlatTuple(var_pg, var___0_), ParallelGatewayOutFlowQuerySpecification.instance().getInternalQueryRepresentation(), var__virtual_4_);
- new Equality(body, var_N, var__virtual_4_);
- // N == 2
- PVariable var__virtual_5_ = body.getOrCreateVariableByName(".virtual{5}");
- new ConstantValue(body, var__virtual_5_, 2);
- new Equality(body, var_N, var__virtual_5_);
- // Task.outFlows.target(T1, pg2)
- new TypeConstraint(body, new FlatTuple(var_T1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_6_ = body.getOrCreateVariableByName(".virtual{6}");
- new TypeConstraint(body, new FlatTuple(var_T1, var__virtual_6_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "outFlows")));
- PVariable var__virtual_7_ = body.getOrCreateVariableByName(".virtual{7}");
- new TypeConstraint(body, new FlatTuple(var__virtual_6_, var__virtual_7_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow", "target")));
- new Equality(body, var__virtual_7_, var_pg2);
- // Task.outFlows.target(T2, pg2)
- new TypeConstraint(body, new FlatTuple(var_T2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_8_ = body.getOrCreateVariableByName(".virtual{8}");
- new TypeConstraint(body, new FlatTuple(var_T2, var__virtual_8_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "outFlows")));
- PVariable var__virtual_9_ = body.getOrCreateVariableByName(".virtual{9}");
- new TypeConstraint(body, new FlatTuple(var__virtual_8_, var__virtual_9_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow", "target")));
- new Equality(body, var__virtual_9_, var_pg2);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/OutFlowQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/OutFlowQuerySpecification.java
deleted file mode 100644
index 8052081..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/OutFlowQuerySpecification.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate OutFlowMatcher in a type-safe way.
- *
- * @see OutFlowMatcher
- * @see OutFlowMatch
- *
- */
-@SuppressWarnings("all")
-final class OutFlowQuerySpecification extends BaseGeneratedEMFQuerySpecification<ViatraQueryMatcher<IPatternMatch>> {
- private OutFlowQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static OutFlowQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected ViatraQueryMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ViatraQueryMatcher instantiate() throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newEmptyMatch() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newMatch(final Object... parameters) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Inner class allowing the singleton instance of {@link OutFlowQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link OutFlowQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static OutFlowQuerySpecification INSTANCE = new OutFlowQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static OutFlowQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pElement = new PParameter("Element", "org.eclipse.viatra.dse.examples.simplifiedbpmn.BaseElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "BaseElement")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pFlow = new PParameter("Flow", "org.eclipse.viatra.dse.examples.simplifiedbpmn.SequenceFlow", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pElement, parameter_pFlow);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.outFlow";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("Element","Flow");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_Element = body.getOrCreateVariableByName("Element");
- PVariable var_Flow = body.getOrCreateVariableByName("Flow");
- new TypeConstraint(body, new FlatTuple(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement")));
- new TypeConstraint(body, new FlatTuple(var_Flow), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_Element, parameter_pElement),
- new ExportedParameter(body, var_Flow, parameter_pFlow)
- ));
- // BaseElement.outFlows(Element, Flow)
- new TypeConstraint(body, new FlatTuple(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_Element, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "outFlows")));
- new Equality(body, var__virtual_0_, var_Flow);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/ParallelGatewayOutFlowQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/ParallelGatewayOutFlowQuerySpecification.java
deleted file mode 100644
index 43d04f8..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/ParallelGatewayOutFlowQuerySpecification.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate ParallelGatewayOutFlowMatcher in a type-safe way.
- *
- * @see ParallelGatewayOutFlowMatcher
- * @see ParallelGatewayOutFlowMatch
- *
- */
-@SuppressWarnings("all")
-final class ParallelGatewayOutFlowQuerySpecification extends BaseGeneratedEMFQuerySpecification<ViatraQueryMatcher<IPatternMatch>> {
- private ParallelGatewayOutFlowQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static ParallelGatewayOutFlowQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected ViatraQueryMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ViatraQueryMatcher instantiate() throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newEmptyMatch() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newMatch(final Object... parameters) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Inner class allowing the singleton instance of {@link ParallelGatewayOutFlowQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link ParallelGatewayOutFlowQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static ParallelGatewayOutFlowQuerySpecification INSTANCE = new ParallelGatewayOutFlowQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static ParallelGatewayOutFlowQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pPG = new PParameter("PG", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ParallelGateway", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ParallelGateway")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pFlow = new PParameter("Flow", "org.eclipse.viatra.dse.examples.simplifiedbpmn.SequenceFlow", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pPG, parameter_pFlow);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.parallelGatewayOutFlow";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("PG","Flow");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_PG = body.getOrCreateVariableByName("PG");
- PVariable var_Flow = body.getOrCreateVariableByName("Flow");
- new TypeConstraint(body, new FlatTuple(var_PG), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ParallelGateway")));
- new TypeConstraint(body, new FlatTuple(var_Flow), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "SequenceFlow")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_PG, parameter_pPG),
- new ExportedParameter(body, var_Flow, parameter_pFlow)
- ));
- // ParallelGateway.outFlows(PG, Flow)
- new TypeConstraint(body, new FlatTuple(var_PG), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ParallelGateway")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_PG, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "BaseElement", "outFlows")));
- new Equality(body, var__virtual_0_, var_Flow);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskNeedsVariantQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskNeedsVariantQuerySpecification.java
deleted file mode 100644
index 998566a..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskNeedsVariantQuerySpecification.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.query.runtime.api.IPatternMatch;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate TaskNeedsVariantMatcher in a type-safe way.
- *
- * @see TaskNeedsVariantMatcher
- * @see TaskNeedsVariantMatch
- *
- */
-@SuppressWarnings("all")
-final class TaskNeedsVariantQuerySpecification extends BaseGeneratedEMFQuerySpecification<ViatraQueryMatcher<IPatternMatch>> {
- private TaskNeedsVariantQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static TaskNeedsVariantQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected ViatraQueryMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ViatraQueryMatcher instantiate() throws ViatraQueryException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newEmptyMatch() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IPatternMatch newMatch(final Object... parameters) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Inner class allowing the singleton instance of {@link TaskNeedsVariantQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link TaskNeedsVariantQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static TaskNeedsVariantQuerySpecification INSTANCE = new TaskNeedsVariantQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static TaskNeedsVariantQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pT = new PParameter("T", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pRTV = new PParameter("RTV", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pT, parameter_pRTV);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.taskNeedsVariant";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("T","RTV");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_T = body.getOrCreateVariableByName("T");
- PVariable var_RTV = body.getOrCreateVariableByName("RTV");
- new TypeConstraint(body, new FlatTuple(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_RTV), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_T, parameter_pT),
- new ExportedParameter(body, var_RTV, parameter_pRTV)
- ));
- // Task.variant(T, RTV)
- new TypeConstraint(body, new FlatTuple(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task", "variant")));
- new Equality(body, var__virtual_0_, var_RTV);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskOrderProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskOrderProcessor.java
deleted file mode 100644
index 2961906..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskOrderProcessor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.TaskOrderMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.taskOrder pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class TaskOrderProcessor implements IMatchProcessor<TaskOrderMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pT1 the value of pattern parameter T1 in the currently processed match
- * @param pT2 the value of pattern parameter T2 in the currently processed match
- *
- */
- public abstract void process(final Task pT1, final Task pT2);
-
- @Override
- public void process(final TaskOrderMatch match) {
- process(match.getT1(), match.getT2());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskOrderQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskOrderQuerySpecification.java
deleted file mode 100644
index 23a3cbb..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/TaskOrderQuerySpecification.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.TaskOrderMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.TaskOrderMatcher;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
-import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate TaskOrderMatcher in a type-safe way.
- *
- * @see TaskOrderMatcher
- * @see TaskOrderMatch
- *
- */
-@SuppressWarnings("all")
-public final class TaskOrderQuerySpecification extends BaseGeneratedEMFQuerySpecification<TaskOrderMatcher> {
- private TaskOrderQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static TaskOrderQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected TaskOrderMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return TaskOrderMatcher.on(engine);
- }
-
- @Override
- public TaskOrderMatcher instantiate() throws ViatraQueryException {
- return TaskOrderMatcher.create();
- }
-
- @Override
- public TaskOrderMatch newEmptyMatch() {
- return TaskOrderMatch.newEmptyMatch();
- }
-
- @Override
- public TaskOrderMatch newMatch(final Object... parameters) {
- return TaskOrderMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[0], (org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[1]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link TaskOrderQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link TaskOrderQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static TaskOrderQuerySpecification INSTANCE = new TaskOrderQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static TaskOrderQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pT1 = new PParameter("T1", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pT2 = new PParameter("T2", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pT1, parameter_pT2);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.taskOrder";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("T1","T2");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_T1 = body.getOrCreateVariableByName("T1");
- PVariable var_T2 = body.getOrCreateVariableByName("T2");
- PVariable var_name1 = body.getOrCreateVariableByName("name1");
- PVariable var_name2 = body.getOrCreateVariableByName("name2");
- new TypeConstraint(body, new FlatTuple(var_T1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_T2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_T1, parameter_pT1),
- new ExportedParameter(body, var_T2, parameter_pT2)
- ));
- // Task.name(T1,name1)
- new TypeConstraint(body, new FlatTuple(var_T1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_T1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "NamedElement", "name")));
- new Equality(body, var__virtual_0_, var_name1);
- // Task.name(T2,name2)
- new TypeConstraint(body, new FlatTuple(var_T2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
- new TypeConstraint(body, new FlatTuple(var_T2, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "NamedElement", "name")));
- new Equality(body, var__virtual_1_, var_name2);
- // check(name1 > name2)
- new ExpressionEvaluation(body, new IExpressionEvaluator() {
-
- @Override
- public String getShortDescription() {
- return "Expression evaluation from pattern taskOrder";
- }
-
- @Override
- public Iterable<String> getInputParameterNames() {
- return Arrays.asList("name1", "name2");}
-
- @Override
- public Object evaluateExpression(IValueProvider provider) throws Exception {
- String name1 = (String) provider.getValue("name1");
- String name2 = (String) provider.getValue("name2");
- return evaluateExpression_1_1(name1, name2);
- }
- }, null);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-
- private static boolean evaluateExpression_1_1(final String name1, final String name2) {
- boolean _greaterThan = (name1.compareTo(name2) > 0);
- return _greaterThan;
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnassignedTaskProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnassignedTaskProcessor.java
deleted file mode 100644
index 9c96e00..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnassignedTaskProcessor.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnassignedTaskMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.unassignedTask pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class UnassignedTaskProcessor implements IMatchProcessor<UnassignedTaskMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pT the value of pattern parameter T in the currently processed match
- *
- */
- public abstract void process(final Task pT);
-
- @Override
- public void process(final UnassignedTaskMatch match) {
- process(match.getT());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnassignedTaskQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnassignedTaskQuerySpecification.java
deleted file mode 100644
index c4d7ef5..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnassignedTaskQuerySpecification.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnassignedTaskMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnassignedTaskMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.VariantAllocatedToTaskQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate UnassignedTaskMatcher in a type-safe way.
- *
- * @see UnassignedTaskMatcher
- * @see UnassignedTaskMatch
- *
- */
-@SuppressWarnings("all")
-public final class UnassignedTaskQuerySpecification extends BaseGeneratedEMFQuerySpecification<UnassignedTaskMatcher> {
- private UnassignedTaskQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static UnassignedTaskQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected UnassignedTaskMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return UnassignedTaskMatcher.on(engine);
- }
-
- @Override
- public UnassignedTaskMatcher instantiate() throws ViatraQueryException {
- return UnassignedTaskMatcher.create();
- }
-
- @Override
- public UnassignedTaskMatch newEmptyMatch() {
- return UnassignedTaskMatch.newEmptyMatch();
- }
-
- @Override
- public UnassignedTaskMatch newMatch(final Object... parameters) {
- return UnassignedTaskMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link UnassignedTaskQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link UnassignedTaskQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static UnassignedTaskQuerySpecification INSTANCE = new UnassignedTaskQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static UnassignedTaskQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pT = new PParameter("T", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pT);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.unassignedTask";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("T");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_T = body.getOrCreateVariableByName("T");
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- new TypeConstraint(body, new FlatTuple(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_T, parameter_pT)
- ));
- // neg find variantAllocatedToTask(T, _)
- new NegativePatternCall(body, new FlatTuple(var_T, var___0_), VariantAllocatedToTaskQuerySpecification.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnrequiredResourceInstanceProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnrequiredResourceInstanceProcessor.java
deleted file mode 100644
index efb55ba..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnrequiredResourceInstanceProcessor.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnrequiredResourceInstanceMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.unrequiredResourceInstance pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class UnrequiredResourceInstanceProcessor implements IMatchProcessor<UnrequiredResourceInstanceMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pRI the value of pattern parameter RI in the currently processed match
- *
- */
- public abstract void process(final ResourceInstance pRI);
-
- @Override
- public void process(final UnrequiredResourceInstanceMatch match) {
- process(match.getRI());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnrequiredResourceInstanceQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnrequiredResourceInstanceQuerySpecification.java
deleted file mode 100644
index 65bfaa7..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/UnrequiredResourceInstanceQuerySpecification.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnrequiredResourceInstanceMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.UnrequiredResourceInstanceMatcher;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.util.TaskNeedsVariantQuerySpecification;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate UnrequiredResourceInstanceMatcher in a type-safe way.
- *
- * @see UnrequiredResourceInstanceMatcher
- * @see UnrequiredResourceInstanceMatch
- *
- */
-@SuppressWarnings("all")
-public final class UnrequiredResourceInstanceQuerySpecification extends BaseGeneratedEMFQuerySpecification<UnrequiredResourceInstanceMatcher> {
- private UnrequiredResourceInstanceQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static UnrequiredResourceInstanceQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected UnrequiredResourceInstanceMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return UnrequiredResourceInstanceMatcher.on(engine);
- }
-
- @Override
- public UnrequiredResourceInstanceMatcher instantiate() throws ViatraQueryException {
- return UnrequiredResourceInstanceMatcher.create();
- }
-
- @Override
- public UnrequiredResourceInstanceMatch newEmptyMatch() {
- return UnrequiredResourceInstanceMatch.newEmptyMatch();
- }
-
- @Override
- public UnrequiredResourceInstanceMatch newMatch(final Object... parameters) {
- return UnrequiredResourceInstanceMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance) parameters[0]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link UnrequiredResourceInstanceQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link UnrequiredResourceInstanceQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static UnrequiredResourceInstanceQuerySpecification INSTANCE = new UnrequiredResourceInstanceQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static UnrequiredResourceInstanceQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pRI = new PParameter("RI", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pRI);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.unrequiredResourceInstance";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("RI");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_RI = body.getOrCreateVariableByName("RI");
- PVariable var_RTV = body.getOrCreateVariableByName("RTV");
- PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
- new TypeConstraint(body, new FlatTuple(var_RI), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_RI, parameter_pRI)
- ));
- // ResourceInstance.resourceTypeVariant(RI, RTV)
- new TypeConstraint(body, new FlatTuple(var_RI), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_RI, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceInstance", "resourceTypeVariant")));
- new Equality(body, var__virtual_0_, var_RTV);
- // neg find taskNeedsVariant(_, RTV)
- new NegativePatternCall(body, new FlatTuple(var___0_, var_RTV), TaskNeedsVariantQuerySpecification.instance().getInternalQueryRepresentation());
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/VariantAllocatedToTaskProcessor.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/VariantAllocatedToTaskProcessor.java
deleted file mode 100644
index 2b37076..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/VariantAllocatedToTaskProcessor.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import org.eclipse.viatra.dse.examples.bpmn.patterns.VariantAllocatedToTaskMatch;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant;
-import org.eclipse.viatra.dse.examples.simplifiedbpmn.Task;
-import org.eclipse.viatra.query.runtime.api.IMatchProcessor;
-
-/**
- * A match processor tailored for the org.eclipse.viatra.dse.examples.bpmn.patterns.variantAllocatedToTask pattern.
- *
- * Clients should derive an (anonymous) class that implements the abstract process().
- *
- */
-@SuppressWarnings("all")
-public abstract class VariantAllocatedToTaskProcessor implements IMatchProcessor<VariantAllocatedToTaskMatch> {
- /**
- * Defines the action that is to be executed on each match.
- * @param pT the value of pattern parameter T in the currently processed match
- * @param pRTV the value of pattern parameter RTV in the currently processed match
- *
- */
- public abstract void process(final Task pT, final ResourceTypeVariant pRTV);
-
- @Override
- public void process(final VariantAllocatedToTaskMatch match) {
- process(match.getT(), match.getRTV());
- }
-}
diff --git a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/VariantAllocatedToTaskQuerySpecification.java b/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/VariantAllocatedToTaskQuerySpecification.java
deleted file mode 100644
index 8c7107a..0000000
--- a/dse/bpmn/org.eclipse.viatra.dse.examples.bpmn.patterns/src-gen/org/eclipse/viatra/dse/examples/bpmn/patterns/util/VariantAllocatedToTaskQuerySpecification.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- *
- * Copyright (c) 2010-2015, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * Andras Szabolcs Nagy - initial API and implementation
- *
- */
-package org.eclipse.viatra.dse.examples.bpmn.patterns.util;
-
-import com.google.common.collect.Sets;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.VariantAllocatedToTaskMatch;
-import org.eclipse.viatra.dse.examples.bpmn.patterns.VariantAllocatedToTaskMatcher;
-import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
-import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
-import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
-import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
-import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
-import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
-import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
-import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
-import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
-
-/**
- * A pattern-specific query specification that can instantiate VariantAllocatedToTaskMatcher in a type-safe way.
- *
- * @see VariantAllocatedToTaskMatcher
- * @see VariantAllocatedToTaskMatch
- *
- */
-@SuppressWarnings("all")
-public final class VariantAllocatedToTaskQuerySpecification extends BaseGeneratedEMFQuerySpecification<VariantAllocatedToTaskMatcher> {
- private VariantAllocatedToTaskQuerySpecification() {
- super(GeneratedPQuery.INSTANCE);
- }
-
- /**
- * @return the singleton instance of the query specification
- * @throws ViatraQueryException if the pattern definition could not be loaded
- *
- */
- public static VariantAllocatedToTaskQuerySpecification instance() throws ViatraQueryException {
- try{
- return LazyHolder.INSTANCE;
- } catch (ExceptionInInitializerError err) {
- throw processInitializerError(err);
- }
- }
-
- @Override
- protected VariantAllocatedToTaskMatcher instantiate(final ViatraQueryEngine engine) throws ViatraQueryException {
- return VariantAllocatedToTaskMatcher.on(engine);
- }
-
- @Override
- public VariantAllocatedToTaskMatcher instantiate() throws ViatraQueryException {
- return VariantAllocatedToTaskMatcher.create();
- }
-
- @Override
- public VariantAllocatedToTaskMatch newEmptyMatch() {
- return VariantAllocatedToTaskMatch.newEmptyMatch();
- }
-
- @Override
- public VariantAllocatedToTaskMatch newMatch(final Object... parameters) {
- return VariantAllocatedToTaskMatch.newMatch((org.eclipse.viatra.dse.examples.simplifiedbpmn.Task) parameters[0], (org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant) parameters[1]);
- }
-
- /**
- * Inner class allowing the singleton instance of {@link VariantAllocatedToTaskQuerySpecification} to be created
- * <b>not</b> at the class load time of the outer class,
- * but rather at the first call to {@link VariantAllocatedToTaskQuerySpecification#instance()}.
- *
- * <p> This workaround is required e.g. to support recursion.
- *
- */
- private static class LazyHolder {
- private final static VariantAllocatedToTaskQuerySpecification INSTANCE = new VariantAllocatedToTaskQuerySpecification();
-
- /**
- * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
- * This initialization order is required to support indirect recursion.
- *
- * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
- *
- */
- private final static Object STATIC_INITIALIZER = ensureInitialized();
-
- public static Object ensureInitialized() {
- INSTANCE.ensureInitializedInternalSneaky();
- return null;
- }
- }
-
- private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
- private final static VariantAllocatedToTaskQuerySpecification.GeneratedPQuery INSTANCE = new GeneratedPQuery();
-
- private final PParameter parameter_pT = new PParameter("T", "org.eclipse.viatra.dse.examples.simplifiedbpmn.Task", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "Task")), PParameterDirection.INOUT);
-
- private final PParameter parameter_pRTV = new PParameter("RTV", "org.eclipse.viatra.dse.examples.simplifiedbpmn.ResourceTypeVariant", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")), PParameterDirection.INOUT);
-
- private final List<PParameter> parameters = Arrays.asList(parameter_pT, parameter_pRTV);
-
- @Override
- public String getFullyQualifiedName() {
- return "org.eclipse.viatra.dse.examples.bpmn.patterns.variantAllocatedToTask";
- }
-
- @Override
- public List<String> getParameterNames() {
- return Arrays.asList("T","RTV");
- }
-
- @Override
- public List<PParameter> getParameters() {
- return parameters;
- }
-
- @Override
- public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
- setEvaluationHints(new QueryEvaluationHint(null, Collections.<String,Object>emptyMap()));
- Set<PBody> bodies = Sets.newLinkedHashSet();
- try {
- {
- PBody body = new PBody(this);
- PVariable var_T = body.getOrCreateVariableByName("T");
- PVariable var_RTV = body.getOrCreateVariableByName("RTV");
- new TypeConstraint(body, new FlatTuple(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- new TypeConstraint(body, new FlatTuple(var_RTV), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "ResourceTypeVariant")));
- body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
- new ExportedParameter(body, var_T, parameter_pT),
- new ExportedParameter(body, var_RTV, parameter_pRTV)
- ));
- // Task.variant(T, RTV)
- new TypeConstraint(body, new FlatTuple(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task")));
- PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
- new TypeConstraint(body, new FlatTuple(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("org.eclipse.viatra.dse.examples.bpmn", "Task", "variant")));
- new Equality(body, var__virtual_0_, var_RTV);
- bodies.add(body);
- }
- // to silence compiler error
- if (false) throw new ViatraQueryException("Never", "happens");
- } catch (ViatraQueryException ex) {
- throw processDependencyException(ex);
- }
- return bodies;
- }
- }
-}
diff --git a/dse/bpmn/pom.xml b/dse/bpmn/pom.xml
index bf628f3..daef438 100644
--- a/dse/bpmn/pom.xml
+++ b/dse/bpmn/pom.xml
@@ -66,6 +66,12 @@
<url>${orbit.repository.url}</url>
</repository>
</repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>viatra</id>
+ <url>https://repo.eclipse.org/content/groups/viatra2/</url>
+ </pluginRepository>
+ </pluginRepositories>
<properties>
<tycho.version>1.0.0</tycho.version>
<xtend.compiler.version>2.13.0</xtend.compiler.version>