May I add that the .pkg file was created
successfully.
Adeyinka Timi | Technical Supprt | Nathean Technologies Ltd
Registered Office
T +353 1 685 3001
| VOIP 076 615 1117 | E
adeyinka.timi@nathean.com | www.nathean.com
Incorporated in
The information appearing in this email and
any files transmitted with it is confidential and may not be reproduced,
modified, distributed, transmitted, displayed, published or broadcast without
the prior written permission of Nathean Technologies Ltd. It is intended solely
for the use of the addressee(s). Nathean Technologies Ltd, its directors,
officers and employees do not accept liability for any loss or damage of any
nature howsoever arising pertaining to the use of information appearing in this
email and/or any files transmitted with it. Whilst this email has been checked
for the presence of computer viruses, Nathean Technologies Ltd does not, except
as required by law, represent, warrant and/or guarantee that the integrity of
this communication has been maintained nor that the communication is free of
errors, viruses, interception or interference.
From:
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of Adeyinka Timi
Sent: 18 May 2010 11:36
To: 'Rules Users List'
Subject: Re: [rules-users] Time
Taken To Load Rule Resource
Hi,
Thanks for the help!
I have tried implemented your idea by
creating a method that compiles the rules resources (DRL and RF files). But I
keep getting a
java.lang.RuntimeException: java.io.EOFException
error when I call kbuilder.add(ResourceFactory.newFileResource("/some/file.pkg"), ResourceType.PKG);
Any ideas?
- Ade
From:
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of Esteban Aliverti
Sent: 17 May 2010 14:32
To: Rules Users List
Subject: Re: [rules-users] Time
Taken To Load Rule Resource
Yes, you can compile your rules once and save them as binary files.
Here is a code snippet to do that:
KnowledgePackage pkg = (KnowledgePackage)
kbuilder
.getKnowledgePackages().iterator().next();
FileOutputStream out = new
FileOutputStream("/some/file.pkg");
try {
DroolsStreamUtils.streamOut(out,
pkg);
} finally {
out.close();
}
The code above only uses kbuilder's first package.
The way you load a binary package is the same as you do for DRL files:
kbuilder.add(ResourceFactory.newFileResource("/some/file.pkg", ResourceType.PKG);
Hope you find this useful!
Best,
2010/5/17 Adeyinka Timi <adeyinka.timi@nathean.com>
Thanks for your reply!
No particular reason. Is there a better of going about this –
avoid compilation of rules everytime?
From: rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org]
On Behalf Of Esteban Aliverti
Sent: 17 May 2010 14:09
To: Rules Users List
Subject: Re: [rules-users] Time
Taken To Load Rule Resource
Is there any
reason why you need to compile the rules every time your app starts?
2010/5/17 Adeyinka
Timi <adeyinka.timi@nathean.com>
Hi guys,
I have a
drools application running that takes about 7 seconds to run. 5 seconds of this
time is used in parsing 2 DRL files that 200kb (6200 lines of code) and 34kb
(1400 lines of code). Do you guys have any tips or any techniques that I can
use to improve performance?
- Ade
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti