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.
13 years, 3 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.
13 years, 3 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.
13 years, 3 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.
13 years, 3 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.
13 years, 3 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.
13 years, 3 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.
13 years, 3 months
Fw: Guvnor Sample Rule
by Sumeet Karawal
Hi
For this I saved the schema (change-set-1.0.0.xsd) on my local machine and
gave the path in the ChangeSet.xml
Now its working fine...
Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
----- Forwarded by Sumeet Karawal/MUM/TCS on 08/22/2011 03:44 PM -----
From: Sumeet Karawal <sumeet.karawal(a)tcs.com>
To: rules-users(a)lists.jboss.org
Date: 08/18/2011 06:24 PM
Subject: [rules-users] Guvnor Sample Rule
Sent by: rules-users-bounces(a)lists.jboss.org
Hi,
I am trying to create rule in Guvnor and runnig it in Java Application on
Eclipse.
I have gone through the mortgages example provided in the distribution. I
am not sure that I am doing it correctly The steps I did are as follows :
1) Uploaded a POJO jar in Guvnor
2) Created a rule for checking the value of POJO data member
3) Built the package
4) Downloaded the ChangeSet.xml provided
5) Imported that ChangeSet.xml in Eclipse project under com.test package.
6) Created KnowledgeBase and fired the rules
My POJO :
package com.test;
public class CardHolder {
private int accno;
private double discount;
public int getAccno() {
return accno;
}
public void setAccno(int accno) {
this.accno = accno;
}
public double getDiscount() {
return discount;
}
public void setDiscount(double discount) {
this.discount = discount;
}
}
My Rule Running Class :
package com.test;
import org.drools.KnowledgeBase;
import org.drools.agent.KnowledgeAgent;
import org.drools.agent.KnowledgeAgentFactory;
import org.drools.io.Resource;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
public class Discount_Provider {
public static void main(String[] args) {
CardHolder c1 = new CardHolder();
c1.setAccno(1005);
try{
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
ksession.insert(c1);
ksession.fireAllRules();
System.out.println("The discount applied is : "+
c1.getDiscount());
}
catch (Exception ex)
{
System.out.println("Exception is :
"+ex);
}
}
private static KnowledgeBase readKnowledgeBase()
{
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent
("DiscAgent");
Resource changeset = ResourceFactory.newClassPathResource
("com/test/ChangeSet.xml");
kagent.applyChangeSet(changeset);
KnowledgeBase kbase = kagent.getKnowledgeBase();
kagent.dispose();
return kbase;
}
}
My Rule Content :
1.|rule "Discount_CardHolder"
2.| dialect "mvel"
3.| when
4.| $c : CardHolder( accno > 1001 )
5.| then
6.| $c.setDiscount( 10 );
7.| update( $c );
8.|end
Link from where I download the ChangeSet from Guvnor :
Change Set:
|-------------------------------------------------------------------------------------------------------------------------------------------->
|
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Test...
|
|-------------------------------------------------------------------------------------------------------------------------------------------->
>-------------|
|(Embedded |
|image moved |
|to file: |
|pic19477.gif)|
>-------------|
Contents of ChangeSet.xml :
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'
>
<add>
<resource
source='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Test...'
type='PKG' />
</add>
</change-set>
Errors that I get :
(null: 3, 175): schema_reference.4: Failed to read schema document
'http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
(null: 3, 175): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 4, 10): schema_reference.4: Failed to read schema document
'http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
(null: 5, 130): schema_reference.4: Failed to read schema document
'http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
The discount applied is : 0.0
I am not able to get what should be done to make it run properly. Earlier
also I had tried to do this but faced many issues. By referring the
Mortgages example I tried to create the calling class. It would be very
helpful if some body could help me on this.
Thanks & Regards,
Sumeet
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
[attachment "pic19477.gif" deleted by Sumeet Karawal/MUM/TCS]
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
13 years, 3 months