drools consequence and dialect
by domingo
I have one simple rule, just check the boolean attribute of the object and
print the value of the boolean, that simple rule. I am using java as my rule
dialect. I found something interesting while debugging.
1. When i read the drl file from the local file stream I found the
following...
getDialect ::: java
getConsequence :::
my.test.package.name.TestOne.Rule_boolean_test_rule_0DefaultConsequenceInvoker@b3a21684
2. when i read the same drl from the guvnor I found the following...
getDialect ::: mvel
getConsequence ::: org.drools.base.mvel.MVELConsequence@67bc67bc
Here is is my doubt...since i use the same rule file and 'java' as dialect
why the consequence and dialect are diffrence from ocal file stream.
If anyone clear this doubt will be greatly appreciated.
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/drools-consequence-and-dialect-tp360546...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 2 months
Big BPMN2 processes are dificult to watch/edit inside Guvnor?
by jwest
Hi there,
We imported a fairly big BPMN2 process inside Guvnor, but the only way to
reach/watch some parts of the process is through zooming out the model.
Unfortunately, by then, the process is too small to be read/edited. The
yellow arrows at the edges that allow to increase the canvas size don't seem
to help us. Ideally, we would just like to be able to scroll up/down and
sideways through the whole BPMN2 process without zooming it out, but the
scroll bars seem to be limited to a small area. Is there a way to change the
scroll bars limits?
Cheers,
--
View this message in context: http://drools.46999.n3.nabble.com/Big-BPMN2-processes-are-dificult-to-wat...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 2 months
Action
by Alan Ma
Hi Drools Rulers,
I am new to drools and I've configured a rule with the following:
------------------------------------------------------------------------
rule "my rules"
ruleflow-group "nike"
no-loop true
when
$nikeShoe : NikeShoe() from shoeManager.getNikeShoe(xxxx)
then
xxxx
end
------------------------------------------------------------------------
When I run rule group "Adidas", the getNikeShoe() query in group "nike" is executed. Although I did NOT invoke the rule group "nike" when executing rules, the shoeManager. getNikeShoe () call is always executed. Seems somehow the condition is pre-checked by drools somehow. Anyone could please share what I did wrong? I definitely don't want to invoke group "nike" when executing group "Adidas".
Thanks in advance!
Alan M.
________________________________
CONFIDENTIALITY NOTICE: The information contained in this message is intended only for the recipient and may contain information that is confidential. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient; please be aware that any dissemination, forwarding, printing, copying, disclosure or distribution of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by replying to the message and deleting all copies, including attachments, from your system.
14 years, 2 months
Decision Tables Examples
by Juanker Atina
Hi there,
I want to try some more examples of decision tables.
- I have tried with the example from eclipse (drools plugin -> create new
decision table)
- TeamAllocationExample.xls and CheckAccepted.xls too (easy to find on
google).
But all of them are created in horizontal way (each rule is one row). Could
you please tell me where can i find vertical way examples ?
As i'read it could be possible (see
http://www.slideshare.net/manstis/buenos-aires-decision-table-presentation)
but i can't find any example out there.
Thanks.
14 years, 2 months
Guided Rule Editor doesn't list no-setter-fields if a fact is annotated
by Toshiya Kobayashi
Hello,
In Guvnor 5.3.0, I can use CEP feature support in Guided Rule Editor after uploading a class by "Upload POJO Model jar" and annotating it in "New Declarable Mode".
1. | declare TestPojo
2. | @role(value = event)
3. | end
But if some fields of the POJO class have only getter methods, Guided Rule Editor won't list those fields in "Modify constraints" popup. (if a field has a setter method, it will be listed)
public class TestPojo {
private String name;
public TestPojo() {}
public String getName() { return name; }
// public void setName(String name) { this.name = name; }
}
Am I missing something? If it's not an expected behaviour, I will raise a JIRA.
Cheers,
Toshiya
14 years, 2 months
adding all packages to kbuilder in web application geting errors...
by srinivasasanda
packagelisturl=http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/webdav/packages
(which show the list of package ==>
Contents of this Folder:
defaultPackage
mortgages
sample
demo
Storeing the result in buffered reader, and manuplateing the eachline and
adding all the package to the kbuilder()
packageurl=http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/package/
...............................................................................................................
System.out.println(GlobalConfig.getConfigParameterValue("packagelisturl"));
URL packages = new
URL(GlobalConfig.getConfigParameterValue("packagelisturl"));
URLConnection yc = packages.openConnection();
BufferedReader in = new BufferedReader(new
InputStreamReader(yc.getInputStream()));
String inputLine;
inputLine = in.readLine();
System.out.print("inputLine"+inputLine);
while ((inputLine = in.readLine()) != null)
{
System.out.print("inputLine"+inputLine);
String
urlstr=GlobalConfig.getConfigParameterValue("packageurl")+""+inputLine+"/LATEST";
URL url = new URL(urlstr);
UrlResource urlResource =
(UrlResource)ResourceFactory.newUrlResource(url);
urlResource.setBasicAuthentication("enabled");
urlResource.setUsername("admin");
urlResource.setPassword("admin");
_kbuilder.add(urlResource, ResourceType.PKG);
System.out.println("added pacakges into _kbuilder"+urlstr);
}
in.close();
......................................................... some other code
to fire rules.....
This code works fine with simple java application and geting the
result.
but when i try to use this in some web application , the packages are
not adding to kbuilder and it shows the following error
2011-12-21 20:31:01,819 INFO [STDOUT] (http-127.0.0.1-8080-5) after
creating kbuilder
2011-12-21 20:31:01,819 INFO [STDOUT] (http-127.0.0.1-8080-5)
http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.G...
2011-12-21 20:31:01,819 INFO [STDOUT] (http-127.0.0.1-8080-4) INFO 21-12
20:31:01,819 (NilAuthenticator.java:authenticate:35) All users are guests.
2011-12-21 20:31:01,819 INFO [STDOUT] (http-127.0.0.1-8080-4) INFO 21-12
20:31:01,819 (RepositoryServlet.java:allowUser:114) null authenticated for
rest api
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5)
inputLineContents of this Folder:
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5)
inputLinedefaultPackage
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5) added
pacakges into
_kbuilderhttp://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5) Provider
org.drools.io.impl.ResourceProviderImpl could not be set.
2011-12-21 20:31:01,835 ERROR [org.in.treetech.bss.common.cache]
(http-127.0.0.1-8080-5) RuleEngine 234 Provider
org.drools.io.impl.ResourceProviderImpl could not be set.
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5) After adding
packages
2011-12-21 20:31:01,835 ERROR [org.in.treetech.bss.common.cache]
(http-127.0.0.1-8080-5) RuleEngine 173 Provider
org.drools.impl.KnowledgeBaseProviderImpl could not be set.
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5) After
creation of Kbase
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5) FactName
issample-person
2011-12-21 20:31:01,835 ERROR [org.in.treetech.bss.common.cache]
(http-127.0.0.1-8080-5) RuleEngine 390 null
2011-12-21 20:31:01,835 INFO [STDOUT] (http-127.0.0.1-8080-5) Rule engine
ended
--
View this message in context: http://drools.46999.n3.nabble.com/adding-all-packages-to-kbuilder-in-web-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 2 months
Regarding implementation of bussiness Rule in Talend
by Lavanya
Hi All,
I am new user of Drools tool. I have done a sample business Rule in
Drools and tested. It is working fine in Drools. So I validated the package
and imported .drl file into talend studio under Meta data (Embedded Rules).
The code generated for the business rule is as follows:
package modelonsales
import salesmodel.Sales
import java.util.ArrayList
import java.util.HashMap
import java.lang.Integer
global ArrayList list
global HashMap globalMap
rule "SalesBR"
dialect "mvel"
when
exists Sales( sales >= "100" )
then
Sales fact0 = new Sales();
fact0.setName( "Discount" );
fact0.setSales( -10 );
insert(fact0 );
end
When I executing the job it is giving errors as follows:
*Starting job DroolsJob at 14:14 21/11/2011.
[statistics] connecting to socket on port 3678
[statistics] connected
[Error: unknown class or illegal statement: Sales]
[Near : {... es fact0 = new Sales();
fact0. ....}]
^
[Line: 1, Column: 13]
at
org.mvel2.compiler.AbstractParser.procTypedNode(AbstractParser.java:1278)
at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:712)
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:106)
at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:55)
at
org.drools.rule.builder.dialect.mvel.MVELExprAnalyzer.analyzeExpression(MVELExprAnalyzer.java:86)
at
org.drools.rule.builder.dialect.mvel.MVELDialect.analyzeBlock(MVELDialect.java:492)
at
org.drools.rule.builder.dialect.mvel.MVELConsequenceBuilder.build(MVELConsequenceBuilder.java:84)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:86)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at
project1.droolsjob_0_1.DroolsJob$1KnowledgeBase_tRules_2.readKnowledgeBaseDRL(DroolsJob.java:595)
at
project1.droolsjob_0_1.DroolsJob$1KnowledgeBase_tRules_2.readKnowledgeBase(DroolsJob.java:584)
at
project1.droolsjob_0_1.DroolsJob.tFileInputExcel_2Process(DroolsJob.java:648)
at project1.droolsjob_0_1.DroolsJob.runJobInTOS(DroolsJob.java:1247)
at project1.droolsjob_0_1.DroolsJob.main(DroolsJob.java:1121)
Unable to resolve ObjectType 'Sales' : [Rule name='SalesBR']
Unable to build expression for 'consequence': unknown class or illegal
statement: Sales 'Sales fact0 = new Sales();
fact0.setName( "Discount" );
fact0.setSales( -10 );
insert(fact0 );
' : [Rule name='SalesBR']
Error importing : 'salesmodel.Sales'
Exception in component tRules_2
java.lang.IllegalArgumentException: Could not parse knowledge.
at
project1.droolsjob_0_1.DroolsJob$1KnowledgeBase_tRules_2.readKnowledgeBaseDRL(DroolsJob.java:604)
at
project1.droolsjob_0_1.DroolsJob$1KnowledgeBase_tRules_2.readKnowledgeBase(DroolsJob.java:584)
at
project1.droolsjob_0_1.DroolsJob.tFileInputExcel_2Process(DroolsJob.java:648)
at project1.droolsjob_0_1.DroolsJob.runJobInTOS(DroolsJob.java:1247)
at project1.droolsjob_0_1.DroolsJob.main(DroolsJob.java:1121)
[statistics] disconnected
Job DroolsJob ended at 14:14 21/11/2011. [exit code=1]
*
I have attached the screen shots as follows:
http://drools.46999.n3.nabble.com/file/n3603531/sales.jpg
http://drools.46999.n3.nabble.com/file/n3603531/sales_error.jpg
Please help me out on this issue.
Thanks and Regards,
Lavanya.
--
View this message in context: http://drools.46999.n3.nabble.com/Regarding-implementation-of-bussiness-R...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Regarding tBRMS component and embedded Rules in talend
by Lavanya
Hi all,
I am new to Drools tool. I would like to implement the Drools Technical
Rule on the data (Excel file) through Talend Studio by using Embedded Rules
under the metadata or by using tBRMS component from palette. From both ways
we tried the job.
The technical Rule that we want to implement is:
package org.sample
import java.util.ArrayList
import java.util.HashMap
import java.lang.Integer
global ArrayList list
global HashMap globalMap
declare Number
message: String
numberone: Integer
numbertwo: Integer
end
rule "numberone is equals to numbertwo"
when
n: Number(numberone == numbertwo);
then
n.setMessage("numberone is equals to numbertwo");
end
rule "numberone is greater than numbertwo"
when
n: Number(numberone > numbertwo);
then
n.setMessage("numberone is greater than numbertwo");
end
rule "numberone is less than numbertwo"
when
n: Number(numberone < numbertwo);
then
n.setMessage("numberone is less than numbertwo");
end
which contains three rules we need to select one rule in the Embedded Rule
component.
*Note: *The component from embedded Rule and tBRMS component configurations
are different.
When I am using Embedded Rules Job is executed but Records are not getting
in the output.
If I am using the tBRMS component from palette in the configuration package
path, In the class URL in place of "package" it is converted to "packages"
when selecting the .jar file in the configuration. When executing the job it
is giving File not found Exception.
After selecting .jar If "packages" is replaced with "package" , it is giving
java.io.IOException: Server returned HTTP response code: 401 for URL
For these issues I have attached the screen shots as follows:
http://drools.46999.n3.nabble.com/file/n3603474/Embeddedrules.jpg
http://drools.46999.n3.nabble.com/file/n3603474/tBRMS_1.jpg
http://drools.46999.n3.nabble.com/file/n3603474/tBRMS_Error_1.jpg
http://drools.46999.n3.nabble.com/file/n3603474/tBRMS_2.jpg
http://drools.46999.n3.nabble.com/file/n3603474/tBRMS_Error_2.jpg
Please help me out in this issue.
Thanks and Regards,
Lavanya.
--
View this message in context: http://drools.46999.n3.nabble.com/Regarding-tBRMS-component-and-embedded-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
JbossAS 7 and JBPM Console Server problem
by Cristiano Gavião
Hi,
I'm trying to configure a JBoss AS 7 for JBPM.
I've downloaded the 5.2.0.Final installer, discompacted it and I'm
trying to install jbpm-gwt-console-server using JBossAS Admin Console.
I'm getting this messages:
> 20:09:07,874 INFO [org.jboss.as.jpa] (MSC service thread 1-1)
> Deployment has its own Persistence Provider class
> org.hibernate.ejb.HibernatePersistence
> 20:09:08,243 INFO [org.jboss.as.server.controller]
> (HttpManagementService-threads - 13) Deployment of
> "jbpm-gwt-console-server-5.2.0.Final.war" was rolled back with failure
> message {"Services with missing/unavailable dependencies" =>
> ["jboss.persistenceunit.\"jbpm-gwt-console-server-5.2.0.Final.war#org.jbpm.persistence.jpa\"
> missing [ jboss.naming.context.java.jboss.java:jdbc.testDS1 ]"]}
> 20:09:08,391 INFO [org.jboss.as.server.deployment] (MSC service
> thread 1-1) Stopped deployment jbpm-gwt-console-server-5.2.0.Final.war
> in 164ms
what should I do to resolve this ?
thanks for any tip
Cheers
Cristiano
14 years, 3 months