Recommended way to register custom ResourceTypeBuilder?
by helo
Hello there,
in a project I've been working on lately I had to implement my own custom
ResourceTypeBuilder for a special file format I'm using. The import of files
in my format works perfectly using my ResourceTypeBuilder, my only concern
left is where to register my ResourceTypeBuilder.
What I'm doing right now is something like this:
ResourceTypeBuilderRegistry.getInstance().register(myResourceType, new
myResourceTypeBuilder());
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder ();
kbuilder.add (...);
The problem I see with this is that I will have to do this every time I
write an application using my file format. I would like to know if there is
a nicer way to register my ResourceTypeBuilder, maybe via some configuration
file like drools.rulebase.conf or drools.session.conf. I would greatly
prefer that over the solution I'm using now.
Thanks in advance!
Cheers
Henning Losert
--
View this message in context: http://drools.46999.n3.nabble.com/Recommended-way-to-register-custom-Reso...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 8 months
Best performing way to process facts in a particular order?
by jkrupka
I've been trying to optimize our stateful rules to run a bit faster,
currently they can't quite keep up with the events coming into the session.
A lot of our rules have to find the fact whose attribute is the
smallest/largest value of all the facts of that type in working memory. I
had originally written the rules to do a min accumulate to find the min
value of the attribute, then a regular pattern to find the actual fact with
that min value. Some of the fact types actually have two fields that must
be used to find the min - think of them as a category and a score. For
those I did two accumulate mins, one to find the lowest category, one to
find the lowest score in that category, and then a third rule to find the
fact with that min category and min score.
I recently refactored all the rules to use the paradigm of one rule that
matches the fact type I'm interested in, and a second rule that uses the not
operator to express that there be no facts whose attribute is a higher value
than the fact I just matched. In the contrived test I wrote, this seemed to
perform better, but it's hard to tell if they are performing better or not
with production data flowing through them.
I know of a third option - writing my own accumulate functions - which I
will probably try next. This should allow me to find the min/max fact with
just one iteration over the facts, vs multiple iterations like my first
approach. I don't know how it will compare to using the exists method
though.
Any feedback on these three different approaches? Any other ideas on the
best way to do this?
--
View this message in context: http://drools.46999.n3.nabble.com/Best-performing-way-to-process-facts-in...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 8 months
Rules Flow Eclipse editor
by Prafull Kumar
Hi All,
I would like to know how we can modify the Rules flow eclipse editor look and
feel and functionality. e.g. If we have a Embedded Sub-Process in the flow and
reduce the size of it, the arrows are still displayed in the main canvas. Please
see the attached snapshot for reference.
How we can fix it? also if we want to open the Embedded Sub-Process in a new
window for easy maintainability/readability of the very complex processes, how
we can achieve it?
Going forward we are also looking to create the custom editor for the nodes.
Please guide us if its possible and there is any document for this.
Note: It seems that I can not attach files in the mailing list. Let me know if
its possible to share the image.
Regards, Prafull
14 years, 8 months
typical rules application
by Abhay B. Chaware
Hi
I am just trying to get a feel of size of a typical rules application. How many low-to-medium complex rules a typical rules application will have ? I understand and agree that it totally depends upon the application and business needs, but I am trying to get a feel of if rules is the correct solution to a problem and if that can be determined by number of rules.
e.g.
if to satisfy a business need, I wrote a rules application and ended up writing say 20 medium-complex rules and in another case, I wrote a rules application and ended up writing say 10,000 low/medium complex rules
which one of these two cases sound like real, logical candidate for a rules based app and why ? Is there a rule of thumb, that "x" number of rules is a good number for an application to qualify under rules technology ?
-abhay
14 years, 8 months
DSL in Drools 5.2
by Saleem Lakhani
Can we combine to different DSL rules in DSLR with a Boolean operator?
Can we combine them with an OR or AND?
e.g; in DSL I have:
a or b = Person(name ==a || name ==b)
c or d= Person(name==c || name ==d)
Can I write in DRL as:
a or b or c or d?
I know combining them as one rule is easier but I have few limitations;
saleem
14 years, 8 months
Deploying Guvnor on a existing repository DB
by maav
Hi!
I'm trying to get Guvnor to deploy on a pre-existing existing DB. The use
case beeing that we wan't to be able to bring up a backup instance of guvnor
in case the primary goes down.
But if a deploy guvnor on a "fresh" DB schema all tables get created along
with trigger and sequences (using Oracle 11).
But when I un-deploy guvnor.war and remove the repository-folder and then
deploy it again I get the following exception:
Caused by: java.sql.SQLException: ORA-00001: unique constraint
(ID_VERIFICATION.G_DEFAULT_BUNDLE_IDX) violated
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at
oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
at
oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
at
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
at
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3476)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmtInternal(ConnectionRecoveryManager.java:371)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmtInternal(ConnectionRecoveryManager.java:298)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmt(ConnectionRecoveryManager.java:261)
at
org.apache.jackrabbit.core.persistence.bundle.ConnectionRecoveryManager.executeStmt(ConnectionRecoveryManager.java:239)
at
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.storeBundle(BundleDbPersistenceManager.java:1207)
... 59 more
What do I need to do to prevent this?
This is my repository.xml:
<?xml version="1.0"?>
<!DOCTYPE Repository
PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit
2.0//EN"
"http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
<Repository>
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
</FileSystem>
<DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
</DataStore>
<Security appName="Jackrabbit">
<SecurityManager
class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
workspaceName="security">
</SecurityManager>
<AccessManager
class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
</AccessManager>
<LoginModule
class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
</LoginModule>
</Security>
<Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>
<Workspace name="${wsp.name}">
<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
</FileSystem>
<PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
</PersistenceManager>
<SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
</SearchIndex>
</Workspace>
<Versioning rootPath="${rep.home}/version">
<FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
</FileSystem>
<PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
</PersistenceManager>
</Versioning>
<SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
</SearchIndex>
</Repository>
--
View this message in context: http://drools.46999.n3.nabble.com/Deploying-Guvnor-on-a-existing-reposito...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 8 months