Insert a fact into drools server from a web application or java application
by kkelleyjr
Ok, I have read the documentation like a million times. I have looked at all
the examples. Yet I still can not figure out how to add a fact to the drools
server ksession1 from a web application or a java application. I have got
the server to work. I have even got the soapUI to work. now I want to add a
fact from my own client.
My issue is that I need to add a facts that has maps and list in the pojo.
how can I just add the pojo to the ksession1? Is there an example that is
out there that I have not found?
It seems simple, but I just do not understand... can someone provide some
additional help, please?
--
View this message in context: http://drools.46999.n3.nabble.com/Insert-a-fact-into-drools-server-from-a...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
Upgrade from jbpm 5.1 to 5.2
by houghvw
Hi,
I am looking for documentation to upgrade from drools jbpm 5.1 to 5.2. It
seems that the variable persistence strategies have been replaced with a
object marshaling strategy architecture. I can't find documentation
regarding this.
I am using jpa persistence for my flow state. Is there some sort of
migration script to migrate the jbpm domain model from 5.1 to 5.2.
Regards
Hough
--
View this message in context: http://drools.46999.n3.nabble.com/Upgrade-from-jbpm-5-1-to-5-2-tp3277185p...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
Websphere 7.0 and Drools Guvnor 5.2 Integration
by hpham1067
I've Guvnor working with Websphere 7.0 pretty well. That said, I've having
problem using JAAS with WebsPhere WSLogin login implementation module, i.e.
com.ibm.ws.security.common.auth.module.WSLoginModuleImpl. It seems that
Guvnor will accept the any user authentication if you specify a blank
password at the login screen. If you type in a wrong password in it work as
expected but a blank or no password Guvnor will let the user login no
question ask. Has anyone encounter this issue. Thanks in advance for your
help.
- Henry
--
View this message in context: http://drools.46999.n3.nabble.com/Websphere-7-0-and-Drools-Guvnor-5-2-Int...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
Are if/then rules possible?
by Matthew Erler
In Drools 5 is it possible for a rule to call one of two specific rules depending on whether the condition in the first rule evaluates to true or false? For example lets say that there are three rules: A, B, and C. A is evaluated and if its condition is True then execute rule B, otherwise execute rule C. B and C must not be executed on their own , but only by A. I haven't been able to find and examples or tutorials on this so if it's possible an example would be greatly appreciated. Thank you.
14 years, 4 months
Re: [rules-users] DroolsCompilerAntTask task to build jBPM5 package
by lhorton
that class is in drools-compiler-5.2.0.Final.jar
I set up my path using pathelement instead of fileset, and compile worked
with these jars (droolsPath is of course set for my own environment):
<path id="drools.classpath" >
<pathelement location="${droolsPath}/drools-ant-5.2.0.Final.jar" />
<pathelement location="${droolsPath}/knowledge-api-5.2.0.Final.jar" />
<pathelement location="${droolsPath}/drools-core-5.2.0.Final.jar" />
<pathelement location="${droolsPath}/drools-compiler-5.2.0.Final.jar" />
<pathelement
location="${droolsPath}/drools-decisiontables-5.2.0.Final.jar" />
<pathelement location="${droolsPath}/drools-templates-5.2.0.Final.jar" />
<pathelement location="${droolsPath}/antlr-2.7.7.jar" />
<pathelement location="${droolsPath}/antlr-3.3.jar" />
<pathelement location="${droolsPath}/antlr-runtime-3.3.jar" />
<pathelement location="${droolsPath}/ecj-3.5.1.jar" />
<pathelement location="${droolsPath}/jxl-2.6.10.jar" />
<pathelement location="${droolsPath}/mvel2-2.1.0.drools2.jar" />
</path>
--
View this message in context: http://drools.46999.n3.nabble.com/DroolsCompilerAntTask-task-to-build-jBP...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
Guvnor 5.2 calling methods from service..
by pamerida
Hi everyone, Im trying to call a method of a service in the LHS Im using
Guvnor 5.2, but in the drop down menu I cant see all the methods declared on
the service...
http://drools.46999.n3.nabble.com/file/n3275884/method.jpg
my service code is this
public class RulesSvcImpl implements RulesSvc {
protected Crud crud;
protected Finder finder;
public GlnNaviera findGlnNavieraByCodigoInterno(String pCodigo
) throws FinderException {
DetachedCriteria criteria =
DetachedCriteria.forClass(GlnNaviera.class);
if (StringUtils.isEmpty(pCodigo))
throw new FinderException("El Codigo Interno
ingresado esta vacio.");
criteria.add(Restrictions.eq("codigoInterno", pCodigo));
criteria.add(Restrictions.eq("estatus", "A"));
Collection result = finder.findByCriteria(criteria);
if (!result.isEmpty())
return (GlnNaviera) result.iterator().next();
return null;
}
public boolean existsGlnNaviera(String pCodigo) throws
FinderException {
if (findGlnNavieraByCodigoInterno(pCodigo) == null)
return false;
return true;
}
public Aduana findAduanaByGln(String pGln) throws FinderException {
DetachedCriteria criteria =
DetachedCriteria.forClass(Aduana.class);
if (StringUtils.isEmpty(pGln))
throw new FinderException("El Gln ingresado esta
vacio.");
criteria.add(Restrictions.eq("gln", pGln));
Collection result = finder.findByCriteria(criteria);
if (!result.isEmpty())
return (Aduana) result.iterator().next();
return null;
}
public Integer prueba() throws FinderException{
return 569;
}
/***************setters and getters*************/
As seen above there are four methods, and I only get to see one of them.. is
this because they have parameters??, how can I call this methods from the
LHS... thanks so much for your help..
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-2-calling-methods-from-service...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
To accumulate or not to accumulate
by Bruno Freudensprung
Hello,
I am trying to implement rules handling "Sentence", "ManualAnnotation"
objects (imagine someone highligthing words of the document). Basically
"Sentence" objects have "start" and "end" positions (fields) into the
text of a document, and they are Comparable according to their location
into the document.
I need to write rules using the notion "window of consecutive sentences".
Basically I am not very interested by those "SentenceWindow" objects, I
just need them to define a kind of proximity between "ManualAnnotation"
objects.
What I eventually need in the "when" of my rule is something like:
when
... maybe something creating the windows
a1 : ManualAnnotation ()
a2 : ManualAnnotation (this != a1)
SentenceWindow (this includes a1, this includes a2)
then
... do something with a1 and a2 since they are "close" to each other
end
As I don't know the "internals" of Drools, I would like to have your
opinion about what the best "idiom":
* create all SentenceWindow objects and insert them in the working
memory, then write rules against all the facts (SentenceWindow and
ManualAnnotation)
* implement an accumulator that will create a list of
SentenceWindow object
The first option could look like:
|||rule "Create sentence windows"
when
# find 3 consecutive sentences
s1 : Sentence()
s2 : Sentence(this > s1)
s3 : Sentence(this > s2)
not Sentence(this != s2 && > s1 && < s3)
then
SentenceWindow swindow = new SentenceWindow();
swindow.setStart(s1.getStart());
swindow.setTheend(s3.getEnd());
insert(swindow);
end|
... Then use the first rule "as is".
The accumulator option could look like (I am not really sure the syntax
is correct) :
when
*$result : ArrayList() from accumulate ( $s: Sentence(), buildwindows($s))*
a1 : ManualAnnotation ()
a2 : ManualAnnotation (this != a1)
*SentenceWindows (this includes a1, this includes a2) **from $result*
then
... do something with a1 and a2 since they are "close" to each other
end
Is it possible to decide if one way is best than the other?
And one last question: it is possible to "parametrize" an accumulator
(in order to provide the number of sentences that should be put in the
windows)?
I mean something like:
when
$result : ArrayList() from accumulate ( $s: Sentence(),
*buildwindows(3,* $s))
Thanks in advance for you insights,
Best regards,
Bruno.
14 years, 4 months
Iterative diagnosis - how to determine what is the next best fact?
by Kal
Hi,
I am new to Drools. I read the documentation and I looked at the examples,
but I still not sure how to solve this problem:
1) Kind: iterative diagnosis
Rules:
if (A, B and C) then print ("Solution 1")
if (A, B and not C) then print ("Solution 2")
if (A, D and E) then print ("Solution 3")
and so on...
The entry should be something like this:
* no facts are know
* user answers a question (lets say A = true), I update the Statefull
session and fire the rules
* system chooses a unknow fact based on condition for the best incomplete
rule. In this case, it would be B (as it knows A, but it doesn't know B or
C)
* user answers a new question (B = false), I update the session + fireRules
* system now knows that rule 1 (A, B and C) is not possible. It also knows
that rule 2 (A, B and not C) is not possible. So, it chooses the second
condition on rule 3 (A, D and E), which is: what is D?
* user answers a new question (D = true)
....
* user answers a new question (E= true)
* system prints: Solution 3!
My big question: can I extract from the working memory or rule manager or
the agenda a list of the rules that are 'almost' good to fire, but that
still requires some of its conditions to be know (by inserting facts)?
Thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/Iterative-diagnosis-how-to-determine-wh...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months