Search in sources :

Example 6 with Pattern

use of org.drools.verifier.core.index.model.Pattern in project drools-wb by kiegroup.

the class PatternResolver method resolve.

public Pattern resolve() {
    PortablePreconditions.checkNotNull("rule", rule);
    final Pattern pattern = rule.getPatterns().where(Pattern.boundName().is(getBoundName())).select().first();
    if (pattern == null) {
        final Pattern build = new Pattern(getBoundName(), resolveObjectType(getFactType()), configuration);
        rule.getPatterns().add(build);
        return build;
    } else {
        return pattern;
    }
}
Also used : Pattern(org.drools.verifier.core.index.model.Pattern)

Aggregations

Pattern (org.drools.verifier.core.index.model.Pattern)6 ObjectType (org.drools.verifier.core.index.model.ObjectType)3 AnalyzerConfiguration (org.drools.verifier.core.configuration.AnalyzerConfiguration)2 Test (org.junit.Test)2 AnalyzerConfigurationMock (org.drools.verifier.core.AnalyzerConfigurationMock)1 BRLConditionVariableColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLConditionVariableColumn)1 Before (org.junit.Before)1