aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java
diff options
context:
space:
mode:
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java')
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java607
1 files changed, 607 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java
new file mode 100644
index 00000000..eaceec5f
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java
@@ -0,0 +1,607 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.emf.ecore.EDataType;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
30import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
31import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
32import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
33import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
34import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
35import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
36import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
43import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
44import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
45import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
46import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
47import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
48import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
49
50/**
51 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
52 *
53 * <p>Original source:
54 * <code><pre>
55 * {@literal @}Constraint(severity = "error", key = {Req},
56 * message = "Requirement is not satisfied by enough application instances.")
57 * pattern requirementNotSatisfied(Req : Requirement) {
58 * Instances == count find satisfyingInstance(Req, _);
59 * Requirement.count(Req, RequiredCount);
60 * check(Instances {@literal <} RequiredCount);
61 * }
62 * </pre></code>
63 *
64 * @see Matcher
65 * @see Match
66 *
67 */
68@SuppressWarnings("all")
69public final class RequirementNotSatisfied extends BaseGeneratedEMFQuerySpecification<RequirementNotSatisfied.Matcher> {
70 /**
71 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied pattern,
72 * to be used in conjunction with {@link Matcher}.
73 *
74 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
75 * Each instance is a (possibly partial) substitution of pattern parameters,
76 * usable to represent a match of the pattern in the result of a query,
77 * or to specify the bound (fixed) input parameters when issuing a query.
78 *
79 * @see Matcher
80 *
81 */
82 public static abstract class Match extends BasePatternMatch {
83 private Requirement fReq;
84
85 private static List<String> parameterNames = makeImmutableList("Req");
86
87 private Match(final Requirement pReq) {
88 this.fReq = pReq;
89 }
90
91 @Override
92 public Object get(final String parameterName) {
93 switch(parameterName) {
94 case "Req": return this.fReq;
95 default: return null;
96 }
97 }
98
99 @Override
100 public Object get(final int index) {
101 switch(index) {
102 case 0: return this.fReq;
103 default: return null;
104 }
105 }
106
107 public Requirement getReq() {
108 return this.fReq;
109 }
110
111 @Override
112 public boolean set(final String parameterName, final Object newValue) {
113 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
114 if ("Req".equals(parameterName) ) {
115 this.fReq = (Requirement) newValue;
116 return true;
117 }
118 return false;
119 }
120
121 public void setReq(final Requirement pReq) {
122 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
123 this.fReq = pReq;
124 }
125
126 @Override
127 public String patternName() {
128 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied";
129 }
130
131 @Override
132 public List<String> parameterNames() {
133 return RequirementNotSatisfied.Match.parameterNames;
134 }
135
136 @Override
137 public Object[] toArray() {
138 return new Object[]{fReq};
139 }
140
141 @Override
142 public RequirementNotSatisfied.Match toImmutable() {
143 return isMutable() ? newMatch(fReq) : this;
144 }
145
146 @Override
147 public String prettyPrint() {
148 StringBuilder result = new StringBuilder();
149 result.append("\"Req\"=" + prettyPrintValue(fReq));
150 return result.toString();
151 }
152
153 @Override
154 public int hashCode() {
155 return Objects.hash(fReq);
156 }
157
158 @Override
159 public boolean equals(final Object obj) {
160 if (this == obj)
161 return true;
162 if (obj == null) {
163 return false;
164 }
165 if ((obj instanceof RequirementNotSatisfied.Match)) {
166 RequirementNotSatisfied.Match other = (RequirementNotSatisfied.Match) obj;
167 return Objects.equals(fReq, other.fReq);
168 } else {
169 // this should be infrequent
170 if (!(obj instanceof IPatternMatch)) {
171 return false;
172 }
173 IPatternMatch otherSig = (IPatternMatch) obj;
174 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
175 }
176 }
177
178 @Override
179 public RequirementNotSatisfied specification() {
180 return RequirementNotSatisfied.instance();
181 }
182
183 /**
184 * Returns an empty, mutable match.
185 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
186 *
187 * @return the empty match.
188 *
189 */
190 public static RequirementNotSatisfied.Match newEmptyMatch() {
191 return new Mutable(null);
192 }
193
194 /**
195 * Returns a mutable (partial) match.
196 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
197 *
198 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
199 * @return the new, mutable (partial) match object.
200 *
201 */
202 public static RequirementNotSatisfied.Match newMutableMatch(final Requirement pReq) {
203 return new Mutable(pReq);
204 }
205
206 /**
207 * Returns a new (partial) match.
208 * This can be used e.g. to call the matcher with a partial match.
209 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
210 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
211 * @return the (partial) match object.
212 *
213 */
214 public static RequirementNotSatisfied.Match newMatch(final Requirement pReq) {
215 return new Immutable(pReq);
216 }
217
218 private static final class Mutable extends RequirementNotSatisfied.Match {
219 Mutable(final Requirement pReq) {
220 super(pReq);
221 }
222
223 @Override
224 public boolean isMutable() {
225 return true;
226 }
227 }
228
229 private static final class Immutable extends RequirementNotSatisfied.Match {
230 Immutable(final Requirement pReq) {
231 super(pReq);
232 }
233
234 @Override
235 public boolean isMutable() {
236 return false;
237 }
238 }
239 }
240
241 /**
242 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied pattern,
243 * providing pattern-specific query methods.
244 *
245 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
246 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
247 *
248 * <p>Matches of the pattern will be represented as {@link Match}.
249 *
250 * <p>Original source:
251 * <code><pre>
252 * {@literal @}Constraint(severity = "error", key = {Req},
253 * message = "Requirement is not satisfied by enough application instances.")
254 * pattern requirementNotSatisfied(Req : Requirement) {
255 * Instances == count find satisfyingInstance(Req, _);
256 * Requirement.count(Req, RequiredCount);
257 * check(Instances {@literal <} RequiredCount);
258 * }
259 * </pre></code>
260 *
261 * @see Match
262 * @see RequirementNotSatisfied
263 *
264 */
265 public static class Matcher extends BaseMatcher<RequirementNotSatisfied.Match> {
266 /**
267 * Initializes the pattern matcher within an existing VIATRA Query engine.
268 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
269 *
270 * @param engine the existing VIATRA Query engine in which this matcher will be created.
271 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
272 *
273 */
274 public static RequirementNotSatisfied.Matcher on(final ViatraQueryEngine engine) {
275 // check if matcher already exists
276 Matcher matcher = engine.getExistingMatcher(querySpecification());
277 if (matcher == null) {
278 matcher = (Matcher)engine.getMatcher(querySpecification());
279 }
280 return matcher;
281 }
282
283 /**
284 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
285 * @return an initialized matcher
286 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
287 *
288 */
289 public static RequirementNotSatisfied.Matcher create() {
290 return new Matcher();
291 }
292
293 private static final int POSITION_REQ = 0;
294
295 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(RequirementNotSatisfied.Matcher.class);
296
297 /**
298 * Initializes the pattern matcher within an existing VIATRA Query engine.
299 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
300 *
301 * @param engine the existing VIATRA Query engine in which this matcher will be created.
302 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
303 *
304 */
305 private Matcher() {
306 super(querySpecification());
307 }
308
309 /**
310 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
311 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
312 * @return matches represented as a Match object.
313 *
314 */
315 public Collection<RequirementNotSatisfied.Match> getAllMatches(final Requirement pReq) {
316 return rawStreamAllMatches(new Object[]{pReq}).collect(Collectors.toSet());
317 }
318
319 /**
320 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
321 * </p>
322 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
323 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
324 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
325 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
326 * @return a stream of matches represented as a Match object.
327 *
328 */
329 public Stream<RequirementNotSatisfied.Match> streamAllMatches(final Requirement pReq) {
330 return rawStreamAllMatches(new Object[]{pReq});
331 }
332
333 /**
334 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
335 * Neither determinism nor randomness of selection is guaranteed.
336 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
337 * @return a match represented as a Match object, or null if no match is found.
338 *
339 */
340 public Optional<RequirementNotSatisfied.Match> getOneArbitraryMatch(final Requirement pReq) {
341 return rawGetOneArbitraryMatch(new Object[]{pReq});
342 }
343
344 /**
345 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
346 * under any possible substitution of the unspecified parameters (if any).
347 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
348 * @return true if the input is a valid (partial) match of the pattern.
349 *
350 */
351 public boolean hasMatch(final Requirement pReq) {
352 return rawHasMatch(new Object[]{pReq});
353 }
354
355 /**
356 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
357 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
358 * @return the number of pattern matches found.
359 *
360 */
361 public int countMatches(final Requirement pReq) {
362 return rawCountMatches(new Object[]{pReq});
363 }
364
365 /**
366 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
367 * Neither determinism nor randomness of selection is guaranteed.
368 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
369 * @param processor the action that will process the selected match.
370 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
371 *
372 */
373 public boolean forOneArbitraryMatch(final Requirement pReq, final Consumer<? super RequirementNotSatisfied.Match> processor) {
374 return rawForOneArbitraryMatch(new Object[]{pReq}, processor);
375 }
376
377 /**
378 * Returns a new (partial) match.
379 * This can be used e.g. to call the matcher with a partial match.
380 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
381 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
382 * @return the (partial) match object.
383 *
384 */
385 public RequirementNotSatisfied.Match newMatch(final Requirement pReq) {
386 return RequirementNotSatisfied.Match.newMatch(pReq);
387 }
388
389 /**
390 * Retrieve the set of values that occur in matches for Req.
391 * @return the Set of all values or empty set if there are no matches
392 *
393 */
394 protected Stream<Requirement> rawStreamAllValuesOfReq(final Object[] parameters) {
395 return rawStreamAllValues(POSITION_REQ, parameters).map(Requirement.class::cast);
396 }
397
398 /**
399 * Retrieve the set of values that occur in matches for Req.
400 * @return the Set of all values or empty set if there are no matches
401 *
402 */
403 public Set<Requirement> getAllValuesOfReq() {
404 return rawStreamAllValuesOfReq(emptyArray()).collect(Collectors.toSet());
405 }
406
407 /**
408 * Retrieve the set of values that occur in matches for Req.
409 * @return the Set of all values or empty set if there are no matches
410 *
411 */
412 public Stream<Requirement> streamAllValuesOfReq() {
413 return rawStreamAllValuesOfReq(emptyArray());
414 }
415
416 @Override
417 protected RequirementNotSatisfied.Match tupleToMatch(final Tuple t) {
418 try {
419 return RequirementNotSatisfied.Match.newMatch((Requirement) t.get(POSITION_REQ));
420 } catch(ClassCastException e) {
421 LOGGER.error("Element(s) in tuple not properly typed!",e);
422 return null;
423 }
424 }
425
426 @Override
427 protected RequirementNotSatisfied.Match arrayToMatch(final Object[] match) {
428 try {
429 return RequirementNotSatisfied.Match.newMatch((Requirement) match[POSITION_REQ]);
430 } catch(ClassCastException e) {
431 LOGGER.error("Element(s) in array not properly typed!",e);
432 return null;
433 }
434 }
435
436 @Override
437 protected RequirementNotSatisfied.Match arrayToMatchMutable(final Object[] match) {
438 try {
439 return RequirementNotSatisfied.Match.newMutableMatch((Requirement) match[POSITION_REQ]);
440 } catch(ClassCastException e) {
441 LOGGER.error("Element(s) in array not properly typed!",e);
442 return null;
443 }
444 }
445
446 /**
447 * @return the singleton instance of the query specification of this pattern
448 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
449 *
450 */
451 public static IQuerySpecification<RequirementNotSatisfied.Matcher> querySpecification() {
452 return RequirementNotSatisfied.instance();
453 }
454 }
455
456 private RequirementNotSatisfied() {
457 super(GeneratedPQuery.INSTANCE);
458 }
459
460 /**
461 * @return the singleton instance of the query specification
462 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
463 *
464 */
465 public static RequirementNotSatisfied instance() {
466 try{
467 return LazyHolder.INSTANCE;
468 } catch (ExceptionInInitializerError err) {
469 throw processInitializerError(err);
470 }
471 }
472
473 @Override
474 protected RequirementNotSatisfied.Matcher instantiate(final ViatraQueryEngine engine) {
475 return RequirementNotSatisfied.Matcher.on(engine);
476 }
477
478 @Override
479 public RequirementNotSatisfied.Matcher instantiate() {
480 return RequirementNotSatisfied.Matcher.create();
481 }
482
483 @Override
484 public RequirementNotSatisfied.Match newEmptyMatch() {
485 return RequirementNotSatisfied.Match.newEmptyMatch();
486 }
487
488 @Override
489 public RequirementNotSatisfied.Match newMatch(final Object... parameters) {
490 return RequirementNotSatisfied.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.Requirement) parameters[0]);
491 }
492
493 /**
494 * Inner class allowing the singleton instance of {@link RequirementNotSatisfied} to be created
495 * <b>not</b> at the class load time of the outer class,
496 * but rather at the first call to {@link RequirementNotSatisfied#instance()}.
497 *
498 * <p> This workaround is required e.g. to support recursion.
499 *
500 */
501 private static class LazyHolder {
502 private static final RequirementNotSatisfied INSTANCE = new RequirementNotSatisfied();
503
504 /**
505 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
506 * This initialization order is required to support indirect recursion.
507 *
508 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
509 *
510 */
511 private static final Object STATIC_INITIALIZER = ensureInitialized();
512
513 public static Object ensureInitialized() {
514 INSTANCE.ensureInitializedInternal();
515 return null;
516 }
517 }
518
519 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
520 private static final RequirementNotSatisfied.GeneratedPQuery INSTANCE = new GeneratedPQuery();
521
522 private final PParameter parameter_Req = new PParameter("Req", "hu.bme.mit.inf.dslreasoner.domains.cps.Requirement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "Requirement")), PParameterDirection.INOUT);
523
524 private final List<PParameter> parameters = Arrays.asList(parameter_Req);
525
526 private GeneratedPQuery() {
527 super(PVisibility.PUBLIC);
528 }
529
530 @Override
531 public String getFullyQualifiedName() {
532 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied";
533 }
534
535 @Override
536 public List<String> getParameterNames() {
537 return Arrays.asList("Req");
538 }
539
540 @Override
541 public List<PParameter> getParameters() {
542 return parameters;
543 }
544
545 @Override
546 public Set<PBody> doGetContainedBodies() {
547 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
548 Set<PBody> bodies = new LinkedHashSet<>();
549 {
550 PBody body = new PBody(this);
551 PVariable var_Req = body.getOrCreateVariableByName("Req");
552 PVariable var_Instances = body.getOrCreateVariableByName("Instances");
553 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
554 PVariable var_RequiredCount = body.getOrCreateVariableByName("RequiredCount");
555 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
556 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
557 new ExportedParameter(body, var_Req, parameter_Req)
558 ));
559 // Instances == count find satisfyingInstance(Req, _)
560 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
561 new PatternMatchCounter(body, Tuples.flatTupleOf(var_Req, var___0_), SatisfyingInstance.instance().getInternalQueryRepresentation(), var__virtual_0_);
562 new Equality(body, var_Instances, var__virtual_0_);
563 // Requirement.count(Req, RequiredCount)
564 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
565 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
566 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "count")));
567 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
568 new Equality(body, var__virtual_1_, var_RequiredCount);
569 // check(Instances < RequiredCount)
570 new ExpressionEvaluation(body, new IExpressionEvaluator() {
571
572 @Override
573 public String getShortDescription() {
574 return "Expression evaluation from pattern requirementNotSatisfied";
575 }
576
577 @Override
578 public Iterable<String> getInputParameterNames() {
579 return Arrays.asList("Instances", "RequiredCount");}
580
581 @Override
582 public Object evaluateExpression(IValueProvider provider) throws Exception {
583 Integer Instances = (Integer) provider.getValue("Instances");
584 Integer RequiredCount = (Integer) provider.getValue("RequiredCount");
585 return evaluateExpression_1_1(Instances, RequiredCount);
586 }
587 }, null);
588 bodies.add(body);
589 }
590 {
591 PAnnotation annotation = new PAnnotation("Constraint");
592 annotation.addAttribute("severity", "error");
593 annotation.addAttribute("key", Arrays.asList(new Object[] {
594 new ParameterReference("Req")
595 }));
596 annotation.addAttribute("message", "Requirement is not satisfied by enough application instances.");
597 addAnnotation(annotation);
598 }
599 return bodies;
600 }
601 }
602
603 private static boolean evaluateExpression_1_1(final Integer Instances, final Integer RequiredCount) {
604 boolean _lessThan = (Instances.compareTo(RequiredCount) < 0);
605 return _lessThan;
606 }
607}