But this is not the answer for his question. He is asking a way to get the package deployen in the REPOSITORY
not as a file.

Your code gets the .pkg FILE and compile it into a rulebase (which can be serializated into JNDI or something else)
But the question is: How (API, example) can I access to a package defined using the BRMS gui and located in the
repository???... becase if anyone is going to design and develope a kind of rules server or something like that, you
need a way to access rules (packages or rulebases) automaticaly.

Thx.

On 07-06-2007, at 14:24, Fernando Meyer wrote:

You MUST use the org.drools.util.BinaryRuleBaseLoader to load a precompiled binary package into your RE classes.

    public void testLoadAndExecBinary() throws Exception {
        Person p = new Person();
        BinaryRuleBaseLoader loader = new BinaryRuleBaseLoader();
        loader.addPackage( this.getClass().getResourceAsStream( "/RepoBinPackage.pkg" ) );
        RuleBase rb = loader.getRuleBase();
        StatelessSession sess = rb.newStatelessSession();
        sess.execute( p );
        assertEquals(42, p.getAge());
    }

ps: im going to create a wiki entry for this.

Fernando Meyer
fmcamargo@gmail.com
GPG: 5A6D 3374 B055 A513 9A02  A03B 3DB3 7485 D804 DDFB


On Jun 7, 2007, at 2:48 PM, philokratis wrote:




We need to load rule packages (snapshots) directly from the repository, preferably from a jmx service in order
build a rulebase and cache the rulebase in JNDI.

How can we access a package snapshot directly from the repository ?
Is there another way besides downloading the package through http request?


Michael, regarding the rulebase caching is the use of JNDI the reccomended approach
What are the plans for BRMS regarding this part?


Thank you





_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



Atentamente,
______________________
Felipe Piccolini Marfull
Jefe de Proyectos
Agustina 1141 Piso 8-B
Santiago

 

Fono    +(56 2) 68830837
E-mail felipe.piccolini@bluesoft.cl