35
35
import ru .ewc .decisions .api .RuleFragments ;
36
36
import ru .ewc .decisions .commands .Assignment ;
37
37
import ru .ewc .decisions .conditions .Condition ;
38
+ import ru .ewc .decisions .core .Coordinate ;
38
39
39
40
/**
40
41
* I am a single file containing one or more tests. I am responsible for performing all the tests
@@ -73,6 +74,7 @@ public CheckFile(final String file, final List<RuleFragments> tests, final Strin
73
74
public List <TestResult > performChecks (final String root , final CheckSuite files ) {
74
75
this .suite = files ;
75
76
return this .tests .stream ()
77
+ .filter (rule -> rule .getFragments ().stream ().anyMatch (f -> f .nonEmptyOfType ("CND" )))
76
78
.map (rule -> this .getTestResult (rule , ServerContextFactory .create (root ).context ()))
77
79
.toList ();
78
80
}
@@ -93,7 +95,7 @@ private TestResult getTestResult(final RuleFragments rule, final ComputationCont
93
95
if (!check .evaluate (ctx )) {
94
96
failures .add (new CheckFailure (check .asString (), check .result ()));
95
97
}
96
- } catch (final DecitaException exception ) {
98
+ } catch (final DecitaException | IllegalArgumentException exception ) {
97
99
failures .add (
98
100
new CheckFailure (
99
101
check .asString (),
@@ -104,7 +106,7 @@ private TestResult getTestResult(final RuleFragments rule, final ComputationCont
104
106
} else {
105
107
try {
106
108
this .perform (fragment , ctx );
107
- } catch (DecitaException exception ) {
109
+ } catch (final DecitaException | IllegalArgumentException exception ) {
108
110
failures .add (new CheckFailure ("" , exception .getMessage ()));
109
111
}
110
112
}
@@ -123,7 +125,9 @@ private void perform(final RuleFragment fragment, final ComputationContext ctx)
123
125
case "ASG" -> new Assignment (fragment .left (), fragment .right ()).performIn (ctx );
124
126
case "EXE" -> {
125
127
if ("command" .equals (fragment .left ())) {
126
- ctx .perform (fragment .right ());
128
+ final Coordinate coordinate = Coordinate .from (fragment .right ());
129
+ coordinate .resolveIn (ctx );
130
+ ctx .perform (coordinate .valueIn (ctx ));
127
131
ctx .resetComputationState (this .request );
128
132
}
129
133
if ("include" .equals (fragment .left ())) {
0 commit comments