Re: [rules-users] Building our own UI for Drools
by GPatel@tsys.com
On hosted mode:
I have the same requirement i.e hosted site with lots of external clients using the same site, it is indeed impractical to deploy a guvnor instance for each client. Overall, from what I have researched, there are two things available to segregate rules by external client: categories and packages, but I decided against using them to achieve client segregation. The approach I have arrived on is to launch the guvnor standalone editor from my website, store the brl in my tables (the standalone editor provides javascript hooks to allow retrieving the rule brl/drl once the rule has been written). Effectively, the only thing stored in the guvnor repository will be the model to enable rule authoring. Originally, I was planning on storing the rules in the guvnor repository and using the rest api to list rule packages (prefixed by clientId) in my site. Since I am able to retrieve the brl/drl anyways (via standalone editor javascript hook, or if that feature were not available, then via rest call immediately after rule has been authored), I decided to store the brl/drl in my app db. Since the rules are stored in my tables, I will have full control over client segregation.
I have done a mini-POC to prove that this will work and it seems like it will, unless an expert on this mailing list can point out showstoppers/potential flaws/shortcomings of this approach.
Hope this helps others who are faced with similar situations.
Thanks
G. Patel
----- Original Message -----
From: Jervis Liu [jliu(a)redhat.com]
Sent: 11/16/2011 05:14 PM ZE8
To: rules-users(a)lists.jboss.org
Subject: Re: [rules-users] Building our own UI for Drools
On 2011/11/16 16:37, kapokfly wrote:
> Thanks for the information.
>
> Deploy multiple GUNVOR instances can't resolve our issue as we have
> thousands of companies as our customer, each company will share the common
> part of our applications and meantime they can customize objects/fields they
> have permission with, this will be terrible if we go with the
> separate/dedicate deployment and basically we think that will be not
> manageable...
>
> What we are looking for is, be able to share a common collection of ruleset
> and at the same time, be able to define their custom rules with their
> customization.
At the moment, it is possible to achieve this by using
role-based-authorization in Guvnor. I.e., you create some common
packages that are designed to be shared by everyone. You assign
package-readonly permissions to everyone so that they have read-only
access to these common packages. You can also use Global Area to achieve
same effect. Essentially Global area is a special package that can be
shared by all packages. Then each user has package-admin permission for
their own packages.
The "Workspace" as I mentioned early will provide a more completely
isolated environment for each user when multiple users are sharing one
instance of Guvnor. However we dont have any concrete stories planned
for this yet.
Cheers,
Jervis
> Ivan
>
> -----
> Ivan, your Panda, forever
> --
> View this message in context: http://drools.46999.n3.nabble.com/Building-our-own-UI-for-Drools-tp350884...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you
13 years, 1 month
class loading problems with 5.3.0-Final and 5.4.0-SNAPSHOT
by Mauricio Salatino
Hi guys,
I'm working here trying to find out a little problem that I'm having with
Drools 5.4.0-SNAPSHOT and 5.3.0-Final.
I'm using WSO2 container to deploy a very simple service and when a rule
gets activated the following exception appears (with 5.4.0-SNAPSHOT):
Exception in thread "Thread-44" java.lang.ClassCircularityError:
org/drools/rule/builder/dialect/asm/ConsequenceGenerator
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
at
org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
at
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at
org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:124)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
at
org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
at
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at
test.Rule_request_bed_ede4a687c29740c8bb9f13968941e6a1DefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1229)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:756)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:732)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:234)
at
com.wordpress.salaboy.hospital.HospitalServiceImpl$1.run(HospitalServiceImpl.java:71)
I'm worried to see that I don't have any problems with 5.1.1 but with later
version all throw similar issues.
I will be trying to solve this issue, but if someone has a clue about what
can be happening here, please let me know.
I know that this can be a particular issue with WSO2, but it looks like
something has changed inside drools.
Cheers
--
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jugargentina.org
- Co-Founder @ http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
13 years, 1 month
Guvnor 5.3 : Guided Rule Editor : mixing formula and field constraint in same pattern makes editor crash
by Vincent LEGENDRE
Hi,
As said in the subject mixing formula and field constraint in same pattern makes the guided editor crash.
I had rules in 5.2, which was using such constructions, ie normal constraint for normal tests, and sometime a formula (which transform into in-pattern "eval(...)")
These rules cannot be opened by guvnor 5.3, but compiles.
When trying to rewrite the same rule in 5.3, everything is well until I add a "formula" constraint in a Pattern already having a "normal" constraint (or a normal after a formula).
If I let only one test type, all is fine.
Otherwise, the current condition becomes empty, the action part disappears, and there is no error message in logs. ...
It seems like a bug to me. Agreed ?
I could add my "eval" outside the pattern, but I also use such constructs in some accumulate patterns ... and I don't have any solution for them (except writing all that stuff directly in DRL format ...).
13 years, 1 month
Accumulate / collect
by Bruno Freudensprung
Hi all,
There is something I can't express using "collect" or "accumulate" and I
would like to have your opinion.
Let's imagine I have the following types :
# a country type
* declare Country
name : String
end
*
# a city type holding a reference to its country
* declare City
name : String
country : Country
end
*
Let's imagine I have all Country and City objects into the working memory.
I want to get the set of Countries corresponding to Cities whose name
starts with "X".
I have the impression that I need a kind of (nonexistent right?)
"collect" syntax that would look like the "accumulate" syntax (a kind of
"anonymous" accumulate function):
# meaning I want to collect $country objects and not City objects
$countries : HashSet() from collect (City($name matches "X.*",
$country : country)*, $country*)
Or a home made accumulate function that builds a set of countries:
# custom "buildset" accumulate function
$countries : HashSet() from accumulate (City($name matches "X.*",
$country : country), *buildset*($country))
Do you see any other (possibly out of the box) solution?
Many thanks in advance for your answers,
Best regards,
Bruno.
13 years, 1 month
[Planner] CachedMoveFactory drive to Corrupted undo move
by npiedeloup
Hello,
I'm almost new to Drools Planner, and i run into some problems.
One of them, I really want to understand is that my Planner works well until
i try to use a CachedMoveFactory instead of my MoveFactory, then i've got
"Corrupted undo move" at step 2.
Assigment are my PlanningEntity, Day are facts
My MoveFactory is like this :
for (final Assigment assigment: mySolution.getAllAssigments()) {
for (final Day day : mySolution.getAllDays()) {
moveList.add(new PlanMove(assigment, day));
}
}
And my doMove is like :
final FactHandle factHandle = workingMemory.getFactHandle(assigment);
assigment.setDay(toDay);
workingMemory.update(factHandle, assigment);
The UndoMove is really simple (new PlanMove(assigment, fromDay)) , so I
pretty sure this part is correct.
I have add a false day(future=true) which mean "not plannified yet" and all
assigment start at this day.
I have a rule like :
rule "notPlannified"
when
$assigment: Assigment( day.future )
then
insertLogical(new IntConstraintOccurrence("notPlannified",
ConstraintType.NEGATIVE_SOFT, 50, $assigment));
end
My logs show :
INFO Phase construction heuristic finished: step total (0), time spend
(255), best score (0hard/-18750soft).
DEBUG Step index (0), time spend (2175), score (0hard/-18700soft), new
best score (0hard/-18700soft), accepted move size (1000) for picked step
([A148@[UNAFFECT]] ==> [12/11]).
Someone can explain me what I miss ?
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Planner-CachedMoveFactory-drive-to-Corr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
Preventing re-evaluation on modification of 'output' fact
by Jamie
We're building a fraud detection application that uses rules to analyze
orders and the buyers and recipients on those orders. As rules fire, they
modify an 'output' fact, which is an object whose only intent is to record
the results as rules fire. It's not used in the LHS of any rules other than
to get a handle to it, e.g.:
rule "Rule 001 - Operator Flagged"
enabled (FraudRuleEvaluationHelper.isRuleEnabled("Rule 001 - Operator
Flagged"))
ruleflow-group "orderAnalysis"
lock-on-active
when
$order: OrderFact(operatorFlagged==true)
$results: FraudResultsDTO()
then
modify($results) {
addOrderSuspectReason("O")
};
FraudRuleConsequenceHelper.logRuleFiring($order.getOrderId(), "001");
end
We're finding that as the number of facts increases, the processing team
increases dramatically and I'm wondering if modifying the output fact the
way we do causes the rules to get re-evaluated to see if any activations
should be created or cancelled. Would removing the modify block help
anything? Should we be thinking about this in some other way?
--
View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modificatio...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month