Package org.drools.base.mvel

Examples of org.drools.base.mvel.MVELCompilationUnit


            final AnalysisResult analysis = dialect.analyzeExpression( context,
                                                                       accumDescr,
                                                                       func.getParams().length > 0 ? func.getParams()[0] : "\"\"",
                                                                       boundIds );

            MVELCompilationUnit unit = dialect.getMVELCompilationUnit( func.getParams().length > 0 ? func.getParams()[0] : "\"\"",
                                                                       analysis,
                                                                       getUsedDeclarations( decls,
                                                                                            analysis ),
                                                                       getUsedDeclarations( sourceOuterDeclr,
                                                                                            analysis ),
View Full Code Here


//                                                                             "drools",
//                                                                             KnowledgeHelper.class );
//        }

        context.setTypesafe( initCodeAnalysis.isTypesafe() );
        MVELCompilationUnit initUnit = dialect.getMVELCompilationUnit( (String) accumDescr.getInitCode(),
                                                                       initCodeAnalysis,
                                                                       getUsedDeclarations( decls,
                                                                                            initCodeAnalysis ),
                                                                       getUsedDeclarations( sourceOuterDeclr,
                                                                                            initCodeAnalysis ),
                                                                       initCodeAnalysis.getMvelVariables(),
                                                                       context,
                                                                       "drools",
                                                                       KnowledgeHelper.class );

        context.setTypesafe( actionCodeAnalysis.isTypesafe() );
        MVELCompilationUnit actionUnit = dialect.getMVELCompilationUnit( (String) accumDescr.getActionCode(),
                                                                         actionCodeAnalysis,
                                                                         getUsedDeclarations( decls,
                                                                                              actionCodeAnalysis ),
                                                                         getUsedDeclarations( sourceOuterDeclr,
                                                                                              actionCodeAnalysis ),
                                                                         initCodeAnalysis.getMvelVariables(),
                                                                         context,
                                                                         "drools",
                                                                         KnowledgeHelper.class );

        MVELCompilationUnit reverseUnit = null;
        if ( accumDescr.getReverseCode() != null ) {
            context.setTypesafe( actionCodeAnalysis.isTypesafe() );
            reverseUnit = dialect.getMVELCompilationUnit( (String) accumDescr.getReverseCode(),
                                                          actionCodeAnalysis,
                                                          getUsedDeclarations( decls,
                                                                               actionCodeAnalysis ),
                                                          getUsedDeclarations( sourceOuterDeclr,
                                                                               actionCodeAnalysis ),
                                                          initCodeAnalysis.getMvelVariables(),
                                                          context,
                                                          "drools",
                                                          KnowledgeHelper.class );
        }

        context.setTypesafe( resultCodeAnalysis.isTypesafe() );
        MVELCompilationUnit resultUnit = dialect.getMVELCompilationUnit( (String) accumDescr.getResultCode(),
                                                                         resultCodeAnalysis,
                                                                         getUsedDeclarations( decls,
                                                                                              resultCodeAnalysis ),
                                                                         getUsedDeclarations( sourceOuterDeclr,
                                                                                              resultCodeAnalysis ),
View Full Code Here

                }
            }
        }

        String expression = expressionBuilder.toString();
        MVELCompilationUnit compilationUnit = buildCompilationUnit(context, pattern, expression);

        MvelConstraint combinedConstraint = new MvelConstraint(packageName, expression,
                                                               declarations.toArray(new Declaration[declarations.size()]),
                                                               compilationUnit, false, null, null, false);
View Full Code Here

                    predicateDescr,
                    analysis);

            pattern.addConstraint( predicateConstraint );
        } else {
            MVELCompilationUnit compilationUnit = ConstraintBuilder.buildCompilationUnit( context,
                                                                                          previousDeclarations,
                                                                                          localDeclarations,
                                                                                          predicateDescr,
                                                                                          analysis );
View Full Code Here

            Arrays.sort( declarations, SortDeclarations.instance  );
            for ( int i = 0; i < declrStr.length; i++) {
                declrStr[i] = declarations[i].getIdentifier();
            }
            context.getRule().setRequiredDeclarations( declrStr );
            MVELCompilationUnit unit = dialect.getMVELCompilationUnit( text,
                                                                       analysis,
                                                                       declarations,
                                                                       null,
                                                                       null,
                                                                       context,
View Full Code Here

            Map< String , Class<?> > declIds = context.getDeclarationResolver().getDeclarationClasses(context.getRule());
           
            Pattern p = ( Pattern ) context.getBuildStack().peek();
           
            context.setTypesafe( ((MVELAnalysisResult)analysis).isTypesafe() );
            MVELCompilationUnit unit = dialect.getMVELCompilationUnit((String) returnValueRestrictionDescr.getContent(),
                                                                      analysis, 
                                                                      previousDeclarations,
                                                                      localDeclarations,
                                                                      null,
                                                                      context,
View Full Code Here

            for ( String id :  usedIdentifiers.getDeclrClasses().keySet() ) {
                previousDeclarations[i++] = decls.get( id );
            }
            Arrays.sort( previousDeclarations, SortDeclarations.instance  );
           
            MVELCompilationUnit unit = dialect.getMVELCompilationUnit( (String) evalDescr.getContent(),
                                                                       analysis,
                                                                       previousDeclarations,
                                                                       null,
                                                                       null,
                                                                       context,
View Full Code Here

                name = context.getPkg().getName() + ".Unknown";
            }
        } else {
            name = "Unknown";
        }
        MVELCompilationUnit compilationUnit = new MVELCompilationUnit( name,
                                                                       expression,
                                                                       globalIdentifiers,
                                                                       operators,
                                                                       previousDeclarations,
                                                                       localDeclarations,
View Full Code Here

            if ( p.getObjectType() instanceof ClassObjectType ) {
                declIds.put( "this",
                             ((ClassObjectType) p.getObjectType()).getClassType() );
            }
           
            MVELCompilationUnit unit = dialect.getMVELCompilationUnit((String) predicateDescr.getContent(),
                                                                      analysis, 
                                                                      previousDeclarations,
                                                                      localDeclarations,
                                                                      null,
                                                                      context,
View Full Code Here

            for ( String id :  usedIdentifiers.getDeclrClasses().keySet() ) {
                previousDeclarations[i++] = decls.get( id );
            }
            Arrays.sort( previousDeclarations, SortDeclarations.instance  );
           
            MVELCompilationUnit unit = dialect.getMVELCompilationUnit( (String) context.getRuleDescr().getSalience(),
                                                                       analysis,
                                                                       previousDeclarations,
                                                                       null,
                                                                       null,
                                                                       context,
View Full Code Here

TOP

Related Classes of org.drools.base.mvel.MVELCompilationUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.