Re: [rules-users] Integration issue : Guvnor with Openldap
by Gayatri Chandak
Hello All,
An update from my side.
We tried modifying the login-config.xml file as below:
<authentication>
<login-module
code="org.jboss.security.auth.spi.LdapAuthenticatorLoginModule"
flag="optional">
<module-option
name="java.naming.provider.url">ldap://test.kalyani.com:389/</module-option>
<module-option name="java.naming.security.protocol">ssl</module-option>
<module-option
name="java.naming.security.principal">cn=DirManager</module-option>
<module-option
name="java.naming.security.credentials">secret</module-option>
<module-option name="searchBase">dc=kijanowski,dc=eu</module-option>
</login-module>
<login-module code="org.jboss.security.auth.spi.LdapExtLoginModule"
flag="required" >
<module-option name="java.naming.factory.initial">
com.sun.jndi.ldap.LdapCtxFactory</module-option>
<module-option
name="java.naming.provider.url">ldap://test.kalyani.com:389/</module-option>
<module-option
name="java.naming.security.authentication">simple</module-option>
<module-option name="bindDN">cn=DirManager,dc=kijanowski,dc=eu
</module-option>
<module-option name="bindCredential">secret</module-option>
<module-option
name="baseCtxDN">ou=People,o=guvnor,dc=kijanowski,dc=eu </module-option>
<module-option name="baseFilter">(uid={0})</module-option>
<module-option
name="rolesCtxDN">ou=Roles,o=guvnor,dc=kijanowski,dc=eu </module-option>
<module-option name="roleFilter">(member={1})</module-option>
<module-option name="roleAttributeID">member</module-option>
<module-option name="roleRecursion">-1</module-option>
<module-option name="roleNameAttributeID">cn</module-option>
<module-option name="roleAttributeIsDN">true</module-option>
<module-option name="searchTimeLimit">5000</module-option>
<module-option name="searchScope">ONELEVEL_SCOPE</module-option>
</login-module>
</ authentication>
</application-policy>
But, still we are not able to connect to the LDAP server
through the login page. We are getting the follwoing error :
[STDOUT] ERROR 15-04 11:59:15,597
(SecurityServiceImpl.java:login:73)
javax.security.auth.login.LoginException: No LoginModules
configured for guvnor
Please let me know if we are missing anything or anything
needs to be changed.
Thanks in advance.
Regards,
Gayatri Chandak
Member-BPM/BRE/BAM Sub Focus Area
TEG-Open Source
Tata Consultancy Services
Yantra Park -(STPI)
2nd Pokharan Road,
Opp HRD Voltas Center,Subash Nagar
Mumbai - 400 601,Maharashtra
India
Ph:- 022-67782556
Mailto: gayatri.chandak(a)tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
From: Gayatri Chandak/MUM/TCS
To: rules-users(a)lists.jboss.org
Date: 04/15/2010 11:02 AM
Subject: Integration issue : Guvnor with Openldap
Sent by: Gayatri Chandak
Hello All,
I am trying to integrate the Guvnor with Openldap, for which I am following
the below link.
http://magazine.redhat.com/2008/08/14/jboss-drools-how-to-tuning-guvnor-p...
The Server starts properly, but it does not recognize the user.
Issue faced:
I have to replace the file based authentication part with the Openldap
code, which is given below.
ldaps://localhost:16636
ssl
cn=DirManager,dc=kijanowski,dc=eu
admin123
ou=People,o=guvnor,dc=kijanowski,dc=eu
(uid={0})
ou=Roles,o=guvnor,dc=kijanowski,dc=eu
(member={1})
cn
-1
ONELEVEL_SCOPE
I have no idea how to write the above code in the xml file.
Can anyone please help me on this?
Attaching the login-config.xml file, please find.
[attachment "login-config.xml" deleted by Gayatri Chandak/TVM/TCS]
Thanks and regards,
Gayatri Chandak
Member-BPM/BRE/BAM Sub Focus Area
TEG-Open Source
Tata Consultancy Services
Yantra Park -(STPI)
2nd Pokharan Road,
Opp HRD Voltas Center,Subash Nagar
Mumbai - 400 601,Maharashtra
India
Ph:- 022-67782556
Mailto: gayatri.chandak(a)tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
=====-----=====-----=====
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
15 years, 11 months
Interact with Drools API over RMI
by Vandewilly
Hello,
Does anyone have any sample of how to interact with Drools API over RMI,
using the jackrabbit framework or similar technology ?
--
Vandewilly Oliveira
15 years, 11 months
Re: [rules-users] Very basic running of drools 5, basic setup and quickstart
by Greg Barton
You don't have to, that was just a suggestion for making an initial project. Just put the source in the typical maven directory structure (java code in src/main/java and rules under src/main/rules) and you'll be good to go. A sample project is attached.
--- On Sun, 4/25/10, Berlin Brown <berlin.brown(a)gmail.com> wrote:
From: Berlin Brown <berlin.brown(a)gmail.com>
Subject: Re: [rules-users] Very basic running of drools 5, basic setup and quickstart
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Sunday, April 25, 2010, 6:26 PM
I am not using Eclipse.
2010/4/25 Greg Barton <greg_barton(a)yahoo.com>
The best documentation to read would be the maven docs:
http://maven.apache.org/
But if you drop the attached pom.xml into a project created by drools' eclipse plugin it'll work fine. type "mvn clean install" from the project home directory and it'll build. (After downloading half the known universe...)
--- On Thu, 4/22/10, Berlin Brown <berlin.brown(a)gmail.com> wrote:
From: Berlin Brown <berlin.brown(a)gmail.com>
Subject: Re: [rules-users] Very basic running of drools 5, basic setup and quickstart
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Thursday, April 22, 2010, 5:11 PM
Is there documentation on how to do this, including a full example.
I saw the pom file, but still don't know the run/compile targets?
2010/4/22 Greg Barton <greg_barton(a)yahoo.com>
Have you ever thought of using maven? Your problem is no doubt with including the transitive dependencies of the drools libraries, which maven would do for you automatically. Here are the jars that were included automatically in a project I compiled with drools-core, drools-compiler, drools-api, all 5.0.1:
antlr-runtime-3.1.1.jar
core-3.4.2.v_883_R34x.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
janino-2.5.15.jar
joda-time-1.6.jar
jsap-2.1.jar
mvel2-2.0.10.jar
This resulted from a dependencies section in the maven pom that had just this in it:
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-api</artifactId>
<version>5.0.1</version>
</dependency>
</dependencies>
So I suggest you give maven a try. It makes this easy. :)
--- On Wed, 4/21/10,
Berlin Brown <berlin.brown(a)gmail.com> wrote:
From: Berlin Brown <berlin.brown(a)gmail.com>
Subject: [rules-users] Very basic running of drools 5, basic setup and quickstart
To: rules-users(a)lists.jboss.org
Date: Wednesday, April 21, 2010, 12:54 AM
Is there a more comprehensive quick start for drools 5. I was attempting to run the simple Hello World .drl rule but I wanted to do it through an ant script, possibly with just javac/java:
I get the following error: Note: I don't am running completely without Eclipse or any other IDE:
test:
[java] Exception in thread "main" org.drools.RuntimeDroolsException: Unable to load d
ialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule
.builder.dialect.java.JavaDialectConfiguration'
[java] at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
erConfiguration.java:274)
[java] at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurati
onMap(PackageBuilderConfiguration.java:259)
[java] at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConf
iguration.java:176)
[java] at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderCo
nfiguration.java:153)
[java] at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
[java] at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142)
[java] at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilde
r(KnowledgeBuilderProviderImpl.java:29)
[java] at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowledg
eBuilderFactory.java:29)
[java] at org.berlin.rpg.rules.Rules.rules(Rules.java:33)
[java] at org.berlin.rpg.rules.Rules.main(Rules.java:73)
[java] Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the
classpath
[java] at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompil
er(JavaDialectConfiguration.java:94)
[java] at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(Java
DialectConfiguration.java:55)
[java] at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
erConfiguration.java:270)
[java] ... 9 more
[java] Java Result: 1
...
...
I do include the following libraries with my javac and java target:
<path id="classpath">
<pathelement location="${lib.dir}" />
<pathelement location="${lib.dir}/drools-api-5.0.1.jar" />
<pathelement location="${lib.dir}/drools-compiler-5.0.1.jar" />
<pathelement location="${lib.dir}/drools-core-5.0.1.jar" />
<pathelement location="${lib.dir}/janino-2.5.15.jar" />
</path>
Here is the Java code that is throwing the error. I commented out the java.compiler code, that didn't work either.
public void rules() {
/*
final Properties properties = new Properties();
properties.setProperty( "drools.dialect.java.compiler", "JANINO" );
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( properties );
JavaDialectConfiguration javaConf = (JavaDialectConfiguration)
cfg.getDialectConfiguration( "java" );
*/
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
// this will parse and compile in one step
kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl", Rules.class), ResourceType.DRL);
// Check the builder for errors
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors().toString());
throw new RuntimeException("Unable to compile \"HelloWorld.drl\".");
}
// Get the compiled packages (which are serializable)
final Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();
// Add the packages to a knowledgebase (deploy the knowledge packages).
final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.setGlobal("list", new ArrayList<Object>());
ksession.addEventListener(new DebugAgendaEventListener());
ksession.addEventListener(new DebugWorkingMemoryEventListener());
// Setup the audit logging
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "log/helloworld");
final Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
ksession.insert(message);
ksession.fireAllRules();
logger.close();
ksession.dispose();
}
...
Here I don't think Ant is relevant because I have fork set to true:
<target name="test" depends="compile">
<java classname="org.berlin.rpg.rules.Rules" fork="true">
<classpath refid="classpath.rt" />
<classpath>
<pathelement location="${basedir}" />
<pathelement location="${build.classes.dir}" />
</classpath>
</java>
</target>
The error is thrown at line 1.
Basically, I haven't done anything except call
final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
I am running with Windows XP, Java6, and within Ant.1.7.
--
Berlin Brown (berlin dot brown at gmail.com)
http://botnode.com
http://berlinbrowndev.blogspot.com/
-----Inline Attachment Follows-----
_______________________________________________
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
--
Berlin Brown (berlin dot brown at gmail.com)
http://botnode.com
http://berlinbrowndev.blogspot.com/
-----Inline Attachment Follows-----
_______________________________________________
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
--
Berlin Brown (berlin dot brown at gmail.com)
http://botnode.com
http://berlinbrowndev.blogspot.com/
-----Inline Attachment Follows-----
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 11 months
Re: [rules-users] Very basic running of drools 5, basic setup and quickstart
by Greg Barton
The best documentation to read would be the maven docs:
http://maven.apache.org/
But if you drop the attached pom.xml into a project created by drools' eclipse plugin it'll work fine. type "mvn clean install" from the project home directory and it'll build. (After downloading half the known universe...)
--- On Thu, 4/22/10, Berlin Brown <berlin.brown(a)gmail.com> wrote:
From: Berlin Brown <berlin.brown(a)gmail.com>
Subject: Re: [rules-users] Very basic running of drools 5, basic setup and quickstart
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Thursday, April 22, 2010, 5:11 PM
Is there documentation on how to do this, including a full example. I saw the pom file, but still don't know the run/compile targets?
2010/4/22 Greg Barton <greg_barton(a)yahoo.com>
Have you ever thought of using maven? Your problem is no doubt with including the transitive dependencies of the drools libraries, which maven would do for you automatically. Here are the jars that were included automatically in a project I compiled with drools-core, drools-compiler, drools-api, all 5.0.1:
antlr-runtime-3.1.1.jar
core-3.4.2.v_883_R34x.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
janino-2.5.15.jar
joda-time-1.6.jar
jsap-2.1.jar
mvel2-2.0.10.jar
This resulted from a dependencies section in the maven pom that had just this in it:
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-api</artifactId>
<version>5.0.1</version>
</dependency>
</dependencies>
So I suggest you give maven a try. It makes this easy. :)
--- On Wed, 4/21/10,
Berlin Brown <berlin.brown(a)gmail.com> wrote:
From: Berlin Brown <berlin.brown(a)gmail.com>
Subject: [rules-users] Very basic running of drools 5, basic setup and quickstart
To: rules-users(a)lists.jboss.org
Date: Wednesday, April 21, 2010, 12:54 AM
Is there a more comprehensive quick start for drools 5. I was attempting to run the simple Hello World .drl rule but I wanted to do it through an ant script, possibly with just javac/java:
I get the following error: Note: I don't am running completely without Eclipse or any other IDE:
test:
[java] Exception in thread "main" org.drools.RuntimeDroolsException: Unable to load d
ialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule
.builder.dialect.java.JavaDialectConfiguration'
[java] at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
erConfiguration.java:274)
[java] at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurati
onMap(PackageBuilderConfiguration.java:259)
[java] at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConf
iguration.java:176)
[java] at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderCo
nfiguration.java:153)
[java] at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
[java] at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142)
[java] at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilde
r(KnowledgeBuilderProviderImpl.java:29)
[java] at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowledg
eBuilderFactory.java:29)
[java] at org.berlin.rpg.rules.Rules.rules(Rules.java:33)
[java] at org.berlin.rpg.rules.Rules.main(Rules.java:73)
[java] Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the
classpath
[java] at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompil
er(JavaDialectConfiguration.java:94)
[java] at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(Java
DialectConfiguration.java:55)
[java] at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
erConfiguration.java:270)
[java] ... 9 more
[java] Java Result: 1
...
...
I do include the following libraries with my javac and java target:
<path id="classpath">
<pathelement location="${lib.dir}" />
<pathelement location="${lib.dir}/drools-api-5.0.1.jar" />
<pathelement location="${lib.dir}/drools-compiler-5.0.1.jar" />
<pathelement location="${lib.dir}/drools-core-5.0.1.jar" />
<pathelement location="${lib.dir}/janino-2.5.15.jar" />
</path>
Here is the Java code that is throwing the error. I commented out the java.compiler code, that didn't work either.
public void rules() {
/*
final Properties properties = new Properties();
properties.setProperty( "drools.dialect.java.compiler", "JANINO" );
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( properties );
JavaDialectConfiguration javaConf = (JavaDialectConfiguration)
cfg.getDialectConfiguration( "java" );
*/
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
// this will parse and compile in one step
kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl", Rules.class), ResourceType.DRL);
// Check the builder for errors
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors().toString());
throw new RuntimeException("Unable to compile \"HelloWorld.drl\".");
}
// Get the compiled packages (which are serializable)
final Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();
// Add the packages to a knowledgebase (deploy the knowledge packages).
final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.setGlobal("list", new ArrayList<Object>());
ksession.addEventListener(new DebugAgendaEventListener());
ksession.addEventListener(new DebugWorkingMemoryEventListener());
// Setup the audit logging
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "log/helloworld");
final Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
ksession.insert(message);
ksession.fireAllRules();
logger.close();
ksession.dispose();
}
...
Here I don't think Ant is relevant because I have fork set to true:
<target name="test" depends="compile">
<java classname="org.berlin.rpg.rules.Rules" fork="true">
<classpath refid="classpath.rt" />
<classpath>
<pathelement location="${basedir}" />
<pathelement location="${build.classes.dir}" />
</classpath>
</java>
</target>
The error is thrown at line 1.
Basically, I haven't done anything except call
final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
I am running with Windows XP, Java6, and within Ant.1.7.
--
Berlin Brown (berlin dot brown at gmail.com)
http://botnode.com
http://berlinbrowndev.blogspot.com/
-----Inline Attachment Follows-----
_______________________________________________
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
--
Berlin Brown (berlin dot brown at gmail.com)
http://botnode.com
http://berlinbrowndev.blogspot.com/
-----Inline Attachment Follows-----
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 11 months
AUTO: Nilima R is out of the office (returning 05/03/2010)
by Nilima R
I am out of the office until 05/03/2010.
Note: This is an automated response to your message "rules-users Digest,
Vol 41, Issue 111" sent on 4/23/10 20:00:16.
This is the only notification you will receive while this person is away.
=====-----=====-----=====
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
15 years, 11 months
Drools Flow: Another problem with Human Task
by HMandic
Hi,
I need some help here.
I have a simple process with one human task. That human task work item has
all the necessary fields filled (actorid, id, name, etc.). When I start that
process it gets to that human task and fills everything it needs in the
database (Postgres) through hibernate. Up until here it works fine.
But then when I need to get a list of tasks for some particular user it
breaks because the task list is empty.
The code looks like this:
*******************************************************************************
BlockingTaskSummaryResponseHandler responseHandler = new
BlockingTaskSummaryResponseHandler();
client.getTasksAssignedAsPotentialOwner("thatUserOfMine", "en-UK",
responseHandler);
List<TaskSummary> tasks = responseHandler.getResults();
TaskSummary task = tasks.get(0);
*******************************************************************************
In that last line I get java.lang.IndexOutOfBoundsException, of course...
Now here's the problem - hibernate generates the following SQL:
*******************************************************************************
[LOG MESSAGE] Message receieved on server :
QueryTasksAssignedAsPotentialOwner
select
task0_.id as col_0_0_,
i18ntext4_.text as col_1_0_,
subjects3_.text as col_2_0_,
i18ntext5_.text as col_3_0_,
task0_.status as col_4_0_,
task0_.priority as col_5_0_,
task0_.skipable as col_6_0_,
task0_.actualOwner_id as col_7_0_,
task0_.createdBy_id as col_8_0_,
task0_.createdOn as col_9_0_,
task0_.activationTime as col_10_0_,
task0_.expirationTime as col_11_0_
from
test1.Task task0_
left outer join
test1.OrganizationalEntity user1_ on task0_.createdBy_id=user1_.id
left outer join
test1.OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id
left outer join
test1.I18NText subjects3_ on task0_.id=subjects3_.Task_Subjects_Id
!!! inner join
test1.OrganizationalEntity user7_ on task0_.actualOwner_id=user7_.id
inner join
test1.OrganizationalEntity user8_ on task0_.createdBy_id=user8_.id
cross join
test1.I18NText i18ntext4_
cross join
test1.I18NText i18ntext5_
cross join
test1.OrganizationalEntity organizati6_
where
organizati6_.id = 'thatUserOfMine'
and (organizati6_.id in (select potentialo9_.entity_id from
test1.PeopleAssignments_PotentialOwners potentialo9_ where
task0_.id=potentialo9_.task_id))
and i18ntext4_.language = 'en-UK'
and (i18ntext4_.id in (select names10_.id from test1.I18NText names10_
where task0_.id=names10_.Task_Names_Id))
and (subjects3_.language = 'en-UK' or (select
count(subjects11_.Task_Subjects_Id) from test1.I18NText subjects11_ where
task0_.id=subjects11_.Task_Subjects_Id) = 0)
and (i18ntext5_.language = 'en-UK'
and (i18ntext5_.id in (select descriptio12_.id from test1.I18NText
descriptio12_ where task0_.id=descriptio12_.Task_Descriptions_Id))
or (select count(descriptio13_.Task_Descriptions_Id) from
test1.I18NText descriptio13_ where
task0_.id=descriptio13_.Task_Descriptions_Id) = 0)
and (task0_.status in ('Created' , 'Ready' , 'Reserved' , 'InProgress' ,
'Suspended'))
and (task0_.expirationTime is null)
;
*******************************************************************************
You will notice the inner join with '!!!' in front of it. That's the reason
why this list is always empty, because at this stage of human task there is
no actual owner, that field is NULL. I've tried different versions of
orm.xml (from 5.0.1, 5.1.0M1 and the latest from trunk) but they all produce
the same error.
Can someone please point out what I'm doing wrong (I'm also not very good
with hibernate).
--
View this message in context: http://n3.nabble.com/Drools-Flow-Another-problem-with-Human-Task-tp724086...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
Expert: Modify the result of a collect Operation
by Jörg Herbst
Hi,
I'm trying to change the result of a collect operation, is this possible?
This is my sample rule:
rule "Select the only remaining value for
each feature Key"
when
# Check all not selected features
feature : ExpertFeature(selected==false)
# if there is one enable feature select
this one
list : ArrayList (size == 1) from
collect( ExpertFeature(disabled == false, featureKey==feature.featureKey,
selected==false) )
then
# this is not working
modify( list ) {setSelected(true);}
end
Thanks
Joerg
15 years, 11 months
Drools Flow: API for Timers
by tolitius
Hey Drools Crowd,
1. Why is there no simple API to start the Timer(s)?
e.g. ksession.startTimers()
that would encapsulate a low level thread spawning:
new Thread(new Runnable() {
public void run() {
ksession.fireUntilHalt();
}
}).start();
2. Why do these timers _need_ to started by developer? Framework already
knows there are timers, and should start them on "ksession.startProcess".
/Anatoly
--
View this message in context: http://n3.nabble.com/Drools-Flow-API-for-Timers-tp732299p732299.html
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
Very basic running of drools 5, basic setup and quickstart
by Berlin Brown
Is there a more comprehensive quick start for drools 5. I was attempting to
run the simple Hello World .drl rule but I wanted to do it through an ant
script, possibly with just javac/java:
I get the following error: Note: I don't am running completely without
Eclipse or any other IDE:
test:
[java] Exception in thread "main" org.drools.RuntimeDroolsException:
Unable to load d
ialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule
.builder.dialect.java.JavaDialectConfiguration'
[java] at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
erConfiguration.java:274)
[java] at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurati
onMap(PackageBuilderConfiguration.java:259)
[java] at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConf
iguration.java:176)
[java] at
org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderCo
nfiguration.java:153)
[java] at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
[java] at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142)
[java] at
org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilde
r(KnowledgeBuilderProviderImpl.java:29)
[java] at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowledg
eBuilderFactory.java:29)
[java] at org.berlin.rpg.rules.Rules.rules(Rules.java:33)
[java] at org.berlin.rpg.rules.Rules.main(Rules.java:73)
[java] Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar
is not in the
classpath
[java] at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompil
er(JavaDialectConfiguration.java:94)
[java] at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(Java
DialectConfiguration.java:55)
[java] at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuild
erConfiguration.java:270)
[java] ... 9 more
[java] Java Result: 1
...
...
I do include the following libraries with my javac and java target:
<path id="classpath">
<pathelement location="${lib.dir}" />
<pathelement location="${lib.dir}/drools-api-5.0.1.jar" />
<pathelement location="${lib.dir}/drools-compiler-5.0.1.jar" />
<pathelement location="${lib.dir}/drools-core-5.0.1.jar" />
<pathelement location="${lib.dir}/janino-2.5.15.jar" />
</path>
Here is the Java code that is throwing the error. I commented out the
java.compiler code, that didn't work either.
public void rules() {
/*
final Properties properties = new Properties();
properties.setProperty( "drools.dialect.java.compiler", "JANINO" );
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration(
properties );
JavaDialectConfiguration javaConf = (JavaDialectConfiguration)
cfg.getDialectConfiguration( "java" );
*/
final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
// this will parse and compile in one step
kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl",
Rules.class), ResourceType.DRL);
// Check the builder for errors
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors().toString());
throw new RuntimeException("Unable to compile
\"HelloWorld.drl\".");
}
// Get the compiled packages (which are serializable)
final Collection<KnowledgePackage> pkgs =
kbuilder.getKnowledgePackages();
// Add the packages to a knowledgebase (deploy the knowledge
packages).
final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
final StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
ksession.setGlobal("list", new ArrayList<Object>());
ksession.addEventListener(new DebugAgendaEventListener());
ksession.addEventListener(new DebugWorkingMemoryEventListener());
// Setup the audit logging
KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "log/helloworld");
final Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
ksession.insert(message);
ksession.fireAllRules();
logger.close();
ksession.dispose();
}
...
Here I don't think Ant is relevant because I have fork set to true:
<target name="test" depends="compile">
<java classname="org.berlin.rpg.rules.Rules" fork="true">
<classpath refid="classpath.rt" />
<classpath>
<pathelement location="${basedir}" />
<pathelement location="${build.classes.dir}" />
</classpath>
</java>
</target>
The error is thrown at line 1.
Basically, I haven't done anything except call
final KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
I am running with Windows XP, Java6, and within Ant.1.7.
--
Berlin Brown (berlin dot brown at gmail.com)
http://botnode.com
http://berlinbrowndev.blogspot.com/
15 years, 11 months