Package org.drools.smf

Examples of org.drools.smf.SemanticCondition


    {
        JavaMethodGenerator methodGenerator = JavaMethodGenerator.getInstance();
        JavaInvokerGenerator invokerGenerator = JavaInvokerGenerator.getInstance();

        SemanticRule component = null;
        SemanticCondition condition = null;
        SemanticConsequence consequence = null;

        /* needs to be LinkedHashSet() to ensure the order is the same */
        Set usedApplicationData = new LinkedHashSet();
        List methods = new ArrayList();
        List invokers = new ArrayList();
        for ( int i = 0; i < components.length; i++ )
        {
            usedApplicationData.clear();
            component = (SemanticRule) components[i];
            if ( component instanceof Condition )
            {
                condition = (SemanticCondition) component;
                StringBuffer conditionBuffer = methodGenerator.generateMethod( condition.getName(),
                                                                               "boolean",
                                                                               condition.getThrownException(),
                                                                               condition.getText(),
                                                                               imports,
                                                                               usedApplicationData,
                                                                               null,
                                                                               applicationData,
                                                                               ((Condition) condition).getRequiredTupleMembers(),
                                                                               4 );
                String name = condition.getName();
                StringBuffer invokerBuffer = invokerGenerator.generateInvoker( className,
                                                                               name.toUpperCase().charAt( 0 ) + name.substring( 1 ),
                                                                               name,
                                                                               "boolean",
                                                                               null,
View Full Code Here

TOP

Related Classes of org.drools.smf.SemanticCondition

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.