Package javax.rules

Examples of javax.rules.RuleRuntime


    /**
     * Test getRegistrations.
     */
    @Test
    public void testGetRegistrations() throws Exception {
        final RuleRuntime ruleRuntime = this.ruleServiceProvider.getRuleRuntime();
        assertNotNull( "cannot obtain RuleRuntime",
                       ruleRuntime );

        // read rules and register with administrator
        final Reader ruleReader = new InputStreamReader( RuleRuntimeTest.class.getResourceAsStream( this.RULES_RESOURCE ) );
        final RuleExecutionSet ruleSet = this.ruleSetProvider.createRuleExecutionSet( ruleReader,
                                                                                      null );
        this.ruleAdministrator.registerRuleExecutionSet( this.RULES_RESOURCE,
                                                         ruleSet,
                                                         null );

        final List list = ruleRuntime.getRegistrations();
        assertTrue( "no registrations found",
                    list.size() > 0 );

        this.ruleAdministrator.deregisterRuleExecutionSet( this.RULES_RESOURCE,
                                                           null );
View Full Code Here


        LOGGER.info("The rule service provider of JSR94 is " + ruleServiceProvider.getClass());

        try {
            RuleAdministrator ruleAdministrator = ruleServiceProvider.getRuleAdministrator();
            LocalRuleExecutionSetProvider ruleExecutionSetProvider = ruleAdministrator.getLocalRuleExecutionSetProvider(serviceProviderProperties);
            RuleRuntime ruleRuntime = ruleServiceProvider.getRuleRuntime();
            RuleExecutionSet ruleExecutionSet = createRuleExecutionSet(ruleExecutionSetProvider, ruleSource, executionSetProperties);
            String packageName = ruleExecutionSet.getName();
            ruleAdministrator.registerRuleExecutionSet(packageName, ruleExecutionSet, null);
            session = (StatelessRuleSession) ruleRuntime.createRuleSession(packageName, sessionProperties, RuleRuntime.STATELESS_SESSION_TYPE);
        } catch (Exception e) {
            throw new RuleRuntimeException(e);
        }
       
    }
View Full Code Here

TOP

Related Classes of javax.rules.RuleRuntime

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.