Search in sources :

Example 1 with OOPathExprGenerator

use of org.drools.modelcompiler.builder.generator.OOPathExprGenerator in project drools by kiegroup.

the class ConstraintOOPath method buildPattern.

@Override
public void buildPattern() {
    final String patternIdentifierGenerated;
    // If the  outer pattern does not have a binding we generate it
    if (patternConstraintParseResult.getPatternIdentifier() != null) {
        patternIdentifierGenerated = patternConstraintParseResult.getPatternIdentifier();
    } else {
        patternIdentifierGenerated = context.getExprId(patternType, expression);
        context.addDeclaration(new DeclarationSpec(patternIdentifierGenerated, patternType, Optional.of(pattern), Optional.empty()));
    }
    new OOPathExprGenerator(context, packageModel).visit(patternType, patternIdentifierGenerated, drlxParseResult);
}
Also used : DeclarationSpec(org.drools.modelcompiler.builder.generator.DeclarationSpec) OOPathExprGenerator(org.drools.modelcompiler.builder.generator.OOPathExprGenerator)

Aggregations

DeclarationSpec (org.drools.modelcompiler.builder.generator.DeclarationSpec)1 OOPathExprGenerator (org.drools.modelcompiler.builder.generator.OOPathExprGenerator)1