public RuleConditionElement build ( RuleBuildContext context , PatternDescr patternDescr , Pattern prefixPattern ) { if ( patternDescr . getObjectType ( ) == null ) { lookupObjectType ( context , patternDescr ) ; } if ( patternDescr . getObjectType ( ) == null || patternDescr . getObjectType ( ) . equals ( "" ) ) { registerDescrBuildError ( context , patternDescr , "ObjectType not correctly defined" ) ; return null ; } ObjectType objectType = getObjectType ( context , patternDescr ) ; if ( objectType == null ) { // if the objectType doesn't exist it has to be query return buildQuery ( context , patternDescr , patternDescr ) ; } Pattern pattern = buildPattern ( context , patternDescr , objectType ) ; processClassObjectType ( context , objectType , pattern ) ; processAnnotations ( context , patternDescr , pattern ) ; processSource ( context , patternDescr , pattern ) ; processConstraintsAndBinds ( context , patternDescr , pattern ) ; processBehaviors ( context , patternDescr , pattern ) ; if ( ! pattern . hasNegativeConstraint ( ) && "on" . equals ( System . getProperty ( "drools.negatable" ) ) ) { // this is a non-negative pattern, so we must inject the constraint pattern . addConstraint ( new NegConstraint ( false ) ) ; } // poping the pattern context . getDeclarationResolver ( ) . popBuildStack ( ) ; return pattern ; }
Build a pattern for the given descriptor in the current context and using the given utils object