[rules-users] Free Form DRL through BRL in guided decision table

2014-04-14 Thread Joe White
Does the workbench extended entry guided decision table support this kind of 
syntax:
ServiceLineStatusInfo( claimStatusCodes contains $param )

Where $param is replaced with the value of the column? When I add that through 
New Column-Add a Condition BRL Fragment-Free Form DRL all I get is a checkbox 
column. Is there a way to set that up so that it allows entry and does the 
substitution?

I know the line above could be built easily in other ways. It is just an 
example to illustrate. I have some more complex logical constructs that I'd 
like to do in straight DRL fragments if possible.

Thanks,

Joe

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Free Form DRL through BRL in guided decision table

2014-04-14 Thread Joe White
Thanks Mike. I see that in the Rule Templates section of the docs. If you want 
I’ll add that the Guided Decision Table of the documents as well and issue a 
pull. Let me know.

Joe

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Monday, April 14, 2014 4:08 PM
To: Rules Users List
Subject: Re: [rules-users] Free Form DRL through BRL in guided decision table

You need to use a Template variable in the BRL fragment.

ServiceLineStatusInfo( claimStatusCodes contains @{param})

On 14 April 2014 23:01, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Does the workbench extended entry guided decision table support this kind of 
syntax:
ServiceLineStatusInfo( claimStatusCodes contains $param )

Where $param is replaced with the value of the column? When I add that through 
New Column-Add a Condition BRL Fragment-Free Form DRL all I get is a checkbox 
column. Is there a way to set that up so that it allows entry and does the 
substitution?

I know the line above could be built easily in other ways. It is just an 
example to illustrate. I have some more complex logical constructs that I’d 
like to do in straight DRL fragments if possible.

Thanks,

Joe


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Error Creating New project

2014-03-28 Thread Joe White
I received this error in the drools workbench when creating a new project:

Unable to complete your request. The following exception occurred: 
java.lang.NoSuchMethodError:org.guvnor.common.services.project.events.NewProjectEvent.(Lorg/guvnor/common/services/project/model/Project;Lorg/uberfire/rpc/SessionInfo;)V.

The project was not created but once I refreshed the browser it showed up. 
Should I assume my project is corrupt or is it valid?

This is on 6.0.1 final (with the merged deployment changes).

Thanks
Joe

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Error Creating New project

2014-03-28 Thread Joe White
I merged the changes we made to deploy to remote repositories back into 6.0.1 
so that I could continue to test. I don't believe it is related but wanted to 
be clear I wasn't on the blessed war.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Friday, March 28, 2014 1:30 PM
To: Rules Users List
Subject: Re: [rules-users] Error Creating New project

What is with the merged deployment changes?

On 28 March 2014 19:28, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
I received this error in the drools workbench when creating a new project:

Unable to complete your request. The following exception occurred: 
java.lang.NoSuchMethodError:org.guvnor.common.services.project.events.NewProjectEvent.(Lorg/guvnor/common/services/project/model/Project;Lorg/uberfire/rpc/SessionInfo;)V.

The project was not created but once I refreshed the browser it showed up. 
Should I assume my project is corrupt or is it valid?

This is on 6.0.1 final (with the merged deployment changes).

Thanks
Joe


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] inserted object now working

2014-03-26 Thread Joe White
You're inserting an object of type TClaim but your rule is written against 
Claim. Change your rule to TClaim and maybe it will work.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Gopu Shrestha
Sent: Wednesday, March 26, 2014 11:40 AM
To: Rules Users List
Subject: Re: [rules-users] inserted object now working

Here is the console output..
..CategoryOfService-15
..ProviderclaimNumber--130430007701
Executing..message rule
Hello World
Goodbye cruel world
Executing..message rule


From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Gopu Shrestha
Sent: Wednesday, March 26, 2014 1:38 PM
To: Rules Users List
Subject: [rules-users] inserted object now working

I am struggling to identify why my another object (Claim) inserted into 
ksession is not working..
However, I tried the object Message() is working but not Claim(). I printed 
values of Claim Object its working but not in rule.

Where I missed??? Please help...

Here is the code.

 KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = 
kbase.newStatefulKnowledgeSession();

// go !
Message message = new Message();
message.setMessage(Hello World);
message.setStatus(Message.HELLO);

TClaim claim = loadFile();

  
System.out.println(..CategoryOfService-+claim.getClaimIdentificationInfo().getCategoryOfService().getValue());//working
  
System.out.println(..ProviderclaimNumber--+claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue());
 //working

ksession.insert(message);
ksession.insert(claim);
ksession.fireAllRules();

private static TClaim loadFile() throws JAXBException, FileNotFoundException {
   JAXBContext jaxbContext = JAXBContext.newInstance(com.sample);
  Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
  JAXBElement? unmarshalledObject = (JAXBElement?) 
unmarshaller.unmarshal(new FileInputStream(Encounter.xml));
  TClaim claim = (TClaim) unmarshalledObject.getValue();

  return claim;
   }

private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource(Sample.drl), 
ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource(setBaseECN.drl), 
ResourceType.DRL);

KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size()  0) {
for (KnowledgeBuilderError error: errors) {
System.err.println(error);
}
throw new IllegalArgumentException(Could not parse knowledge.);
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}

Rule file setBaseECN.drl

rule testing claim rule

when
Claim();
then
   System.out.println(..Executing...claim...rule.);//not 
working
end

rule testing message rule
when
   Message()
then
   System.out.println(Executing..message rule);//working
end

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] inserted object now working

2014-03-26 Thread Joe White
Did you import it?

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of grules
Sent: Wednesday, March 26, 2014 11:51 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] inserted object now working

I tried and it not compiling, here is the error
BuildError: Unable to resolve ObjectType 'TClaim'

[http://drools.46999.n3.nabble.com/attachment/4028969/0/image001.png]


From: Joe White-3 [via Drools] [mailto:ml-node+[hidden 
email]/user/SendEmail.jtp?type=nodenode=4028969i=0]
Sent: Wednesday, March 26, 2014 1:48 PM
To: Gopu Shrestha
Subject: Re: [rules-users] inserted object now working

You're inserting an object of type TClaim but your rule is written against 
Claim. Change your rule to TClaim and maybe it will work.

From: [hidden email]/user/SendEmail.jtp?type=nodenode=4028968i=0 
[mailto:[hidden email]/user/SendEmail.jtp?type=nodenode=4028968i=1] On 
Behalf Of Gopu Shrestha
Sent: Wednesday, March 26, 2014 11:40 AM
To: Rules Users List
Subject: Re: [rules-users] inserted object now working

Here is the console output..
..CategoryOfService-15
..ProviderclaimNumber--130430007701
Executing..message rule
Hello World
Goodbye cruel world
Executing..message rule


From: [hidden email]/user/SendEmail.jtp?type=nodenode=4028968i=2 [[hidden 
email]/user/SendEmail.jtp?type=nodenode=4028968i=3] On Behalf Of Gopu 
Shrestha
Sent: Wednesday, March 26, 2014 1:38 PM
To: Rules Users List
Subject: [rules-users] inserted object now working

I am struggling to identify why my another object (Claim) inserted into 
ksession is not working..
However, I tried the object Message() is working but not Claim(). I printed 
values of Claim Object its working but not in rule.

Where I missed??? Please help...

Here is the code.

 KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = 
kbase.newStatefulKnowledgeSession();

// go !
Message message = new Message();
message.setMessage(Hello World);
message.setStatus(Message.HELLO);

TClaim claim = loadFile();

  
System.out.println(..CategoryOfService-+claim.getClaimIdentificationInfo().getCategoryOfService().getValue());//working
  
System.out.println(..ProviderclaimNumber--+claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue());
 //working

ksession.insert(message);
ksession.insert(claim);
ksession.fireAllRules();

private static TClaim loadFile() throws JAXBException, FileNotFoundException {
   JAXBContext jaxbContext = JAXBContext.newInstance(com.sample);
  Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
  JAXBElement? unmarshalledObject = (JAXBElement?) 
unmarshaller.unmarshal(new FileInputStream(Encounter.xml));
  TClaim claim = (TClaim) unmarshalledObject.getValue();

  return claim;
   }

private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource(Sample.drl), 
ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource(setBaseECN.drl), 
ResourceType.DRL);

KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size()  0) {
for (KnowledgeBuilderError error: errors) {
System.err.println(error);
}
throw new IllegalArgumentException(Could not parse knowledge.);
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}

Rule file setBaseECN.drl

rule testing claim rule

when
Claim();
then
   System.out.println(..Executing...claim...rule.);//not 
working
end

rule testing message rule
when
   Message()
then
   System.out.println(Executing..message rule);//working
end


___
rules-users mailing list
[hidden email]/user/SendEmail.jtp?type=nodenode=4028968i=4
https://lists.jboss.org/mailman/listinfo/rules-users

If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/rules-users-inserted-object-now-working-tp4028966p4028968.html
To start a new topic under Drools: User forum, email [hidden 
email]/user/SendEmail.jtp?type=nodenode=4028969i=1
To unsubscribe from Drools, click here.
NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble

Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

2014-03-26 Thread Joe White
I haven't done it in a long time but I think you have to disable strict mode in 
your eclipse ini file

From the docs:
drools.dialect.mvel.strict = true|false

I can't swear that will work though.  What does getProviderClaimNumber return? 
Does it actually have a getValue() method?

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Gopu Shrestha
Sent: Wednesday, March 26, 2014 1:29 PM
To: Rules Users List
Subject: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, 
how can I remove error

It is so annoying to see an error marks in Eclipse Juno with Drools Plug in. 
However the code is working fine...
How can clean up this error??? Please advise...


[cid:image001.png@01CF48F8.D26F42F0]

Error Message!
BuildError: Unable to Analyse Expression System.out.println(...java 
(getter/setter)...providerClaimNumber..+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue());

System.out.println(..mvel...providerClaimNumber..+$claim.claimIdentificationInfo.providerClaimNumber.value);
System.out.println(...ctype...+$ct.value);:
[Error: unable to resolve method using strict-mode: java.lang.String.getValue()]
[Near : {... oviderClaimNumber().getValue()); }]

  ^
[Line: 32, Column: 0]


Console Output:
...java (getter/setter)...providerClaimNumber..130430007701
..mvel...providerClaimNumber..130430007701
...ctype...I

inline: image001.png___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

2014-03-26 Thread Joe White
You're supposed to pick a value for that one. Either true or false. It is a 
property. You may also need the -D.

I'm asking what is the return type on getProviderClaimNumber() and does that 
type have a getValue method?

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of grules
Sent: Wednesday, March 26, 2014 2:12 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT 
WORKING, how can I remove error

Hi Joe,

The getProviderClaimNumber return? i.e. System.out.println(...java 
(getter/setter)...providerClaimNumber..+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue())

Same value 130430007701
As $claim.claimIdentificationInfo.providerClaimNumber.value Do i.e. 130430007701

Now for My Eclipse didn't open when I added drools.dialect.mvel.strict 
=true|false

I just added like this in eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m

drools.dialect.mvel.strict = true|false


From: Joe White-3 [via Drools] [mailto:ml-node+[hidden 
email]/user/SendEmail.jtp?type=nodenode=4028974i=0]
Sent: Wednesday, March 26, 2014 3:56 PM
To: Gopu Shrestha
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT 
WORKING, how can I remove error

I haven't done it in a long time but I think you have to disable strict mode in 
your eclipse ini file

From the docs:
drools.dialect.mvel.strict = true|false

I can't swear that will work though.  What does getProviderClaimNumber return? 
Does it actually have a getValue() method?

From: [hidden email]/user/SendEmail.jtp?type=nodenode=4028973i=0 
[mailto:[hidden email]/user/SendEmail.jtp?type=nodenode=4028973i=1] On 
Behalf Of Gopu Shrestha
Sent: Wednesday, March 26, 2014 1:29 PM
To: Rules Users List
Subject: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, 
how can I remove error

It is so annoying to see an error marks in Eclipse Juno with Drools Plug in. 
However the code is working fine...
How can clean up this error??? Please advise...


[http://drools.46999.n3.nabble.com/attachment/4028973/0/image001.png]

Error Message!
BuildError: Unable to Analyse Expression System.out.println(...java 
(getter/setter)...providerClaimNumber..+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue());

System.out.println(..mvel...providerClaimNumber..+$claim.claimIdentificationInfo.providerClaimNumber.value);
System.out.println(...ctype...+$ct.value);:
[Error: unable to resolve method using strict-mode: java.lang.String.getValue()]
[Near : {... oviderClaimNumber().getValue()); }]

  ^
[Line: 32, Column: 0]


Console Output:
...java (getter/setter)...providerClaimNumber..130430007701
..mvel...providerClaimNumber..130430007701
...ctype...I


___
rules-users mailing list
[hidden email]/user/SendEmail.jtp?type=nodenode=4028973i=2
https://lists.jboss.org/mailman/listinfo/rules-users

If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028973.html
To start a new topic under Drools: User forum, email [hidden 
email]/user/SendEmail.jtp?type=nodenode=4028974i=1
To unsubscribe from Drools, click here.
NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml


View this message in context: RE: [rules-users] BuildError: Unable to Analyse 
Expression BUT WORKING, how can I remove 
errorhttp://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028974.html
Sent from the Drools: User forum mailing list 
archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html at 
Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] 6.0.1.F Need help in getting recanned rules into new session

2014-03-26 Thread Joe White
Try a version range or a SNAPSHOT. LATEST doesn't work in 6.0.1 for the 
scanner. 

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of SrjTx
Sent: Wednesday, March 26, 2014 2:27 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] 6.0.1.F Need help in getting recanned rules into new 
session

I've have been unable to figure out how to get drools to rescan and then use 
the updated rules in a new session.  I currently have to restart jboss to pick 
up the changes.  The scanning seems to happen, but I don't see the changes that 
should be included.


I have looked at lots of example code on the web and also at the Switchyard 
source.  When I do this in tandem with SY, I can get it to work, but I 
need/want to have it work on its own.

I have tried some different combinations with no luck.

In addition to the why doesn't it work, I would like to clearly
understand:


Do I need a KieBase, or should I just be creating sessions off of the container?

What do I need to have in Envinonment?.
What do I need to have in ksessionConfiguration?
Related, what is the proper mechanism to pass in the Session Name?



GAD is: com.xyz.policy, cep, 1.0
Drools session is stateful and named DroolsSession, stream processing mode, 
realtime




I initialized KIE with the following.

kieServices = KieServices.Factory.get();

releaseId = kieServices.newReleaseId(com.xyz.policy, cep,
LATEST);

kieFileSystem = 
kieServices.newKieFileSystem().generateAndWritePomXML(
releaseId);

kieBuilder = kieServices.newKieBuilder(kieFileSystem);

kieBuilder.buildAll();

Results results = kieBuilder.getResults();
if (results.hasMessages(Message.Level.ERROR)) {
StringBuilder sb = new StringBuilder();
for (Message message : 
results.getMessages(Message.Level.ERROR)) {
if (sb.length() != 0) {
sb.append( -- );
}
sb.append(message.toString().trim());
}
log(Unable to initialize KIE  + sb.toString());

} else {
env = kieServices.newEnvironment();

kieContainer = kieServices.newKieContainer(releaseId);
kieScanner = kieServices.newKieScanner(kieContainer);

kieBaseConfiguration = 
kieServices.newKieBaseConfiguration();
kieBase = kieContainer.newKieBase(kieBaseConfiguration);

kieSessionConfiguration = 
kieServices.newKieSessionConfiguration();
kieSessionConfiguration.setProperty(sessionName, 
DroolsSession);
kieSessionConfiguration.setProperty(drools.clockType, 
realtime);

kieSessionConfiguration.setProperty(drools.evenProcessingMode,
stream);


Later when I determine it is time to rescan, I do the following:

kieScanner.scanNow();

System.err.println(Scanning...);

currentKieSessionThread = new 
KieSessionThread(

kieBase.newKieSession(kieSessionConfiguration, env));


executorBean.execute(currentKieSessionThread);




--
View this message in context: 
http://drools.46999.n3.nabble.com/6-0-1-F-Need-help-in-getting-recanned-rules-into-new-session-tp4028975.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

2014-03-26 Thread Joe White
Remove the  characters. But it will still return an error. The error is 
valid. There is no method called getValue() on String.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of grules
Sent: Wednesday, March 26, 2014 2:51 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT 
WORKING, how can I remove error

Hi Joe,
The eclipse is working and I inserted -Ddrools.dialect.mvel.strict = false 
but the error still popping up.

Return type is String.

Thank you for your help..

From: Joe White-3 [via Drools] [mailto:ml-node+[hidden 
email]/user/SendEmail.jtp?type=nodenode=4028978i=0]
Sent: Wednesday, March 26, 2014 4:41 PM
To: Gopu Shrestha
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT 
WORKING, how can I remove error

You're supposed to pick a value for that one. Either true or false. It is a 
property. You may also need the -D.

I'm asking what is the return type on getProviderClaimNumber() and does that 
type have a getValue method?

From: [hidden email]/user/SendEmail.jtp?type=nodenode=4028976i=0 
[mailto:[hidden email]/user/SendEmail.jtp?type=nodenode=4028976i=1] On 
Behalf Of grules
Sent: Wednesday, March 26, 2014 2:12 PM
To: [hidden email]/user/SendEmail.jtp?type=nodenode=4028976i=2
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT 
WORKING, how can I remove error

Hi Joe,

The getProviderClaimNumber return? i.e. System.out.println(...java 
(getter/setter)...providerClaimNumber..+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue())

Same value 130430007701
As $claim.claimIdentificationInfo.providerClaimNumber.value Do i.e. 130430007701

Now for My Eclipse didn't open when I added drools.dialect.mvel.strict 
=true|false

I just added like this in eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m

drools.dialect.mvel.strict = true|false


From: Joe White-3 [via Drools] [mailto:ml-node+[hidden 
email]/user/SendEmail.jtp?type=nodenode=4028974i=0]
Sent: Wednesday, March 26, 2014 3:56 PM
To: Gopu Shrestha
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT 
WORKING, how can I remove error

I haven't done it in a long time but I think you have to disable strict mode in 
your eclipse ini file

From the docs:
drools.dialect.mvel.strict = true|false

I can't swear that will work though.  What does getProviderClaimNumber return? 
Does it actually have a getValue() method?

From: [hidden email]/user/SendEmail.jtp?type=nodenode=4028973i=0 
[mailto:[hidden email]/user/SendEmail.jtp?type=nodenode=4028973i=1] On 
Behalf Of Gopu Shrestha
Sent: Wednesday, March 26, 2014 1:29 PM
To: Rules Users List
Subject: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, 
how can I remove error

It is so annoying to see an error marks in Eclipse Juno with Drools Plug in. 
However the code is working fine...
How can clean up this error??? Please advise...


[http://drools.46999.n3.nabble.com/attachment/4028973/0/image001.png]

Error Message!
BuildError: Unable to Analyse Expression System.out.println(...java 
(getter/setter)...providerClaimNumber..+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue());

System.out.println(..mvel...providerClaimNumber..+$claim.claimIdentificationInfo.providerClaimNumber.value);
System.out.println(...ctype...+$ct.value);:
[Error: unable to resolve method using strict-mode: java.lang.String.getValue()]
[Near : {... oviderClaimNumber().getValue()); }]

  ^
[Line: 32, Column: 0]


Console Output:
...java (getter/setter)...providerClaimNumber..130430007701
..mvel...providerClaimNumber..130430007701
...ctype...I


___
rules-users mailing list
[hidden email]/user/SendEmail.jtp?type=nodenode=4028973i=2
https://lists.jboss.org/mailman/listinfo/rules-users

If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028973.html
To start a new topic under Drools: User forum, email [hidden 
email]/user/SendEmail.jtp?type=nodenode=4028974i=1
To unsubscribe from Drools, click here.
NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html

Re: [rules-users] 6.0.1.F Need help in getting recanned rules into new session

2014-03-26 Thread Joe White
I haven't tried ranges myself. I know for sure SNAPSHOTS work. I think you may 
need a bracket at the end of your range definitions. Like:

releaseId = kieServices.newReleaseId(com.xyz.policy,cep, [1.0-10.0]);

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of SrjTx
Sent: Wednesday, March 26, 2014 3:47 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] 6.0.1.F Need help in getting recanned rules into new 
session

Could you please give me an example of the ranges?

I tried the following based on a couple google searches, but they result in 
NullPointerExceptions.

releaseId = kieServices.newReleaseId(com.xyz.policy,
cep, 
[1.0,); 
releaseId = kieServices.newReleaseId(com.xyz.policy,
cep, 
[1.0-10.0); 



--
View this message in context: 
http://drools.46999.n3.nabble.com/6-0-1-F-Need-help-in-getting-recanned-rules-into-new-session-tp4028975p4028981.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

2014-03-20 Thread Joe White
You have to create a new session. Only new sessions will have the updated 
kmodule information. 

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of SrjTx
Sent: Thursday, March 20, 2014 10:38 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

I don't know what is different today, but LATEST is working.  I think I had 
too many changes going on at once, back to a good state.

(FYI, We've been cherry picking fixes from the master branch)

So, I'm getting close.
Now, I even see the message
The following artifacts have been updated: {..blah blah..}

But, what I am not seeing now is the changes in the then sections I made in 
the rules (just printlns at this point).  I have to restart jboss to see the 
changes.

The scanner is running and according to the example shown at

http://stackoverflow.com/questions/22205945/drools-6-add-rules-to-a-running-kiesession/22208775?noredirect=1#22208775
http://stackoverflow.com/questions/22205945/drools-6-add-rules-to-a-running-kiesession/22208775?noredirect=1#22208775
  



it seems like the sessions should automatically update.  Is that true?  Or, do 
I have to create a new session after the contain is updated with the new rules?





--
View this message in context: 
http://drools.46999.n3.nabble.com/6-0-1-F-How-to-set-Maven-repo-used-by-KieScanner-tp4028804p4028833.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Updating project repositories

2014-03-20 Thread Joe White
I have updated my repository configuration but when I build and deploy by 
package two things happen:

-  The jar only gets deployed to my local repo it doesn't go out to the 
remote instance

-  The pom doesn't contain the full repository configuration when 
deployed. The snapshot and releases config are dropped

Am I missing a piece of config to get the jar pushed out to my remote repo?

My repository config inside the WB:
repositories
repository
idrecondo-repo/id
namepapaafrepo001-releases/name
releases
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/releases
snapshots
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/snapshots

urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/url
/repository
/repositories

Repo config inside the deployed pom:
repositories
repository
  idrecondo-repo/id
  namepapaafrepo001-releases/name
  urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/url
/repository
  /repositories


Joe White
CIO Technology Enabled Services
303-974-2849 (Office)
720-232-9023 (Cell)

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Updating project repositories

2014-03-20 Thread Joe White
So if I change the configuration in the WB UI should I expect the jar to end up 
in my remote repo? It is only ending up in my local repository.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 1:10 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


I've asked a colleague to comment.

We do manipulate the pom for the UI but should retain original content that is 
not modified by the Project Editor.

@Toni... What's your opinion?

Sent on the move
On 20 Mar 2014 18:03, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Also, that is the same configuration that is in my settings.xml for my 
installed maven instance and the profile is active.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 20, 2014 12:01 PM
To: Rules Users List
Subject: [rules-users] Updating project repositories

I have updated my repository configuration but when I build and deploy by 
package two things happen:

-  The jar only gets deployed to my local repo it doesn't go out to the 
remote instance

-  The pom doesn't contain the full repository configuration when 
deployed. The snapshot and releases config are dropped

Am I missing a piece of config to get the jar pushed out to my remote repo?

My repository config inside the WB:
repositories
repository
idrecondo-repo/id
namepapaafrepo001-releases/name
releases
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/releases
snapshots
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/snapshots

urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo%3c/url
/repository
/repositories

Repo config inside the deployed pom:
repositories
repository
  idrecondo-repo/id
  namepapaafrepo001-releases/name
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo%3c/url
/repository
  /repositories


Joe White
CIO Technology Enabled Services
303-974-2849tel:303-974-2849 (Office)
720-232-9023tel:720-232-9023 (Cell)


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Updating project repositories

2014-03-20 Thread Joe White
I've got distribution management that matches my settings xml added to the pom 
but it doesn't seem to connect (or to attempt to connect)

distributionManagement
repository
  idrecondo-repo/id
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-release/url
/repository
snapshotRepository
  idrecondo-repo/id
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-snapshot/url
/snapshotRepository
  /distributionManagement



From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 2:56 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


That depends how you're configuring your project's distribution management.

Adding (I assume) your remote to the repositories section is only telling maven 
a remote to query to *download* artifacts.

Sent on the move
On 20 Mar 2014 20:41, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
So if I change the configuration in the WB UI should I expect the jar to end up 
in my remote repo? It is only ending up in my local repository.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 1:10 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


I've asked a colleague to comment.

We do manipulate the pom for the UI but should retain original content that is 
not modified by the Project Editor.

@Toni... What's your opinion?

Sent on the move
On 20 Mar 2014 18:03, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Also, that is the same configuration that is in my settings.xml for my 
installed maven instance and the profile is active.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 20, 2014 12:01 PM
To: Rules Users List
Subject: [rules-users] Updating project repositories

I have updated my repository configuration but when I build and deploy by 
package two things happen:

-  The jar only gets deployed to my local repo it doesn't go out to the 
remote instance

-  The pom doesn't contain the full repository configuration when 
deployed. The snapshot and releases config are dropped

Am I missing a piece of config to get the jar pushed out to my remote repo?

My repository config inside the WB:
repositories
repository
idrecondo-repo/id
namepapaafrepo001-releases/name
releases
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/releases
snapshots
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/snapshots

urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo%3c/url
/repository
/repositories

Repo config inside the deployed pom:
repositories
repository
  idrecondo-repo/id
  namepapaafrepo001-releases/name
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo%3c/url
/repository
  /repositories


Joe White
CIO Technology Enabled Services
303-974-2849tel:303-974-2849 (Office)
720-232-9023tel:720-232-9023 (Cell)


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Updating project repositories

2014-03-20 Thread Joe White
In fact, if I manually go into the guvnor repository, copy the pom.xml directly 
from the workbench, and command line run mvn deploy the jar gets pushed out 
to my remote repository. So I know for sure the pom is configured correctly in 
the workbench

Is the workbench actually calling deploy or just install ? Where in the 
code would be a good starting point to dig a little deeper on this?

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Joe White
Sent: Thursday, March 20, 2014 3:15 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories

I've got distribution management that matches my settings xml added to the pom 
but it doesn't seem to connect (or to attempt to connect)

distributionManagement
repository
  idrecondo-repo/id
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-release/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-release%3c/url
/repository
snapshotRepository
  idrecondo-repo/id
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-snapshot/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-snapshot%3c/url
/snapshotRepository
  /distributionManagement



From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 2:56 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


That depends how you're configuring your project's distribution management.

Adding (I assume) your remote to the repositories section is only telling maven 
a remote to query to *download* artifacts.

Sent on the move
On 20 Mar 2014 20:41, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
So if I change the configuration in the WB UI should I expect the jar to end up 
in my remote repo? It is only ending up in my local repository.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 1:10 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


I've asked a colleague to comment.

We do manipulate the pom for the UI but should retain original content that is 
not modified by the Project Editor.

@Toni... What's your opinion?

Sent on the move
On 20 Mar 2014 18:03, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Also, that is the same configuration that is in my settings.xml for my 
installed maven instance and the profile is active.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 20, 2014 12:01 PM
To: Rules Users List
Subject: [rules-users] Updating project repositories

I have updated my repository configuration but when I build and deploy by 
package two things happen:

-  The jar only gets deployed to my local repo it doesn't go out to the 
remote instance

-  The pom doesn't contain the full repository configuration when 
deployed. The snapshot and releases config are dropped

Am I missing a piece of config to get the jar pushed out to my remote repo?

My repository config inside the WB:
repositories
repository
idrecondo-repo/id
namepapaafrepo001-releases/name
releases
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/releases
snapshots
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/snapshots

urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo%3c/url
/repository
/repositories

Repo config inside the deployed pom:
repositories
repository
  idrecondo-repo/id
  namepapaafrepo001-releases/name
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo%3c/url
/repository
  /repositories


Joe White
CIO Technology Enabled Services
303-974-2849tel:303-974-2849 (Office)
720-232-9023tel:720-232-9023 (Cell)


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https

Re: [rules-users] Updating project repositories

2014-03-20 Thread Joe White
Thanks Mike. I'll take a look.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 4:03 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


The workbench attempts an install and deploy. GuvnorM2Repository in the guvnor 
project is the class (IIRC).

Sent on the move
On 20 Mar 2014 21:47, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
In fact, if I manually go into the guvnor repository, copy the pom.xml directly 
from the workbench, and command line run mvn deploy the jar gets pushed out 
to my remote repository. So I know for sure the pom is configured correctly in 
the workbench

Is the workbench actually calling deploy or just install ? Where in the 
code would be a good starting point to dig a little deeper on this?

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 20, 2014 3:15 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories

I've got distribution management that matches my settings xml added to the pom 
but it doesn't seem to connect (or to attempt to connect)

distributionManagement
repository
  idrecondo-repo/id
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-release/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-release%3c/url
/repository
snapshotRepository
  idrecondo-repo/id
  
urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-snapshot/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/recondo-snapshot%3c/url
/snapshotRepository
  /distributionManagement



From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 2:56 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


That depends how you're configuring your project's distribution management.

Adding (I assume) your remote to the repositories section is only telling maven 
a remote to query to *download* artifacts.

Sent on the move
On 20 Mar 2014 20:41, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
So if I change the configuration in the WB UI should I expect the jar to end up 
in my remote repo? It is only ending up in my local repository.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Thursday, March 20, 2014 1:10 PM
To: Rules Users List
Subject: Re: [rules-users] Updating project repositories


I've asked a colleague to comment.

We do manipulate the pom for the UI but should retain original content that is 
not modified by the Project Editor.

@Toni... What's your opinion?

Sent on the move
On 20 Mar 2014 18:03, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Also, that is the same configuration that is in my settings.xml for my 
installed maven instance and the profile is active.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 20, 2014 12:01 PM
To: Rules Users List
Subject: [rules-users] Updating project repositories

I have updated my repository configuration but when I build and deploy by 
package two things happen:

-  The jar only gets deployed to my local repo it doesn't go out to the 
remote instance

-  The pom doesn't contain the full repository configuration when 
deployed. The snapshot and releases config are dropped

Am I missing a piece of config to get the jar pushed out to my remote repo?

My repository config inside the WB:
repositories
repository
idrecondo-repo/id
namepapaafrepo001-releases/name
releases
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/releases
snapshots
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicyfail/checksumPolicy
/snapshots

urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo/urlhttp://papaafrepo001.recondo.vci:8081/artifactory/repo%3c/url
/repository
/repositories

Repo config inside the deployed pom:
repositories
repository
  idrecondo-repo/id
  namepapaafrepo001-releases/name
  
urlhttp://papaafrepo001

Re: [rules-users] Pojos not visible in Guided DT

2014-03-19 Thread Joe White
I haven't tried 6.1.0 yet. I'll do that.

Generally the process to reproduce is:

-  Load a jar that is missing dependencies

-  Update the jar to remove those dependencies so that it has no 
external or transitive dependencies (pure pojo)

-  Create decision table

-  No objects available.

If I reproduce on 6.1 I'll open a jira.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Tuesday, March 18, 2014 7:36 PM
To: Rules Users List
Subject: Re: [rules-users] Pojos not visible in Guided DT


That is strange.

Can you provide steps to reproduce? Have you tried 6.1.0.Beta1?

Sent on the move
On 18 Mar 2014 22:30, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
In the workbench has anybody seen a case where you can create a decision table 
with the Wizard and it sees your classes. But the non- wizard decision table 
definition fails? I get this exception when creating a table without using the 
wizard and none of my objects show up in the dropdown for column definition. If 
I use the wizard and select my imports everything works as expected.



1.  java.lang.NullPointerException: null
2.  at 
org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.registerInitialErrors(KieBuilderSetImpl.java:50)
 ~[drools-compiler-6.0.1.Final.jar:6.0.1.Final]
3.  at 
org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.init(KieBuilderSetImpl.java:42)
 ~[drools-compiler-.0.1.Final.jar:6.0.1.Final]
4.  at 
org.drools.compiler.kie.builder.impl.KieBuilderImpl.createFileSet(KieBuilderImpl.java:703)
 ~[drools-compiler-6.0.1.Final.jar:6.0.1.Final]
5.  at org.guvnor.common.services.builder.Builder.addResource(Builder.java:245) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]at 
org.guvnor.common.services.builder.Builder.updateResource(Builder.java:319) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
6.  at 
org.guvnor.common.services.builder.BuildServiceImpl.updatePackageReso
7.  urce(BuildServiceImpl.java:192) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
8. at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.updatePackageResource(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
9.  [guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
10. at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$4.run(ResourceChangeIncrementalBuilder.java:237)[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
11. at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
[na:1.7.0_45]
12. at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
[na:1.7.0_45]
13. at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
14. 2014-03-18 13:31:02,953 [pool-9-thread-8] ERROR null
15. org.guvnor.common.services.shared.exceptions.GenericPortableException: null
16. at 
org.guvnor.common.services.backend.exceptions.ExceptionUtilities.handleException(ExceptionUtilities.java:24)
 ~[guvnor-services-api-6.0.1.Final.jar:6.0.1.Final]
17. at 
org.guvnor.common.services.builder.BuildServiceImpl.updatePackageResource(BuildServiceImpl.java:200)
 ~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
18. at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.updatePackageResource(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
19. at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$4.run(ResourceChangeIncrementalBuilder.java:237)
 ~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
20. at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
[na:1.7.0_45]
21. at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
[na:1.7.0_45]
22. at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

2014-03-19 Thread Joe White
Have you tried it with a version other than LATEST? I think that there was a 
bug that was fixed in 6.1 that prevented the latest keyword from working 
correctly. Try a SNAPSHOT or a version range.

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of SrjTx
Sent: Wednesday, March 19, 2014 1:28 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

I am doing the following, but no rules ever fire.  I suspect the maven repo 
location is not right -and that no rules are getting loaded - how do I set it?

I am using /root/.m2/repository

It would be the programmatic equivalent of 
-Dorg.guvnor.m2repo.dir=/root/.m2/repository


Also, how do you list the rules that are in the base?  I see there is a 
getRule(...), but no getRules.



kieServices = KieServices.Factory.get();

releaseId = kieServices.newReleaseId(com.xyz.policy, cep,
LATEST);

kieContainer = kieServices.newKieContainer(releaseId);
kieBase = kieContainer.newKieBase(config);
kieSession = kieBase.newKieSession();

kieSession.addEventListener((RuleRuntimeEventListener) this);

kieScanner = kieServices.newKieScanner(kieContainer);
kieScanner.start(1L);



--
View this message in context: 
http://drools.46999.n3.nabble.com/6-0-1-F-How-to-set-Maven-repo-used-by-KieScanner-tp4028804.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Pojos not visible in Guided DT

2014-03-19 Thread Joe White
Hey Mike,
I'll try to reproduce again so that I can provide details before opening the 
Jira. It wasn't specifically related to the free form DRL I don't think. I was 
able to go into the admin console and revert a couple of changes to get my 
table back to life.

I had a perm-gen problem and had to reboot so the stack is gone. The only info 
I have now is the error from the portal:
Unable to complete your request. The following exception occurred: rowData 
contains a different number of columns to those provided.

If you want a ticket with just that info I can open it but let me know since 
that isn't much to go on. I'll try again to gather a better trace.

Thanks
Joe
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Wednesday, March 19, 2014 12:31 PM
To: Rules Users List
Subject: Re: [rules-users] Pojos not visible in Guided DT


@JoeW

I glimpsed at IRC before leaving for the day and saw you had a problem with 
Free Format DRL in a BRL Condition column.

Could you raise a JIRA and I'll look at tomorrow (just need to finish something 
else first).

Cheers,

Mike

Sent on the move
On 19 Mar 2014 16:28, Michael Anstis 
michael.ans...@gmail.commailto:michael.ans...@gmail.com wrote:
Are the types in the same package as the guided decision table?

You'll need to import them (Config tab) if they're not.

On 19 March 2014 16:02, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
I haven't tried 6.1.0 yet. I'll do that.

Generally the process to reproduce is:

-  Load a jar that is missing dependencies

-  Update the jar to remove those dependencies so that it has no 
external or transitive dependencies (pure pojo)

-  Create decision table

-  No objects available.

If I reproduce on 6.1 I'll open a jira.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Tuesday, March 18, 2014 7:36 PM
To: Rules Users List
Subject: Re: [rules-users] Pojos not visible in Guided DT


That is strange.

Can you provide steps to reproduce? Have you tried 6.1.0.Beta1?

Sent on the move
On 18 Mar 2014 22:30, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
In the workbench has anybody seen a case where you can create a decision table 
with the Wizard and it sees your classes. But the non- wizard decision table 
definition fails? I get this exception when creating a table without using the 
wizard and none of my objects show up in the dropdown for column definition. If 
I use the wizard and select my imports everything works as expected.



1.  java.lang.NullPointerException: null
2.  at 
org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.registerInitialErrors(KieBuilderSetImpl.java:50)
 ~[drools-compiler-6.0.1.Final.jar:6.0.1.Final]
3.  at 
org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.init(KieBuilderSetImpl.java:42)
 ~[drools-compiler-.0.1.Final.jar:6.0.1.Final]
4.  at 
org.drools.compiler.kie.builder.impl.KieBuilderImpl.createFileSet(KieBuilderImpl.java:703)
 ~[drools-compiler-6.0.1.Final.jar:6.0.1.Final]
5.  at org.guvnor.common.services.builder.Builder.addResource(Builder.java:245) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]at 
org.guvnor.common.services.builder.Builder.updateResource(Builder.java:319) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
6.  at 
org.guvnor.common.services.builder.BuildServiceImpl.updatePackageReso
7.  urce(BuildServiceImpl.java:192) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
8. at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.updatePackageResource(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
9.  [guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
10. at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$4.run(ResourceChangeIncrementalBuilder.java:237)[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
11. at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
[na:1.7.0_45]
12. at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
[na:1.7.0_45]
13. at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
14. 2014-03-18 13:31:02,953 [pool-9-thread-8] ERROR null
15. org.guvnor.common.services.shared.exceptions.GenericPortableException: null
16. at 
org.guvnor.common.services.backend.exceptions.ExceptionUtilities.handleException(ExceptionUtilities.java:24)
 ~[guvnor-services-api-6.0.1.Final.jar:6.0.1.Final]
17. at 
org.guvnor.common.services.builder.BuildServiceImpl.updatePackageResource(BuildServiceImpl.java:200)
 ~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
18. at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy

Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

2014-03-19 Thread Joe White
I believe it pulls from however your maven install is configured. Make sure 
you've got the M2_HOME env variable set and pointed to your maven install. And 
then it should pull from whatever you have in settings.xml in maven for your 
repositories.

I also have MAVEN_HOME set to the same path as M2_HOME but I think that was for 
a different project. If setting M2_HOME doesn't work try adding that one as 
well.

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of SrjTx
Sent: Wednesday, March 19, 2014 2:05 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

I just tried both, neither worked.


Do you know how I can check where it thinks the repo is?





--
View this message in context: 
http://drools.46999.n3.nabble.com/6-0-1-F-How-to-set-Maven-repo-used-by-KieScanner-tp4028804p4028808.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Pojos not visible in Guided DT

2014-03-19 Thread Joe White
Hey Mike,
1.I am able to reliably reproduce. I created JIRA 
GUVNOR-2087https://issues.jboss.org/browse/GUVNOR-2087. Creating a hidden 
checkbox type column seems to reproduce. I was doing that through free-form 
DRL. I added my steps and the stacktrace to the JIRA.
2.
Ping me on IRC if you need more details.
Joe

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Wednesday, March 19, 2014 2:03 PM
To: Rules Users List
Subject: Re: [rules-users] Pojos not visible in Guided DT


Ok, if it was more general I'll give it a poke and see what's the problem.

Sent on the move
On 19 Mar 2014 19:40, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Hey Mike,
I'll try to reproduce again so that I can provide details before opening the 
Jira. It wasn't specifically related to the free form DRL I don't think. I was 
able to go into the admin console and revert a couple of changes to get my 
table back to life.

I had a perm-gen problem and had to reboot so the stack is gone. The only info 
I have now is the error from the portal:
Unable to complete your request. The following exception occurred: rowData 
contains a different number of columns to those provided.

If you want a ticket with just that info I can open it but let me know since 
that isn't much to go on. I'll try again to gather a better trace.

Thanks
Joe
From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Wednesday, March 19, 2014 12:31 PM
To: Rules Users List
Subject: Re: [rules-users] Pojos not visible in Guided DT


@JoeW

I glimpsed at IRC before leaving for the day and saw you had a problem with 
Free Format DRL in a BRL Condition column.

Could you raise a JIRA and I'll look at tomorrow (just need to finish something 
else first).

Cheers,

Mike

Sent on the move
On 19 Mar 2014 16:28, Michael Anstis 
michael.ans...@gmail.commailto:michael.ans...@gmail.com wrote:
Are the types in the same package as the guided decision table?

You'll need to import them (Config tab) if they're not.

On 19 March 2014 16:02, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
I haven't tried 6.1.0 yet. I'll do that.

Generally the process to reproduce is:

-  Load a jar that is missing dependencies

-  Update the jar to remove those dependencies so that it has no 
external or transitive dependencies (pure pojo)

-  Create decision table

-  No objects available.

If I reproduce on 6.1 I'll open a jira.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Tuesday, March 18, 2014 7:36 PM
To: Rules Users List
Subject: Re: [rules-users] Pojos not visible in Guided DT


That is strange.

Can you provide steps to reproduce? Have you tried 6.1.0.Beta1?

Sent on the move
On 18 Mar 2014 22:30, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
In the workbench has anybody seen a case where you can create a decision table 
with the Wizard and it sees your classes. But the non- wizard decision table 
definition fails? I get this exception when creating a table without using the 
wizard and none of my objects show up in the dropdown for column definition. If 
I use the wizard and select my imports everything works as expected.



1.  java.lang.NullPointerException: null
2.  at 
org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.registerInitialErrors(KieBuilderSetImpl.java:50)
 ~[drools-compiler-6.0.1.Final.jar:6.0.1.Final]
3.  at 
org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.init(KieBuilderSetImpl.java:42)
 ~[drools-compiler-.0.1.Final.jar:6.0.1.Final]
4.  at 
org.drools.compiler.kie.builder.impl.KieBuilderImpl.createFileSet(KieBuilderImpl.java:703)
 ~[drools-compiler-6.0.1.Final.jar:6.0.1.Final]
5.  at org.guvnor.common.services.builder.Builder.addResource(Builder.java:245) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]at 
org.guvnor.common.services.builder.Builder.updateResource(Builder.java:319) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
6.  at 
org.guvnor.common.services.builder.BuildServiceImpl.updatePackageReso
7.  urce(BuildServiceImpl.java:192) 
~[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
8. at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.updatePackageResource(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
9.  [guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
10. at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$4.run(ResourceChangeIncrementalBuilder.java:237)[guvnor-project-builder-6.0.1.Final.jar:6.0.1.Final]
11

Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

2014-03-19 Thread Joe White
Then you are set. I'm pretty sure that the LATEST feature is enabled in the 6.1 
release so you might try the beta if you need it.

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of SrjTx
Sent: Wednesday, March 19, 2014 3:09 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

actually, if I use the version number I do see the following (missed it last 
time I looked), but no rules fire.
16:04:08,127 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl]
(http-/10.1.1.161:8443-2) KieModule was added:MemoryKieModule[ 
ReleaseId=com.xxx.policy:cep:1.0]

We had been doing this with switchyard and had to use latest so that it would 
pick up changes made in kie-wb.




--
View this message in context: 
http://drools.46999.n3.nabble.com/6-0-1-F-How-to-set-Maven-repo-used-by-KieScanner-tp4028804p4028812.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Pojo with spring dependency in DWB

2014-03-13 Thread Joe White
Here is a better more complete stack trace:

Exception in thread pool-9-thread-8 java.lang.NoClassDefFoundError: javax/pers
istence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
at 
org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:99)
at 
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at 
org.kie.scanner.KieModuleMetaDataImpl.getClass(KieModuleMetaDataImpl.java:91)
at org.guvnor.common.services.builder.Builder.build(Builder.java:162)
at 
org.guvnor.common.services.builder.BuildServiceImpl.doBuild(BuildServiceImpl.java:122)
at 
org.guvnor.common.services.builder.BuildServiceImpl.build(BuildServiceImpl.java:77)
at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.build(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$3.run(ResourceChangeIncrementalBuilder.java:214)

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Joe White
Sent: Thursday, March 13, 2014 1:24 PM
To: Rules Users List
Subject: [rules-users] Pojo with spring dependency in DWB

What is the best way to import a jar that has a spring dependency into the 
Drools Workbench? When I upload my pojos that I intend use in my rules I get 
the exception below. Do I also need to load the spring jars for this to work or 
is it not possible?

Specifically I need my rules objects to have the @Component annotation so that 
they can be autowired.

Exception in thread pool-9-thread-1 java.lang.NoClassDefFoundError: 
javax/peristence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
at 
org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectCassLoader.java:99)
at 
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoadr.java:82)


Joe

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Pojo with spring dependency in DWB

2014-03-13 Thread Joe White
Ok thanks. If there is anything I can do to help let me know.

Joe

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 13, 2014 1:51 PM
To: Rules Users List
Subject: Re: [rules-users] Pojo with spring dependency in DWB


That's something I'm working on right now.

Some where in the dependency chain for @Component is EntityManager that is not 
included in your project's dependencies (I guess scope provided but it can 
occur for other reasons).

The best we're going to be able to achieve is handle the exception better in 
the workbench code. We can't do much about dependency chains.

Sent on the move
On 13 Mar 2014 19:42, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Here is a better more complete stack trace:

Exception in thread pool-9-thread-8 java.lang.NoClassDefFoundError: javax/pers
istence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
at 
org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:99)
at 
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at 
org.kie.scanner.KieModuleMetaDataImpl.getClass(KieModuleMetaDataImpl.java:91)
at org.guvnor.common.services.builder.Builder.build(Builder.java:162)
at 
org.guvnor.common.services.builder.BuildServiceImpl.doBuild(BuildServiceImpl.java:122)
at 
org.guvnor.common.services.builder.BuildServiceImpl.build(BuildServiceImpl.java:77)
at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.build(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$3.run(ResourceChangeIncrementalBuilder.java:214)

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 13, 2014 1:24 PM
To: Rules Users List
Subject: [rules-users] Pojo with spring dependency in DWB

What is the best way to import a jar that has a spring dependency into the 
Drools Workbench? When I upload my pojos that I intend use in my rules I get 
the exception below. Do I also need to load the spring jars for this to work or 
is it not possible?

Specifically I need my rules objects to have the @Component annotation so that 
they can be autowired.

Exception in thread pool-9-thread-1 java.lang.NoClassDefFoundError: 
javax/peristence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
at 
org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectCassLoader.java:99)
at 
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoadr.java:82)


Joe


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Pojo with spring dependency in DWB

2014-03-13 Thread Joe White
For reference the uber jar approach also didn't work for this one. I created a 
jar with dependencies and added that and it still doesn't find the entity 
manager class. When adding spring-orm to the DWB manually (where the 
EntityManager lives)  I get the error below:

I'll keep after it to see if I can find an approach that works.

org.guvnor.common.services.shared.exceptions.GenericPortableException: 
mark/reset not supported
 
org.guvnor.common.services.backend.exceptions.ExceptionUtilities.handleException(ExceptionUtilities.java:24)
 
org.guvnor.m2repo.backend.server.FileServlet.uploadFile(FileServlet.java:180)
 
org.guvnor.m2repo.backend.server.FileServlet.processUpload(FileServlet.java:84)
 
org.guvnor.m2repo.backend.server.FileServlet.doPost(FileServlet.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
 
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
 
org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70)
 
org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266)


From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 13, 2014 1:51 PM
To: Rules Users List
Subject: Re: [rules-users] Pojo with spring dependency in DWB


That's something I'm working on right now.

Some where in the dependency chain for @Component is EntityManager that is not 
included in your project's dependencies (I guess scope provided but it can 
occur for other reasons).

The best we're going to be able to achieve is handle the exception better in 
the workbench code. We can't do much about dependency chains.

Sent on the move
On 13 Mar 2014 19:42, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Here is a better more complete stack trace:

Exception in thread pool-9-thread-8 java.lang.NoClassDefFoundError: javax/pers
istence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
at 
org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:99)
at 
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at 
org.kie.scanner.KieModuleMetaDataImpl.getClass(KieModuleMetaDataImpl.java:91)
at org.guvnor.common.services.builder.Builder.build(Builder.java:162)
at 
org.guvnor.common.services.builder.BuildServiceImpl.doBuild(BuildServiceImpl.java:122)
at 
org.guvnor.common.services.builder.BuildServiceImpl.build(BuildServiceImpl.java:77)
at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.build(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$3.run(ResourceChangeIncrementalBuilder.java:214)

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 13, 2014 1:24 PM
To: Rules Users List
Subject: [rules-users] Pojo with spring dependency in DWB

What is the best way to import a jar that has a spring dependency into the 
Drools Workbench? When I upload my pojos that I intend use in my rules I get 
the exception below. Do I also need to load the spring jars for this to work or 
is it not possible?

Specifically I need my rules objects to have the @Component annotation so that 
they can be autowired.

Exception in thread pool-9-thread-1 java.lang.NoClassDefFoundError: 
javax/peristence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800

Re: [rules-users] Pojo with spring dependency in DWB

2014-03-13 Thread Joe White
I get it for any jar where the WB doesn't seen the pom and I have to enter the 
artifact information manually.

Running on tomcat.



From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 13, 2014 2:36 PM
To: Rules Users List
Subject: Re: [rules-users] Pojo with spring dependency in DWB


Nice ;-)

Do you get that error when uploading any JAR to the maven repository? What 
application server is this?

Sent on the move
On 13 Mar 2014 20:27, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
For reference the uber jar approach also didn't work for this one. I created a 
jar with dependencies and added that and it still doesn't find the entity 
manager class. When adding spring-orm to the DWB manually (where the 
EntityManager lives)  I get the error below:

I'll keep after it to see if I can find an approach that works.

org.guvnor.common.services.shared.exceptions.GenericPortableException: 
mark/reset not supported
 
org.guvnor.common.services.backend.exceptions.ExceptionUtilities.handleException(ExceptionUtilities.java:24)
 
org.guvnor.m2repo.backend.server.FileServlet.uploadFile(FileServlet.java:180)
 
org.guvnor.m2repo.backend.server.FileServlet.processUpload(FileServlet.java:84)
 
org.guvnor.m2repo.backend.server.FileServlet.doPost(FileServlet.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
 
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
 
org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70)
 
org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266)


From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Thursday, March 13, 2014 1:51 PM
To: Rules Users List
Subject: Re: [rules-users] Pojo with spring dependency in DWB


That's something I'm working on right now.

Some where in the dependency chain for @Component is EntityManager that is not 
included in your project's dependencies (I guess scope provided but it can 
occur for other reasons).

The best we're going to be able to achieve is handle the exception better in 
the workbench code. We can't do much about dependency chains.

Sent on the move
On 13 Mar 2014 19:42, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Here is a better more complete stack trace:

Exception in thread pool-9-thread-8 java.lang.NoClassDefFoundError: javax/pers
istence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
at 
org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:99)
at 
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at 
org.kie.scanner.KieModuleMetaDataImpl.getClass(KieModuleMetaDataImpl.java:91)
at org.guvnor.common.services.builder.Builder.build(Builder.java:162)
at 
org.guvnor.common.services.builder.BuildServiceImpl.doBuild(BuildServiceImpl.java:122)
at 
org.guvnor.common.services.builder.BuildServiceImpl.build(BuildServiceImpl.java:77)
at 
org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.build(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
at 
org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$3.run(ResourceChangeIncrementalBuilder.java:214)

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Joe White
Sent: Thursday, March 13, 2014 1:24 PM

Re: [rules-users] Pojo with spring dependency in DWB

2014-03-13 Thread Joe White
1.Done. This is GUVNOR-2084https://issues.jboss.org/browse/GUVNOR-2084 If 
you need help reproducing ping me on IRC (JoeW) and we can do a hangout or 
screenshare. I didn't attach a test case but described by steps.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 13, 2014 3:02 PM
To: Rules Users List
Subject: Re: [rules-users] Pojo with spring dependency in DWB


Ok that explains it.

Could you be kind enough to open a GUVNOR JIRA for this (stating what you've 
said here) please?

Sent on the move
On 13 Mar 2014 20:57, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
I get it for any jar where the WB doesn't seen the pom and I have to enter the 
artifact information manually.

Running on tomcat.



From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Thursday, March 13, 2014 2:36 PM
To: Rules Users List
Subject: Re: [rules-users] Pojo with spring dependency in DWB


Nice ;-)

Do you get that error when uploading any JAR to the maven repository? What 
application server is this?

Sent on the move
On 13 Mar 2014 20:27, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
For reference the uber jar approach also didn't work for this one. I created a 
jar with dependencies and added that and it still doesn't find the entity 
manager class. When adding spring-orm to the DWB manually (where the 
EntityManager lives)  I get the error below:

I'll keep after it to see if I can find an approach that works.

org.guvnor.common.services.shared.exceptions.GenericPortableException: 
mark/reset not supported
 
org.guvnor.common.services.backend.exceptions.ExceptionUtilities.handleException(ExceptionUtilities.java:24)
 
org.guvnor.m2repo.backend.server.FileServlet.uploadFile(FileServlet.java:180)
 
org.guvnor.m2repo.backend.server.FileServlet.processUpload(FileServlet.java:84)
 
org.guvnor.m2repo.backend.server.FileServlet.doPost(FileServlet.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
 
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
 
org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70)
 
org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266)


From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Thursday, March 13, 2014 1:51 PM
To: Rules Users List
Subject: Re: [rules-users] Pojo with spring dependency in DWB


That's something I'm working on right now.

Some where in the dependency chain for @Component is EntityManager that is not 
included in your project's dependencies (I guess scope provided but it can 
occur for other reasons).

The best we're going to be able to achieve is handle the exception better in 
the workbench code. We can't do much about dependency chains.

Sent on the move
On 13 Mar 2014 19:42, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Here is a better more complete stack trace:

Exception in thread pool-9-thread-8 java.lang.NoClassDefFoundError: javax/pers
istence/EntityManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
at 
org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:99)
at 
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at 
org.kie.scanner.KieModuleMetaDataImpl.getClass(KieModuleMetaDataImpl.java:91

Re: [rules-users] Some basic questions/assumptions on Drools Work-bench/Guvnor

2014-03-06 Thread Joe White
On the topic of #7.

We are just adopting the Drools 6.x setup to achieve the goal you mention of 
business users creating and deploying business rules on their own.

The challenge is allowing your users to deploy in a targeted way since the 
drools workbench (DWB) doesn't have the concept of a deployment scope (dev, 
stage, prod). Here is my current thinking on managing lifecycle in 6.x:

Application Setup:

-  Create separate maven repositories for SNAPSHOT vs fixed version  
deployments and point your installed applications to those different 
repositories.

o   KIEScanners in test applications will point to snapshot versions.

o   KIEScanners in prod will point to version ranges like [1.3.0, 1.4.999]

-  Developers design and create package structure. Very important since 
a new Project in the DWB will require a software release

-  Developers design and create decision tables or guided rules for 
business users.

Business User SDLC flow:

-  User creates new rules in decision tables

-  User validates new rules and runs analysis on rules in the DWB

-  When a user wants to test their rules they create a snapshot from 
the DWB and deploy it . Jar gets deployed to only the snapshot repo

-  User tests their new rules in the stage system (auto picked up from 
KIEScanner)

-  Once they are happy they remove the SNAPSHOT designation, increment 
version, and deploy to prod (all in DWB)

-  Users tests their new rules in prod (auto picked up from KIEScanner)

A relatively sophisticated business user should be able to manage versioning in 
the DWB with a little training. I'm looking for other options as well if people 
have any.

Once we are successful with this I suspect we may try and build some rule 
lifecycle management into the workbench itself and contribute it back. But it 
is a longer term project.


From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Wednesday, March 05, 2014 1:27 PM
To: Rules Users List
Subject: Re: [rules-users] Some basic questions/assumptions on Drools 
Work-bench/Guvnor


6) Incorrect (well, almost.. read on). Real time would imply instant, zero 
latency, whereas for many use cases close to real time is often sufficient. 
If you read about KieScanner you will find you can have your application poll 
for updates to JARs* at a frequency you so desire.

(*) There are certain caveats that relate to standard maven best practice; for 
example if your JAR has a static version number (e.g. 1.0.0) you should not be 
changing its content (wheras a -SNAPSHOT is expected to change).

7) Drools itself does not impose any SDLC; you can use whatever you wish. 
Others who have used Drools in their applications may detail their experiences.

Sent on the move
On 5 Mar 2014 19:58, arvidj arv...@visi.commailto:arv...@visi.com wrote:
Sorry for follow-on basic questions. I am starting from scratch and therefore
do not have any Drools experience.

Already answered ...

1) Drools workbench/Guvnor is not a replacement for Eclipse.* - Correct*
2) Geeks like me develop the applications in Eclipse* - Correct*
3) Drools workbench will be mainly used by the Rule authors (Business
Analysts etc) once I set it up for them.* - Correct*
4) The anslysts will author the rules and test it in the workbench.* -
Correct*
5) They will build the DRLs into a jar and I include it as a dependency in
my POM.xml.*  - Correct*

Additional questions because I am new to Drools

6) Based on the answer to (5) the concept of real time rule replacement
does not exist. After the rules jar has been put into the Maven repository I
need to build my application and deploy it ... i.e. stop the currently
running application, remove it, install the new application and restart it.

7) If someone can point me at high level documentation related to the
complete Drools 6.0 rule software development lifecycle ... i.e. from rule
creation to actually executing in a production environment ... I would
appreciate it.

I have been asked to do a Proof of Concept. There is the impression I will
be able to prove that the business will be able to create their own rules
and deploy them into production without any IT intervention. I do not
believe this to be the case ... best SDLC practices not withstanding ... but
have not been able to find a Drools SDLC picture that shows all of the steps
necessary.

Thanks,
Arvid



--
View this message in context: 
http://drools.46999.n3.nabble.com/Some-basic-questions-assumptions-on-Drools-Work-bench-Guvnor-tp4028509p4028546.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list

Re: [rules-users] Some basic questions/assumptions on Drools Work-bench/Guvnor

2014-03-06 Thread Joe White
Maybe we can chat about it sometime in IRC. There is a chance I'll be able to 
get some dev effort on something like that in Q2 that we could contribute back 
(no promises though). Ping me if you have a minute.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 06, 2014 8:25 AM
To: Rules Users List
Subject: Re: [rules-users] Some basic questions/assumptions on Drools 
Work-bench/Guvnor

 ...build some rule lifecycle management into the workbench itself

This is on our road map.

On 6 March 2014 15:08, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
On the topic of #7.

We are just adopting the Drools 6.x setup to achieve the goal you mention of 
business users creating and deploying business rules on their own.

The challenge is allowing your users to deploy in a targeted way since the 
drools workbench (DWB) doesn't have the concept of a deployment scope (dev, 
stage, prod). Here is my current thinking on managing lifecycle in 6.x:

Application Setup:

-  Create separate maven repositories for SNAPSHOT vs fixed version  
deployments and point your installed applications to those different 
repositories.

o   KIEScanners in test applications will point to snapshot versions.

o   KIEScanners in prod will point to version ranges like [1.3.0, 1.4.999]

-  Developers design and create package structure. Very important since 
a new Project in the DWB will require a software release

-  Developers design and create decision tables or guided rules for 
business users.

Business User SDLC flow:

-  User creates new rules in decision tables

-  User validates new rules and runs analysis on rules in the DWB

-  When a user wants to test their rules they create a snapshot from 
the DWB and deploy it . Jar gets deployed to only the snapshot repo

-  User tests their new rules in the stage system (auto picked up from 
KIEScanner)

-  Once they are happy they remove the SNAPSHOT designation, increment 
version, and deploy to prod (all in DWB)

-  Users tests their new rules in prod (auto picked up from KIEScanner)

A relatively sophisticated business user should be able to manage versioning in 
the DWB with a little training. I'm looking for other options as well if people 
have any.

Once we are successful with this I suspect we may try and build some rule 
lifecycle management into the workbench itself and contribute it back. But it 
is a longer term project.


From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Wednesday, March 05, 2014 1:27 PM
To: Rules Users List
Subject: Re: [rules-users] Some basic questions/assumptions on Drools 
Work-bench/Guvnor


6) Incorrect (well, almost.. read on). Real time would imply instant, zero 
latency, whereas for many use cases close to real time is often sufficient. 
If you read about KieScanner you will find you can have your application poll 
for updates to JARs* at a frequency you so desire.

(*) There are certain caveats that relate to standard maven best practice; for 
example if your JAR has a static version number (e.g. 1.0.0) you should not be 
changing its content (wheras a -SNAPSHOT is expected to change).

7) Drools itself does not impose any SDLC; you can use whatever you wish. 
Others who have used Drools in their applications may detail their experiences.

Sent on the move
On 5 Mar 2014 19:58, arvidj arv...@visi.commailto:arv...@visi.com wrote:
Sorry for follow-on basic questions. I am starting from scratch and therefore
do not have any Drools experience.

Already answered ...

1) Drools workbench/Guvnor is not a replacement for Eclipse.* - Correct*
2) Geeks like me develop the applications in Eclipse* - Correct*
3) Drools workbench will be mainly used by the Rule authors (Business
Analysts etc) once I set it up for them.* - Correct*
4) The anslysts will author the rules and test it in the workbench.* -
Correct*
5) They will build the DRLs into a jar and I include it as a dependency in
my POM.xml.*  - Correct*

Additional questions because I am new to Drools

6) Based on the answer to (5) the concept of real time rule replacement
does not exist. After the rules jar has been put into the Maven repository I
need to build my application and deploy it ... i.e. stop the currently
running application, remove it, install the new application and restart it.

7) If someone can point me at high level documentation related to the
complete Drools 6.0 rule software development lifecycle ... i.e. from rule
creation to actually executing in a production environment ... I would
appreciate it.

I have been asked to do a Proof of Concept. There is the impression I will
be able to prove that the business will be able to create their own rules

Re: [rules-users] Some basic questions/assumptions on Drools Work-bench/Guvnor

2014-03-06 Thread Joe White
JoeW

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Thursday, March 06, 2014 11:20 AM
To: Rules Users List
Subject: Re: [rules-users] Some basic questions/assumptions on Drools 
Work-bench/Guvnor

Sure, what's your nic?

On 6 March 2014 15:58, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
Maybe we can chat about it sometime in IRC. There is a chance I'll be able to 
get some dev effort on something like that in Q2 that we could contribute back 
(no promises though). Ping me if you have a minute.

From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Thursday, March 06, 2014 8:25 AM

To: Rules Users List
Subject: Re: [rules-users] Some basic questions/assumptions on Drools 
Work-bench/Guvnor

 ...build some rule lifecycle management into the workbench itself

This is on our road map.

On 6 March 2014 15:08, Joe White 
joe.wh...@recondotech.commailto:joe.wh...@recondotech.com wrote:
On the topic of #7.

We are just adopting the Drools 6.x setup to achieve the goal you mention of 
business users creating and deploying business rules on their own.

The challenge is allowing your users to deploy in a targeted way since the 
drools workbench (DWB) doesn't have the concept of a deployment scope (dev, 
stage, prod). Here is my current thinking on managing lifecycle in 6.x:

Application Setup:

-  Create separate maven repositories for SNAPSHOT vs fixed version  
deployments and point your installed applications to those different 
repositories.

o   KIEScanners in test applications will point to snapshot versions.

o   KIEScanners in prod will point to version ranges like [1.3.0, 1.4.999]

-  Developers design and create package structure. Very important since 
a new Project in the DWB will require a software release

-  Developers design and create decision tables or guided rules for 
business users.

Business User SDLC flow:

-  User creates new rules in decision tables

-  User validates new rules and runs analysis on rules in the DWB

-  When a user wants to test their rules they create a snapshot from 
the DWB and deploy it . Jar gets deployed to only the snapshot repo

-  User tests their new rules in the stage system (auto picked up from 
KIEScanner)

-  Once they are happy they remove the SNAPSHOT designation, increment 
version, and deploy to prod (all in DWB)

-  Users tests their new rules in prod (auto picked up from KIEScanner)

A relatively sophisticated business user should be able to manage versioning in 
the DWB with a little training. I'm looking for other options as well if people 
have any.

Once we are successful with this I suspect we may try and build some rule 
lifecycle management into the workbench itself and contribute it back. But it 
is a longer term project.


From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Michael Anstis
Sent: Wednesday, March 05, 2014 1:27 PM
To: Rules Users List
Subject: Re: [rules-users] Some basic questions/assumptions on Drools 
Work-bench/Guvnor


6) Incorrect (well, almost.. read on). Real time would imply instant, zero 
latency, whereas for many use cases close to real time is often sufficient. 
If you read about KieScanner you will find you can have your application poll 
for updates to JARs* at a frequency you so desire.

(*) There are certain caveats that relate to standard maven best practice; for 
example if your JAR has a static version number (e.g. 1.0.0) you should not be 
changing its content (wheras a -SNAPSHOT is expected to change).

7) Drools itself does not impose any SDLC; you can use whatever you wish. 
Others who have used Drools in their applications may detail their experiences.

Sent on the move
On 5 Mar 2014 19:58, arvidj arv...@visi.commailto:arv...@visi.com wrote:
Sorry for follow-on basic questions. I am starting from scratch and therefore
do not have any Drools experience.

Already answered ...

1) Drools workbench/Guvnor is not a replacement for Eclipse.* - Correct*
2) Geeks like me develop the applications in Eclipse* - Correct*
3) Drools workbench will be mainly used by the Rule authors (Business
Analysts etc) once I set it up for them.* - Correct*
4) The anslysts will author the rules and test it in the workbench.* -
Correct*
5) They will build the DRLs into a jar and I include it as a dependency in
my POM.xml.*  - Correct*

Additional questions because I am new to Drools

6) Based on the answer to (5) the concept of real time rule replacement
does not exist. After the rules jar has been put into the Maven repository I
need to build my application and deploy

[rules-users] Drools in Glassfish 4 Ear

2014-03-06 Thread Joe White
This is just an FYI for drools users. When deploying an EAR to Glassfish 4 we 
received an exception about Weld dependency injection.

org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied 
dependencies for type [Injector] with qualifiers [@Default] at injection point 
[[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedMethod] @Inject 
org.sonatype.guice.bean.locators.DefaultBeanLocator.autoPublish(Injector)]

The solution that worked in our case was putting this setting in Glassfish:

asadmin set configs.config.server-config.cdi-service.enable-implicit-cdi=false

That solution is from this forum post (lots more detail there):
http://www.eclipse.org/forums/index.php/t/490794/

Took some time for me to figure out so figured it might help somebody someday.
Joe

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Proto Buf generated code and KIE

2014-02-17 Thread Joe White
We are starting to take a look at using the KIE workbench to expose some 
decision tables to our users. The original idea is to use generated java from a 
proto buffer schema as the model. I've got the jar building and imported into 
KIE. The challenge I'm running into is that the proto buff java doesn't contain 
the member definitions in a way that the KIE can see them. So I get all of the 
classes but can't access the actual data elemetns.

Has anybody tried this? Or know of a way to take a proto schema (or generated 
code) and import it as the model for KIE?

Thanks,

Joe

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Disabling strict mode in 5.4

2012-05-25 Thread Joe White
How do you disable strict mode in 5.4? We are using the code below and
getting strict mode exceptions. It worked in prior versions. Do you have
to use the new APIs to disable strict mode?

 

 

PackageBuilderConfiguration pkgBuilderCfg = new
PackageBuilderConfiguration();

MVELDialectConfiguration mvelConf = (MVELDialectConfiguration)
pkgBuilderCfg.getDialectConfiguration( mvel );

mvelConf.setStrict(false);

mvelConf.setLangLevel(5);

PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);

builder.addPackageFromDrl(new StringReader(drlString));

 

 

An example exception:

1.
19:17:51,137|ERROR|drools.DroolsMgr|DroolsMgr.java|159|deployRulesFromMo
delForScope|org.apache.camel.spring.Main.main()|smf-rcp-SNAPSHOT|Failed
to deploy rules from model

2.  com.recondotech.hre.rules.management.HRERulesManagmentException:
org.drools.rule.InvalidRulePackage: Unable to Analyse Expression
$existingValue.toLowerCase():

3.  [Error: unable to resolve method using strict-mode:
java.lang.Object.toLowerCase()]

4.  [Near : {... $existingValue.toLowerCase() }]

5.  ^ : [Rule
name='PEL_CHANGELIST_RES.AUTH.Actual First Name']

 

 

Thanks

Joe

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Memory Control

2012-05-25 Thread Joe White


-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Kang Heng WU
Sent: Friday, May 25, 2012 1:24 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] Memory Control

Hi All,

The performance of JBoss Expert and Fusion is fine. The throughput of
JBoss Expert and Fusion is about 9900 and 4500 messages per second. But
we meet the following problems.

When the number of handled messages is about 500,000, the performance of
Expert is very slow. Its memory is about 300 Mbyte. 

When the number of handled messages is about 300,000, the performance of
Fusion is very slow. Its memory is about 300 Mbyte.

What is the problem? How can we solve it?

Thanks in advance,
Kent

~
This message (including any attachments) is for the named
addressee(s)'s use only. It may contain sensitive, confidential,
private proprietary or legally privileged information intended for a
specific individual and purpose, and is protected by law. If you are
not the intended recipient, please immediately delete it and all copies
of it from your system, destroy any hard copies of it
and notify the sender. Any use, disclosure, copying, or distribution of
this message and/or any attachments is strictly prohibited.



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Disabling strict mode in 5.4

2012-05-25 Thread Joe White
The exception below is one of thousands like it. The problem is that the
data is coming from a Map and in strict mode mvel is unable to determine
the type. This rule works fine with strict mode off in 5.0.1 and 5.2.

The rule is:

rule PEL_CHANGELIST_RES.AUTH.Actual First Name extends
PEL_CHANGELIST_RES.AUTH.Actual Person Base
when   
   DalMap($existingValue : this['PERSON.FirstName'] != null) from
$existingPerson
   DalMap($mergedValue : this['PERSON.FirstName'] != null) from
$mergedPerson
   $lowerExisting : String() from $existingValue.toLowerCase()
   String(this != $lowerExisting) from $mergedValue.toLowerCase()
then
   $changeList.add(EncounterConsts.Episode.PersonRole.Person.path);
   update($in);
end

-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Friday, May 25, 2012 12:43 PM
To: Rules Users List
Subject: Re: [rules-users] Disabling strict mode in 5.4

Line 3 of the error message suggests that the parser isn't able to
determine the type of $existingValue as java.lang.String. So, strict
or no strict, the problem might be in the rule. Show?

-W



On 25/05/2012, Joe White joe.wh...@recondotech.com wrote:
 How do you disable strict mode in 5.4? We are using the code below and
 getting strict mode exceptions. It worked in prior versions. Do you
have
 to use the new APIs to disable strict mode?





 PackageBuilderConfiguration pkgBuilderCfg = new
 PackageBuilderConfiguration();

 MVELDialectConfiguration mvelConf = (MVELDialectConfiguration)
 pkgBuilderCfg.getDialectConfiguration( mvel );

 mvelConf.setStrict(false);

 mvelConf.setLangLevel(5);

 PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);

 builder.addPackageFromDrl(new StringReader(drlString));





 An example exception:

 1.

19:17:51,137|ERROR|drools.DroolsMgr|DroolsMgr.java|159|deployRulesFromMo

delForScope|org.apache.camel.spring.Main.main()|smf-rcp-SNAPSHOT|Failed
 to deploy rules from model

 2.  com.recondotech.hre.rules.management.HRERulesManagmentException:
 org.drools.rule.InvalidRulePackage: Unable to Analyse Expression
 $existingValue.toLowerCase():

 3.  [Error: unable to resolve method using strict-mode:
 java.lang.Object.toLowerCase()]

 4.  [Near : {... $existingValue.toLowerCase() }]

 5.  ^ : [Rule
 name='PEL_CHANGELIST_RES.AUTH.Actual First Name']





 Thanks

 Joe


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Disabling strict mode in 5.4

2012-05-25 Thread Joe White
Sorry about that. Here is the base rule:

rule PEL_CHANGELIST_RES.AUTH.Actual Person Base
when
$in : Map($merged : this['MERGED_EPISODE'] != null, $existing :
this['REFERENCE_EPISODE'] != null,  $changeList :
this['AUTH_CHANGELIST'] != null)
not(String(this ==
EncounterConsts.Episode.PersonRole.Person.path) from $changeList)
DalMap($existingPersonRoles : this['EPISODE.PERSON_ROLE'] !=
null) from $existing
DalMap(this[EncounterConsts.PersonRole.RoleType] == 1,
$existingPersons : this['PERSON_ROLE.PERSON'] != null) from
$existingPersonRoles
DalMap($mergedPersonRoles : this['EPISODE.PERSON_ROLE'] != null)
from $merged
DalMap(this[EncounterConsts.PersonRole.RoleType] == 1,
$mergedPersons : this['PERSON_ROLE.PERSON'] != null) from
$mergedPersonRoles
$existingPerson : DalMap() from $existingPersons
$mergedPerson : DalMap() from $mergedPersons
then
end

And here is the original again:

rule PEL_CHANGELIST_RES.AUTH.Actual First Name extends
PEL_CHANGELIST_RES.AUTH.Actual Person Base
when   
   DalMap($existingValue : this['PERSON.FirstName'] != null) from
$existingPerson
   DalMap($mergedValue : this['PERSON.FirstName'] != null) from
$mergedPerson
   $lowerExisting : String() from $existingValue.toLowerCase()
   String(this != $lowerExisting) from $mergedValue.toLowerCase()
then
   $changeList.add(EncounterConsts.Episode.PersonRole.Person.path);
   update($in);
end


In terms of your why not there is no reason not to structure it your
way other than I have lots of rules structured this way that I would
rather not re-write. If it helps in terms of getting strict mode
disabled I can find a more semantically pleasing example. The heart of
the problem is that you cannot interact with data that comes from a Map
with strict mode turned on.

-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Friday, May 25, 2012 1:40 PM
To: Rules Users List
Subject: Re: [rules-users] Disabling strict mode in 5.4

On 25/05/2012, Joe White joe.wh...@recondotech.com wrote:
 The exception below is one of thousands like it. The problem is that
the
 data is coming from a Map and in strict mode mvel is unable to
determine
 the type. This rule works fine with strict mode off in 5.0.1 and 5.2.

 The rule is:

Well... Don't you mean part of the rule is:?


 rule PEL_CHANGELIST_RES.AUTH.Actual First Name extends
 PEL_CHANGELIST_RES.AUTH.Actual Person Base
 when
DalMap($existingValue : this['PERSON.FirstName'] != null) from
 $existingPerson

Unlikely: Where is $existingPerson coming from?

DalMap($mergedValue : this['PERSON.FirstName'] != null) from
 $mergedPerson

Unlikely: Where is $mergedPerson coming from?


$lowerExisting : String() from $existingValue.toLowerCase()
String(this != $lowerExisting) from $mergedValue.toLowerCase()

Why not simply:
 eval(  ! $existingValue.toLowerCase().equals(
$mergedValue.toLowerCase() ) )

 then

$changeList.add(EncounterConsts.Episode.PersonRole.Person.path);

$changeList ??

update($in);

$in ??
 end

 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang
Laun
 Sent: Friday, May 25, 2012 12:43 PM
 To: Rules Users List
 Subject: Re: [rules-users] Disabling strict mode in 5.4

 Line 3 of the error message suggests that the parser isn't able to
 determine the type of $existingValue as java.lang.String. So, strict
 or no strict, the problem might be in the rule. Show?

 -W



 On 25/05/2012, Joe White joe.wh...@recondotech.com wrote:
 How do you disable strict mode in 5.4? We are using the code below
and
 getting strict mode exceptions. It worked in prior versions. Do you
 have
 to use the new APIs to disable strict mode?





 PackageBuilderConfiguration pkgBuilderCfg = new
 PackageBuilderConfiguration();

 MVELDialectConfiguration mvelConf = (MVELDialectConfiguration)
 pkgBuilderCfg.getDialectConfiguration( mvel );

 mvelConf.setStrict(false);

 mvelConf.setLangLevel(5);

 PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);

 builder.addPackageFromDrl(new StringReader(drlString));





 An example exception:

 1.


19:17:51,137|ERROR|drools.DroolsMgr|DroolsMgr.java|159|deployRulesFromMo


delForScope|org.apache.camel.spring.Main.main()|smf-rcp-SNAPSHOT|Failed
 to deploy rules from model

 2.  com.recondotech.hre.rules.management.HRERulesManagmentException:
 org.drools.rule.InvalidRulePackage: Unable to Analyse Expression
 $existingValue.toLowerCase():

 3.  [Error: unable to resolve method using strict-mode:
 java.lang.Object.toLowerCase()]

 4.  [Near : {... $existingValue.toLowerCase() }]

 5.  ^ : [Rule
 name='PEL_CHANGELIST_RES.AUTH.Actual First Name']





 Thanks

 Joe


 ___
 rules-users mailing list
 rules-users

[rules-users] Rulebase locking

2012-01-12 Thread Joe White
We have encountered a problem with a lock getting generated on an
AbstractRuleBase and then never released causing new threads to not be
able to execute in that RuleBase. We are on an older version 5.0.1 of
Drools and are working on creating a unit test that we can use to see if
the defect exists in newer releases. That said, any tips that somebody
might have to reproduce a concurrency issue related to rule bases used
across threads would be very helpful. Or if there are other similar JIRA
entries that we can look at that?

 

This occurs only when the system is under relatively high load and there
potentially could be 100 threads attempting to access and use the same
rulebase.

 

This is very similar to this JIRA:

https://issues.jboss.org/browse/JBRULES-2086?page=com.atlassian.jira.plu
gin.system.issuetabpanels:all-tabpanel

 

We have confirmed that we have the fix generated in that ticket.

 

The general related stack traces for the waiting threads is  :

 

java.lang.Thread.State: WAITING

   ...

at
java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(Reentran
tReadWriteLock.java:423)

at
org.drools.common.AbstractRuleBase.readLock(AbstractRuleBase.java:414)

at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:866)

at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:788)

   ...

 

 

   java.lang.Thread.State: BLOCKED on
org.drools.reteoo.ReteooStatefulSession@fec3cf owned by:
DefaultMessageListenerContainer-145

at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:627)

at
org.drools.base.FireAllRulesRuleBaseUpdateListener.beforeRuleBaseUnlocke
d(FireAllRulesRuleBaseUpdateListener.java:41)

at
org.drools.event.RuleBaseEventSupport.fireBeforeRuleBaseUnlocked(RuleBas
eEventSupport.java:123)

at
org.drools.common.AbstractRuleBase.unlock(AbstractRuleBase.java:408)

at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:517
)

at
org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)

.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] String.format question in the RHS

2011-08-19 Thread Joe White
What error do you get in the rule or does it just not format correctly?

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Dean Whisnant
Sent: Friday, August 19, 2011 8:51 AM
To: Rules Users List
Subject: [rules-users] String.format question in the RHS

 

Hello,

 

Can anyone see an issue with the following RHS?  The String.format is
failing.  I've copied it straight into java to verify my intentions and
it works there.

 

What I'm trying to accomplish is to concatenate the string UH005 with a
sequence number that is a fixed 10 digits, zero filled.  So if
CurrentClaimSeq_48 is the number 123, then I expect that TRN02_Check...
would be populated with UH005000123.

 

Again, this is working fine in straight java, but not in a rule.  What
am I missing?  Is there a better way to try to accomplish this in a
rule?

 

rule L1000_TRN02_UHC_BPA

dialect mvel

when

CLM_835_SUPP( seq : currentClaimSeq_48 != ( null ) )

CLM_DET_LOAD( )

trn : x221TransactionHeader_TRN_ReassociationTraceNumber( )

then

trn.setTRN02_CheckOrEftTraceNumber( UH005 + String.format
(%010d, seq) );

end

 

 

Here are the data types of the two fields involved.

 

private Integer CurrentClaimSeq_48;

 

public String TRN02_CheckOrEftTraceNumber;

 

Thank you!

 

Dean

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] String.format question in the RHS

2011-08-19 Thread Joe White
I got it to work in mvel. You need to pass the second argument as an
mvel array (note the curly braces) for it to recognize the method
signature. 

 

Here is a rule that works for me:

 

import java.util.Map;

import java.util.ArrayList;

import java.util.List;

import java.lang.String;

import com.recondotech.droolsTest.TestInput;

import com.recondotech.droolsTest.TestConts;

import com.recondotech.droolsTest.TestMap;

 

dialect mvel

 

 

rule map list test rule

salience 155

when

  TestInput(val : val!=null)

then

  

  

  String result = String.format(%010d,{val});

  System.out.println(result);

end

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Friday, August 19, 2011 9:34 AM
To: Rules Users List
Subject: Re: [rules-users] String.format question in the RHS

 

Do not use dialect mvel. 
-W



2011/8/19 Dean Whisnant d...@basys.com

Hello,

 

Can anyone see an issue with the following RHS?  The String.format is
failing.  I've copied it straight into java to verify my intentions and
it works there.

 

What I'm trying to accomplish is to concatenate the string UH005 with a
sequence number that is a fixed 10 digits, zero filled.  So if
CurrentClaimSeq_48 is the number 123, then I expect that TRN02_Check...
would be populated with UH005000123.

 

Again, this is working fine in straight java, but not in a rule.  What
am I missing?  Is there a better way to try to accomplish this in a
rule?

 

rule L1000_TRN02_UHC_BPA

dialect mvel

when

CLM_835_SUPP( seq : currentClaimSeq_48 != ( null ) )

CLM_DET_LOAD( )

trn : x221TransactionHeader_TRN_ReassociationTraceNumber( )

then

trn.setTRN02_CheckOrEftTraceNumber( UH005 + String.format
(%010d, seq) );

end

 

 

Here are the data types of the two fields involved.

 

private Integer CurrentClaimSeq_48;

 

public String TRN02_CheckOrEftTraceNumber;

 

Thank you!

 

Dean


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Condition syntax to access Map

2011-07-28 Thread Joe White
I'm 100% with Edson on this one. 

 

Requiring explicit syntax, whether via null checks or  .?, can have a
big impact on the clarity and level of declarativeness (word?) of a
given ruleset. It also makes it a great deal harder to develop DSLs and
systems to put rules into the hands of non-developers because then
you're requiring those users to bring with them the imperative
programming mindset of checking every data point before using it. 

 

I think that Edson's example of making the whole expression false if any
object on the call stack is null independent of the value is an
excellent convention.

 

Joe

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Mark Proctor
Sent: Thursday, July 28, 2011 1:35 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Condition syntax to access Map

 

if we do implicit .? support people will still be able to do null
checks. So it's not one or the other.

Mark
On 28/07/2011 20:07, Greg Barton wrote: 

+1 

 

Naw

 

+billion

--- On Thu, 7/28/11, Edson Tirelli ed.tire...@gmail.com
mailto:ed.tire...@gmail.com  wrote:




From: Edson Tirelli ed.tire...@gmail.com mailto:ed.tire...@gmail.com

Subject: Re: [rules-users] Condition syntax to access Map
To: Rules Users List rules-users@lists.jboss.org
mailto:rules-users@lists.jboss.org 
Date: Thursday, July 28, 2011, 1:13 PM

 

   All,

 

   I think we need to differentiate paradigms here. When using rules,
contrary to imperative code, what we are doing is pattern matching.

 

X( a.b.c == value )

 

   In the above case, we are looking for Xs that make that whole
constraint true (i.e. match). If a or b are null, the whole expression
will be false, does not matter the value of c or the value it is being
compared against. Raising a null pointer exception, IMO, brings no
advantage at all to the table... on the contrary, makes writing rules
more difficult. 

 

   Another example we had in the past:

 

class Circle implements Shape

class Square implements Shape

 

rule X

when

Circle() from $shapes

...

 

   In the above example, $shapes is a list and the rule is clearly
looking for Circles. If there are Squares in there, they will just not
match. Raising a ClassCastException like it would happen in an
imperative language brings no advantage to the table, IMO.

 

   So, IMO, all property navigation should be null pointer safe in the
LHS of the rules. 

 

   This is not what happens today, but I think it should be fixed.

 

   Edson

 

  

  

2011/7/28 Vincent LEGENDRE vincent.legen...@eurodecision.com

Hi all,

I agree with W. : NPE should be the default, and null cases behaviour
should be planned by programmers.
But I am not sure about using a new operator in rules (and do the update
in Guvnor ...). 
Why not using some drools annotations on the getter specifying the
behaviour of an eval on a null value returned by this getter ? 
And may be these annotation could be added to an existing POJO via the
declared type syntax (just like event role in fusion) ?

Vincent.


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com


-Inline Attachment Follows-

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users






___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Possibly stupid question... but I have to ask

2011-07-28 Thread Joe White
Why would you need to do that? This flow is logically the same.

rule my rule
when
   ...
then

//Java code to modify fact goes here
insert( fact );
end


Joe
-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of menada
Sent: Thursday, July 28, 2011 2:20 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Possibly stupid question... but I have to ask

I meant to insert a fact and immediatly modify it, in the same rule
consequence.
I know you can insert OR modify in a consequence.
I also know that when you modify a fact you actually retract the old one
and
insert a new one with the respective properties set.

So, my question was, can you do something like this ? 
rule my rule
when
   ...
then
insert( fact );
modify (fact );
end

Where fact is the same?

And if it's possible, can you give me a simple example?


--
View this message in context:
http://drools.46999.n3.nabble.com/rules-users-Possibly-stupid-question-b
ut-I-have-to-ask-tp3207666p3207709.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Integration for which Camel Version?

2011-07-19 Thread Joe White
Check your version of spring. Camel 2.7 requires Spring 3.x

-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Andre
Sent: Tuesday, July 19, 2011 8:07 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Drools Integration for which Camel Version?

thx
  with version 2.7.0 this happens.. 
rror occurred while running main from: org.apache.camel.spring.Main
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:415)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NoSuchMethodError:
org.springframework.jms.listener.DefaultMessageListenerContainer.setTask
Executor(Ljava/util/concurrent/Executor;)V
at
org.apache.camel.component.jms.JmsEndpoint.configureListenerContainer(Jm
sEndpoint.java:189)
at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.ja
va:213)
at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.ja
va:157)
at
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.ja
va:67)
at
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenCo
nsumerRoute.java:61)
at
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:
75)
at
org.apache.camel.impl.RouteService.warmUp(RouteService.java:128)
at
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelCon
text.java:1832)
at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(Defau
ltCamelContext.java:1758)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultC
amelContext.java:1548)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelConte
xt.java:1440)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.ja
va:1336)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.ja
va:164)
at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java
:1314)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext
.java:203)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCame
lContext.java:101)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(Camel
ContextFactoryBean.java:238)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.mult
icastEvent(SimpleApplicationEventMulticaster.java:97)
at
org.springframework.context.support.AbstractApplicationContext.publishEv
ent(AbstractApplicationContext.java:303)
at
org.springframework.context.support.AbstractApplicationContext.finishRef
resh(AbstractApplicationContext.java:911)
at
org.springframework.context.support.AbstractApplicationContext.refresh(A
bstractApplicationContext.java:428)
at
org.springframework.context.support.ClassPathXmlApplicationContext.init
(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.init
(ClassPathXmlApplicationContext.java:93)
at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:1
85)
at org.apache.camel.spring.Main.doStart(Main.java:139)
at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
at org.apache.camel.impl.MainSupport.run(MainSupport.java:136)
at org.apache.camel.impl.MainSupport.run(MainSupport.java:322)
at org.apache.camel.spring.Main.main(Main.java:72)
... 6 more



--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-Integration-for-which-Camel-Ver
sion-tp3182385p3182611.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to the set drools.dialect.mvel.strictusingDrools+Spring?

2011-06-17 Thread Joe White
Nicolas, 

Strict mode works in 5.2. If you set drools.dialect.mvel.strict=false as a 
system property it will work correctly. If you want to do it all in spring you 
can set system properties in your spring config but make sure that the property 
is set before the Drools beans are initialized. Setting it via a system 
property will only work one time after that it is cached in the confi.

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Joe White
Sent: Thursday, June 16, 2011 11:49 AM
To: Rules Users List
Subject: Re: [rules-users] How to the set 
drools.dialect.mvel.strictusingDrools+Spring?

Can you try adding an explicit cast for the result of the hashMap on the RHS. 
Would be a workaround for now. I'm working on a test for scrict mode in 5.2.

So your RHS would be something like:

actuator.writeOutput(kcontext, (MyObj)hashMap.get($event.userId));

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Nicolás Sanchez
Sent: Thursday, June 16, 2011 11:42 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] How to the set drools.dialect.mvel.strict 
usingDrools+Spring?

This is the rule, that used to work on drools 5.1.1 and now fails when
compiling in drools 5.2.0.CR1

rule Transaction at unusual hours
dialect mvel

when
$event : Event( callDateTime.hours = 2,
callDateTime.hours = 6,
amount  4000) from entry-point Event
then

 actuator.writeOutput(kcontext, hashMap.get($event.userId));
end

The error that throws, is the next one:

[Error: unable to resolve method using strict-mode:
com.wordpress.nicozan.Actuator.writeOutput(org.drools.spi.KnowledgeHelper,
java.lang.Object)]
[Near : {... actuator.writeOutput(kcontext, hashMap. }]







--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-How-to-the-set-drools-dialect-mvel-strict-using-Drools-Spring-tp3064468p3072994.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage

2011-06-16 Thread Joe White
It is a bit dated now (we're on 5.0.1) but this works on that release:
 
  FileOutputStream fos = new
FileOutputStream(drlcFile);
  ObjectOutputStream oos = new
ObjectOutputStream(fos);
oos.writeObject(pkg);
oos.close();

Joe

-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of lhorton
Sent: Thursday, June 16, 2011 10:28 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage

I revised my method to write a single package and to use the Drools
stream
classes:

KnowledgePackage pkg = packages.iterator().next();
DroolsObjectOutputStream out;
try {
out = new DroolsObjectOutputStream(new
FileOutputStream(outFilePath));
DroolsStreamUtils.streamOut(out, pkg,
Boolean.TRUE);
out.close();
} catch (IOException ex) {
logger.debug(ex.getMessage());
}

I tested this with the compression option and without, but knowledge
agent
still cannot deserialize.  I now get exception: 
Caused by: java.io.OptionalDataException
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1339)
at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:2
05)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:1
74)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(Knowl
edgeAgentImpl.java:653)

--
View this message in context:
http://drools.46999.n3.nabble.com/rules-users-KnowledgeAgent-exception-w
hile-trying-to-deserialize-KnowledgeDefinitionsPackage-tp3064043p3072696
.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to the set drools.dialect.mvel.strict usingDrools+Spring?

2011-06-16 Thread Joe White
Can you try adding an explicit cast for the result of the hashMap on the RHS. 
Would be a workaround for now. I'm working on a test for scrict mode in 5.2.

So your RHS would be something like:

actuator.writeOutput(kcontext, (MyObj)hashMap.get($event.userId));

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Nicolás Sanchez
Sent: Thursday, June 16, 2011 11:42 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] How to the set drools.dialect.mvel.strict 
usingDrools+Spring?

This is the rule, that used to work on drools 5.1.1 and now fails when
compiling in drools 5.2.0.CR1

rule Transaction at unusual hours
dialect mvel

when
$event : Event( callDateTime.hours = 2,
callDateTime.hours = 6,
amount  4000) from entry-point Event
then

 actuator.writeOutput(kcontext, hashMap.get($event.userId));
end

The error that throws, is the next one:

[Error: unable to resolve method using strict-mode:
com.wordpress.nicozan.Actuator.writeOutput(org.drools.spi.KnowledgeHelper,
java.lang.Object)]
[Near : {... actuator.writeOutput(kcontext, hashMap. }]







--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-How-to-the-set-drools-dialect-mvel-strict-using-Drools-Spring-tp3064468p3072994.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to the set drools.dialect.mvel.strict usingDrools+Spring?

2011-06-15 Thread Joe White
Can you paste the rule that is failing? I'll see if I can create a unit test in 
drools to see if we can reproduce it and open a Jira for it.

Joe

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Nicolás Sanchez
Sent: Wednesday, June 15, 2011 12:07 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] How to the set drools.dialect.mvel.strict 
usingDrools+Spring?


Thx for the answer, but I have tried the line you recommended and it is not
working.
My rules tests used to work on drools 5.1.1 but now in drools 5.2.0.GR1 they
don't.

The error that appears when in run the test is this:

[Error: unable to resolve method using strict-mode: ...
[Near : {... actuator.writeOutput(kcontext, hashMap. }]

this actuator is global variable and writeOutput method is call in the RHS.

Nicolas,

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-How-to-the-set-drools-dialect-mvel-strict-using-Drools-Spring-tp3064468p3068581.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to the set drools.dialect.mvel.strict usingDrools+Spring?

2011-06-14 Thread Joe White
I'm not sure how to do it in spring but I know you can set it with an argument 
to the jvm.

 

-Ddrools.dialect.mvel.strict=false

 

 

 

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Nicolás Sanchez
Sent: Tuesday, June 14, 2011 1:10 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] How to the set drools.dialect.mvel.strict 
usingDrools+Spring?

 

Hi,
I am using Drools 5.2.0.CR1 and I am using Drools+String to instantiate my 
drools session. I would like to know how can I set the 
drools.dialect.mvel.strict property using Spring.

Any help would be great!

-- 

Nicolás Sanchez

 

 

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] list operations in then part

2011-06-02 Thread Joe White
If you cast $b on the RHS it will probably work. We've had to do this in
the past for rules like this.

 



then:
 Test fact = new Test();

Book rhsBook = (Book)$b;
 fact.getList().addAll( rhsBook.authors );
 insert(fact);
end

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Mark Proctor
Sent: Thursday, June 02, 2011 8:52 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] list operations in then part

 

On 02/06/2011 08:14, Wolfgang Laun wrote: 

On 1 June 2011 21:43, Simon Chen simonche...@gmail.com wrote:

Hi all,

I am always confused about what we can do in the then part of
the rule.

In particular, I have problem duplicate a list. For example:

when:
 $b: Book( james memberOf authors )
then:
 Test fact = new Test();
 fact.getList().addAll( $b.authors );
 insert(fact);
end

The error message reads like this:

BuildError: Unable to build expression for 'consequence':
[Error:
Failed to compile: 2 compilation error(s):
 - (1,7) unqualified type in strict mode for: $b
 - (1,12) unqualified type in strict mode for: authors]

What is the right way to do this?


Granted - the error message is a puzzle in itself, but basically, the
RHS must be written according to Java rules. Hence, if $b is an object
of type Book, $b.authors depends on the (Java!) visibility of member
authors. If it isn't public, you must use the getter.

I believe he's using mvel judging by the error.

mark




-W
 


Thanks.
-Simon
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users





 
 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] large rulebase load time

2011-01-13 Thread Joe White
For a large rulebase (200k+ rules) will the call to
addPackageFromDrl(drlString) run faster if the number of rules is
smaller but the rules include more || statements between predicates? 

 

There is only one type of object ever inserted in working memory and I
have many rules with the same RHS. I can collapse those rules into one
LHS with ors between the predicates in the object, but I would only go
through the effort of optimizing if it would improve load time.

 

Thanks for your help.

Joe

 

 

This message is confidential. It may also be privileged or otherwise
protected by work product immunity or other legal rules. If you have
received it by mistake, please let us know by e-mail reply and delete it
from your system. You may not copy this message or disclose its contents
to anyone. The integrity and security of this message cannot be
guaranteed on the Internet.

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] large rulebase load time

2011-01-13 Thread Joe White
Hey Edson,

 

Right now we use only one builder and we add one large file. In the past
we used multiple builders and files but using a single builder with one
large file is much faster.  I will have to gather the timing for the
differences for the package call versus adding to the kbase. Right now
we only collect the combined time.

 

We are still on an older version but are upgrading now to 5.2. I'll let
you know if the new API helps. I'll give trunk a shot but I won't be
able to use it because we are targeting having this large rulebase in
production in mid-February.

 

For reference our current largest production rulebase is ~76,000 rules.
Those rules take around 7 minutes to add to the package and the rulebase
in a JVM with 2GB of allocated heap.

 

Thanks

Joe

This message is confidential. It may also be privileged or otherwise
protected by work product immunity or other legal rules. If you have
received it by mistake, please let us know by e-mail reply and delete it
from your system. You may not copy this message or disclose its contents
to anyone. The integrity and security of this message cannot be
guaranteed on the Internet.

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, January 13, 2011 10:14 AM
To: Rules Users List
Subject: Re: [rules-users] large rulebase load time

 

 

   Joe,

 

   To be honest, I don't know. My guess is it would be a bit faster as
the consequence would be compiled only once, but I have no numbers to
compare... question: are you using a single builder and adding multiple
files/rules to it, or are you using one builder per file? Is your
application spending most of the time on the builder or adding rules to
the kbase? I see you are still using the old API (method
addPackageFromDRL())... does the new API make any difference? Also, I
know Tihomir was improving perf in trunk by caching the configuration
file... did you tried trunk? Does it make difference for you?

 

   Edson

 

2011/1/13 Joe White joe.wh...@recondotech.com

For a large rulebase (200k+ rules) will the call to
addPackageFromDrl(drlString) run faster if the number of rules is
smaller but the rules include more || statements between predicates? 

 

There is only one type of object ever inserted in working memory and I
have many rules with the same RHS. I can collapse those rules into one
LHS with ors between the predicates in the object, but I would only go
through the effort of optimizing if it would improve load time.

 

Thanks for your help.

Joe

 

 

This message is confidential. It may also be privileged or otherwise
protected by work product immunity or other legal rules. If you have
received it by mistake, please let us know by e-mail reply and delete it
from your system. You may not copy this message or disclose its contents
to anyone. The integrity and security of this message cannot be
guaranteed on the Internet.

 


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] foreach in drl file

2009-02-16 Thread Joe White
Phil,
Take a look at the manual and look for the forall LHS conditional element if 
you can pass all of your objects individually. Or if you must pass your items 
into WM as a List then take a look at the collect LHS element examples.

In your example if you wanted to say All Golfers have red pants it would look 
something like


import com.sample.Golfer;
import java.util.List;
import java.util.ArrayList;

rule test
when

$list : List() //--The list you use insert into working memory
ArrayList( size == $list.size) from collect (Golfer(pantsColor==red) 
from $list)

then
System.out.println(HIT);
End

I didn't run it but you get the idea.

Joe
-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of can_...@gmx.de
Sent: Monday, February 16, 2009 3:58 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] foreach in drl file

Hello,


 maybe you can tell us what you are trying to do? Are you talking about  
 the RHS?
 
 --Ingomar

thank you for your reply. I would like to use a template drl file together with 
a java class. Both the LHS and RHS should contain variables, where the LHS 
should itterate over a collection in the when part.

So for example, in the golf example, I would like a foreach which itterates 
through a list in my java class, e.g. Golfer, and addes the conditions in the 
collection to my rule with ANDs.

rule find solution
when
// cut 

Golfer( 

@foreach{item : products} 
- @{item.serialNumber}
@end{}

)

then
   // do something
end

My problem is that I don't really know how to write the foreach syntax.
Hope this is clear.

Thank you.
Phil

 Am 16.02.2009 um 23:15 schrieb can_...@gmx.de:
 
  Hello,
 
  I would like to itterate over a list in a drl template file, I  
  looked at http://mvel.codehaus.org/MVEL+2.0+Orb+Tags
 
  @foreach{item : products}
  - @{item.serialNumber}
  @end{}
 
  but I just can't get the syntax right. Could someone please post an  
  example drl file with a foreach.
 
  Thank you very much.
  Phil
  -- 
  Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL
  für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/? 
  ac=OM.AD.PD003K11308T4569a
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] foreach in drl file

2009-02-16 Thread Joe White
In the case below you don't need to iterate manually. You can use the 
contains LHS element. Take a look at the manual and you will see it. Or you 
can insert your List directly and use the from LHS element

Using from it might look like:

rule test
when

String(this==10) //--The time
friends : List() //--Your friends collection

String(this==myFriend) from friends

then
System.out.println(HIT);
end

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of can_...@gmx.de
Sent: Monday, February 16, 2009 4:40 PM
To: Rules Users List
Subject: Re: [rules-users] foreach in drl file

Thanks for the reply Ingomar.

 I am still not quite there.
  , I would like a foreach which itterates through a list in my java  
 class, e.g. Golfer, and addes the conditions in the collection to my  
 rule with ANDs
 So the condition is where?
 
 What I would be looking for is a plain text description of the rule, ie.
 find all  serial numbers of all Golfer objects that have ...  Or  
 something like that.
 Prose is usually a fairly good starting point for transcribing into  
 rules/drl.

I will try, hopefully it is a bit clearer this time. 


friends = ['Mike', 'Tom', 'Anna'] // this is the collection I want to itterate 
over

time = 10



When my 'friend' is one of 'friends' and time is 10 o'clock then ring my alarm.


Hope this shows where I would like the collection to get into play.

Thank you,
Phil


-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] DRL package builder or rule base error

2008-11-21 Thread Joe White
Vanshi,
In general it would be better to put all of the rules together in the
same drl file as they all relate to the same object and are all destined
for the same rule base. Though there is nothing fundamentally incorrect
about your approach in most cases you want related rules to managed and
deployed together.

As for your exception it is impossible to say without seeing your rules
and the exception. You can try sending them to the list and maybe
somebody will be able to help you.

Joe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of vanshi
Sent: Friday, November 21, 2008 11:28 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] DRL package builder or rule base error


Hi all,

I have some set of rules which work on same Person object but depending
on
whether a person is student/employee/Faculty, the rule will have
dfferent
logic.

So, I've made 3 .drl files, one will have all the rules for students,
other
for employee and then last .drl for faculty. All 3 .drl have same
package
name (as the first statement in drl) but all rules are named
differently.
When my rule engine starts, it reads these 3 drl files and adds them to
a
single rule base, starts a new session, inserts person in working memory
and
fires rules.

Now, my questions are...is there anything odd/wrong with this approach?
Secondly, I had some rules names same in different drl and when I
changed
them then I started getting null pointer exception error. during
parsing of drl files. Any idea why is that?

code snippet:

list=new ArrayListFile();
list.add(new File(students.drl));
list.add(new File(emloyee.drl);
list.add(new File(faculty.drl));

IteratorFile it = list.iterator();
ruleBase = RuleBaseFactory.newRuleBase();
builder = new PackageBuilder();
Reader source=null;
while(it.hasNext())
{
source =  new
InputStreamReader(RuleEngine.class.getResourceAsStream(it.next().toStrin
g()));
builder.addPackageFromDrl(source);
//if DRL has errors don't add it to the RuleBase
if(builder.hasErrors())
log4j.logError(RuleEngine.class,
builder.getErrors().toString());
else
ruleBase.addPackage(builder.getPackage());
 }
workingMemory = ruleBase.newStatefulSession();
workingMemory.insert(person);
workingMemory.fireAllRules();
-- 
View this message in context:
http://www.nabble.com/DRL-package-builder-or-rule-base-error-tp20627083p
20627083.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] PackageBuilderConfigurations and RuleFlows Drools 5

2008-11-19 Thread Joe White
Keith,
If you're using the Java dialect try this syntax

Try this syntax:
JavaDialectConfiguration javaConf = (JavaDialectConfiguration)
pkgBuilderCfg.getDialectConfiguration( java );
javaConf.setCompiler( JavaDialectConfiguration.JANINO );

PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);


Joe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of keithnielsen
Sent: Wednesday, November 19, 2008 8:30 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] PackageBuilderConfigurations and RuleFlows Drools
5


I have the following code:

PackageBuilder packageBuilder = null;
Properties properties = new Properties();
properties.setProperty( drools.dialect.java.compiler,JANINO );
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration(
properties );
//error was thrown here complaining about JDT Core not being on
classpath
prior to me creating 
//configuration and adding Janino jar file to classpath of the plug-in
packageBuilder = new PackageBuilder(cfg);

.
.
.
packageBuilder.addRuleFlow(source);

I receive the The Eclipse JDT Core jar is not in the classpath error
message.
I was wondering why since I had created a PackageBuilderConfiguration
and
added it to the packagebuilder.
Stepping through the code it appears that the call stack looks like the
following:

packageBuilder.addRuleFlow(source);
ProcessBuilder.addProcessFromFile(.);
PackageBuilderConfiguration.init();

Question is why is the ProcessBuilder not using the
PackageBuilderConfiguration created previously and set on the package
builder and instead creating a new instance? I don't have anywhere to
configure the ProcessBuilder since this is internal to the call on the
packageBuilder.addRuleFlow

Thanks

-- 
View this message in context:
http://www.nabble.com/PackageBuilderConfigurations-and-RuleFlows-Drools-
5-tp20582230p20582230.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Drools 4 performs slower then Drools 3 - Help on .drlfile adaptation

2008-11-19 Thread Joe White
Maxim,

Depending on your use case you may be able to disable shadow facts in your 
Drools 4 instance. See the manual on when it is ok/not-ok to disable shadow 
facts. Based on your description it probably is acceptable for your uses. 
Disabling shadow facts may improve your performance, the manual has details.

 

To disable shadow facts:

  RuleBaseConfiguration conf = new RuleBaseConfiguration();

conf.setShadowProxy(false);

base = RuleBaseFactory.newRuleBase(conf);

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Maxim Veksler
Sent: Wednesday, November 19, 2008 8:36 AM
To: Rules Users List
Subject: [rules-users] Drools 4 performs slower then Drools 3 - Help on 
.drlfile adaptation

 

Hello everyone,


Please allow me to briefly describe how our system works:

We use drools as an efficient matching layers - I have X rules, in the RHS of 
each rule I have a mark for each rule to signal that it has passed in the 
current context (There are by definition more then 1 contexts). After the first 
fireAllRules() has finished, and I have the data structure that allows me to 
query what rules have passed for each context I assert a Marker object, that 
allows Drools to continue filtering only for these contexts that I decide as 
valid to match attempts.

The end result, is that I have 2 fireAllRules called with some java code in 
between them.


In drools3 for 3 contexts I got the following resutls :

== Drools Section (Generic Call) : With default context settings, no HotSpot.
RESULTavg: 33.9023(ms) for 1555 calls

Now in drools4 I'm getting the following:

== Drools Section (Generic Call) : With default context settings, no HotSpot - 
Drools 4
RESULTavg: 37.4356(ms) for 1467 calls



As I increase the context's number I'm getting larger difference in results 
time.
Please note that HotSpot is disabled just for the test, to not JIT interference.

I've disabled all evals in the drl files, to all is left is pure Drools syntax 
and yet It seems that the system works slower.

Please suggest what else I should be doing to optimize the drl files to work 
efficiently with Drools 4 engine.


Thank you,
Maxim.

-- 
Cheers, 
Maxim Veksler

Free as in Freedom - Do u GNU ?

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] (interesting) migration problem from Drools 3.0.6 toDrools 4.0.7

2008-11-17 Thread Joe White
Maxim,

Are the classes you are trying to reference multiple levels of inner classes? 
Drools 4 cannot reference nested inner classes in drl. That issue is fixed in 
the release for drools 5.

 

Joe

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Maxim Veksler
Sent: Monday, November 17, 2008 10:17 AM
To: Rules Users List
Subject: [rules-users] (interesting) migration problem from Drools 3.0.6 
toDrools 4.0.7

 

Hello Everyone,

Here's a fun stuff to debug:


In our application we are using the concept of Dynamic Beans, Drools is 
running in a webapp. The servlet container is tomcat6.

Dynamic beans are beans we compile from java code and then load with a custom 
class loader. This happens in the following method :

The class that implements ServletContextListener has in his 
contextInitialized(...) method a code to do the following: (simplification)

ClassLoader cl = Janino.JavaSourceClassLoader(...)
originalCl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(cl);

The above code allowed drools3 to find the Dynamic Classes (which didn't even 
existed, not to be mention were available to ANY classloader).


Now, inside the .drl files we use properties from these dynamic beans - This 
allows us to be dynamic on the properties we can filter by.

All good, but now comes the new Drools4 code. The application is no longer able 
to find the mentioned classes. 
The only changes the I've done was change Drools version from 3 to 4. 

The errors I'm getting are of the form :

Rule Compilation error : [Rule name=X Status, agendaGroup=MAIN, salience=0, 
no-loop=false]
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:267) : Only a type can 
be imported. com.X.common.dataModel.facts.dynamic.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:334) : Only a type can 
be imported. com.X.common.dataModel.facts.dynamic.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:) : Only a type can 
be imported. com.X.common.dataModel.facts.banner.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1379) : The import 
com.X.common.dataModel.facts.X.X cannot be resolved
...

Anyone has ideas how to over come this?

I'm currently searching for alternatives, I'm thinking about Configuring my 
custom class loader at the webapp level or something like that... 
Help would be appreciated as I'm not getting much success.

-- 
Cheers, 
Maxim Veksler

Free as in Freedom - Do u GNU ?

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] no-loop usage question

2008-11-03 Thread Joe White
You need no-loop on the rules because of the call to modify(s) .
Modify changes the  fact in working memory and the engine is
automatically notified of the changes at the end of the modify block.
After modify the same rule could hit again as the conditions are still
true.

 

The first rule doesn't need the no-loop it because of the check
recommendPurchase == null

 

Joe

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bryan Hansen
Sent: Sunday, November 02, 2008 8:21 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] no-loop usage question

 

I have been reading through the documentation and trying some of the
tutorials and have a question about the no-loop attribute. 

Not really relevant to the post, but I figured I would mention it, I
have been following this post and updating it to use the current version
of Drools.
http://www.onjava.com/pub/a/onjava/2005/08/03/drools.html?page=7 

I have written my rules as such:

package org.drools.examples

import org.drools.examples.StockOffer;

rule PriceBelow100
dialect java 
when
s: StockOffer( stockPrice  100  recommendPurchase == null )
then
modify( s ) {
setRecommendPurchase(StockOffer.YES)
}
end

rule NegativeStockPrice
dialect java 
no-loop true
when
s: StockOffer( stockPrice  0 )
then
modify( s ) {
setRecommendPurchase(StockOffer.NO)
}
end

rule DontBuyXYZStock
dialect java 
no-loop true
when
s: StockOffer(stockName == XYZ  stockPrice  10 )
then
modify( s ) {
setRecommendPurchase(StockOffer.YES)
}
end

rule BuyXYZStock
dialect java 
no-loop true
when
s: StockOffer(stockName == XYZ  stockPrice  10 )
then
modify( s ) {
setRecommendPurchase(StockOffer.NO)
}
end



My question is, why do I have to put no-loop on every rule (except for
the first). After the first time through the rules, it shouldn't be
modifying to where the rules would fire it again. Am I doing something
wrong with how my rules are written? My sample data is this:

package org.drools.examples;

import org.drools.examples.BusinessLayer;
import org.drools.examples.StockOffer;

import junit.framework.TestCase;

/*
 * JUnit test for the business rules in the 
 * application.
 * 
 * This also acts a 'simulator' for the business 
 * rules - allowing us to specify the inputs,
 * examine the outputs and see if they match our 
 * expectations before letting the code loose in  
 * the real world.
 */
public class BusinessRuleTest extends TestCase {
/**
 * Tests the purchase of a stock
 */
public void testStockBuy() throws Exception {

// Create a Stock with simulated values
StockOffer testOffer = new StockOffer();
testOffer.setStockName(MEGACORP);
testOffer.setStockPrice(22);
testOffer.setStockQuantity(1000);

// Run the rules on it
BusinessLayer.evaluateStockPurchase(testOffer);

// Is it what we expected?
assertTrue(testOffer.getRecommendPurchase() != null);

assertTrue(YES.equals(testOffer.getRecommendPurchase()));
}

/**
 * Tests the purchase of a stock makes sure the system will not
accept
 * negative numbers.
 */
public void testNegativeStockBuy() throws Exception {

// Create a Stock with our simulated values
StockOffer testOffer = new StockOffer();
testOffer.setStockName(MEGACORP);
testOffer.setStockPrice(-22);
testOffer.setStockQuantity(1000);

// Run the rules on it
BusinessLayer.evaluateStockPurchase(testOffer);

// Is it what we expected?
assertTrue(NO.equals(testOffer.getRecommendPurchase()));
}

/**
 * Makes sure the system will buy stocks of XYZ corp only if it
really cheap
 */
public void testXYZStockBuy() throws Exception {

// Create a Stock with our simulated values
StockOffer testOfferLow = new StockOffer();
StockOffer testOfferHigh = new StockOffer();

testOfferLow.setStockName(XYZ);
testOfferLow.setStockPrice(9);
testOfferLow.setStockQuantity(1000);

testOfferHigh.setStockName(XYZ);
testOfferHigh.setStockPrice(11);
testOfferHigh.setStockQuantity(1000);

// Run the rules on it and test
BusinessLayer.evaluateStockPurchase(testOfferLow);
assertTrue(YES.equals(testOfferLow.getRecommendPurchase()));

BusinessLayer.evaluateStockPurchase(testOfferHigh);
assertTrue(NO.equals(testOfferHigh.getRecommendPurchase()));
}
}


I can post up all the code if this isn't enough to answer the question.

Thanks!

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] no-loop usage question

2008-11-03 Thread Joe White
Correct. 

 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bryan Hansen
Sent: Monday, November 03, 2008 9:37 AM
To: Rules Users List
Subject: Re: [rules-users] no-loop usage question

 

I think I follow you now. If I was a little smarter with my conditional
statements to NOT keep assigning YES to something that is already set to
YES then it would probably eliminate the loop. In other words if I added
more checks like the ==null that you pointed out, I could (although I am
not sure that they are bad) remove the no-loop settings. Right?

Thanks,

Bryan

On Mon, Nov 3, 2008 at 9:17 AM, Joe White [EMAIL PROTECTED]
wrote:

You need no-loop on the rules because of the call to modify(s) .
Modify changes the  fact in working memory and the engine is
automatically notified of the changes at the end of the modify block.
After modify the same rule could hit again as the conditions are still
true.

 

The first rule doesn't need the no-loop it because of the check
recommendPurchase == null

 

Joe

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bryan Hansen
Sent: Sunday, November 02, 2008 8:21 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] no-loop usage question

 

I have been reading through the documentation and trying some of the
tutorials and have a question about the no-loop attribute. 

Not really relevant to the post, but I figured I would mention it, I
have been following this post and updating it to use the current version
of Drools.
http://www.onjava.com/pub/a/onjava/2005/08/03/drools.html?page=7 

I have written my rules as such:

package org.drools.examples

import org.drools.examples.StockOffer;

rule PriceBelow100
dialect java 
when
s: StockOffer( stockPrice  100  recommendPurchase == null )
then
modify( s ) {
setRecommendPurchase(StockOffer.YES)
}
end

rule NegativeStockPrice
dialect java 
no-loop true
when
s: StockOffer( stockPrice  0 )
then
modify( s ) {
setRecommendPurchase(StockOffer.NO)
}
end

rule DontBuyXYZStock
dialect java 
no-loop true
when
s: StockOffer(stockName == XYZ  stockPrice  10 )
then
modify( s ) {
setRecommendPurchase(StockOffer.YES)
}
end

rule BuyXYZStock
dialect java 
no-loop true
when
s: StockOffer(stockName == XYZ  stockPrice  10 )
then
modify( s ) {
setRecommendPurchase(StockOffer.NO)
}
end



My question is, why do I have to put no-loop on every rule (except for
the first). After the first time through the rules, it shouldn't be
modifying to where the rules would fire it again. Am I doing something
wrong with how my rules are written? My sample data is this:

package org.drools.examples;

import org.drools.examples.BusinessLayer;
import org.drools.examples.StockOffer;

import junit.framework.TestCase;

/*
 * JUnit test for the business rules in the 
 * application.
 * 
 * This also acts a 'simulator' for the business 
 * rules - allowing us to specify the inputs,
 * examine the outputs and see if they match our 
 * expectations before letting the code loose in  
 * the real world.
 */
public class BusinessRuleTest extends TestCase {
/**
 * Tests the purchase of a stock
 */
public void testStockBuy() throws Exception {

// Create a Stock with simulated values
StockOffer testOffer = new StockOffer();
testOffer.setStockName(MEGACORP);
testOffer.setStockPrice(22);
testOffer.setStockQuantity(1000);

// Run the rules on it
BusinessLayer.evaluateStockPurchase(testOffer);

// Is it what we expected?
assertTrue(testOffer.getRecommendPurchase() != null);

assertTrue(YES.equals(testOffer.getRecommendPurchase()));
}

/**
 * Tests the purchase of a stock makes sure the system will not
accept
 * negative numbers.
 */
public void testNegativeStockBuy() throws Exception {

// Create a Stock with our simulated values
StockOffer testOffer = new StockOffer();
testOffer.setStockName(MEGACORP);
testOffer.setStockPrice(-22);
testOffer.setStockQuantity(1000);

// Run the rules on it
BusinessLayer.evaluateStockPurchase(testOffer);

// Is it what we expected?
assertTrue(NO.equals(testOffer.getRecommendPurchase()));
}

/**
 * Makes sure the system will buy stocks of XYZ corp only if it
really cheap
 */
public void testXYZStockBuy() throws Exception {

// Create a Stock with our simulated values
StockOffer testOfferLow = new StockOffer();
StockOffer testOfferHigh = new StockOffer();

testOfferLow.setStockName(XYZ);
testOfferLow.setStockPrice(9);
testOfferLow.setStockQuantity(1000);

testOfferHigh.setStockName(XYZ);
testOfferHigh.setStockPrice(11

RE: [rules-users] controling rule execution

2008-10-31 Thread Joe White
Another way to do it is a combination of salience and retraction. The
parent rule would have a higher salience value and then retract the
facts in its consequence

Joe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Greg Barton
Sent: Thursday, October 30, 2008 11:22 PM
To: Rules Users List
Subject: Re: [rules-users] controling rule execution

A combination of higher priority parent rules with a custom agenda
filter, activated when the parent rule fires, that prevents the child
rule from firing.  

Just a guess.

So, after the child rule is initially prevented from firing, can it be
reactivated?  If so, when and under what conditions?

--- On Thu, 10/30/08, techy [EMAIL PROTECTED] wrote:

 From: techy [EMAIL PROTECTED]
 Subject: [rules-users] controling rule execution
 To: rules-users@lists.jboss.org
 Date: Thursday, October 30, 2008, 11:18 PM
 Hello,
 
 I would like to have the rules parent/child structure. I
 don't want the
 child rules to be executed  when parent's conditions
 are true(i.e
 consequence is  executed) even if child's conditions
 are true. How Can I
 achieve that in drools? 
 Please clarify.
 -- 
 View this message in context:

http://www.nabble.com/controling-rule-execution-tp20260028p20260028.html
 Sent from the drools - user mailing list archive at
 Nabble.com.
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


  
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Deploy rules to JBoss server

2008-10-30 Thread Joe White
I agree with Michael that web apps lib is the best scenario. We
provision ours in an ear directly. I should qualify that though in that
we use a third party project along with Drools and Jboss that leads us
to put other jars in an ear.

I believe the most important thing is to be consistent in terms of
handling all libraries. So I think the best practice is to be consistent
with all jars, and expose them whenever possible.

Joe

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Seaver
Sent: Thursday, October 30, 2008 11:22 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Deploy rules to JBoss server


To clarify, this is more of a general best-practices question. Are
their
any guidelines from experienced enterprise systems techs for deploying
applications in JBoss that rely on third party JARs. 

If we deploy the JARs in our EAR, like Joe suggests, we are assured that
our
app will use the versions of the JARs we've tested against which
improves
reliability for our app.

If we deploy the JARs to the web apps lib, the enterprise has a central
repository for the JARs and can (idealistically) resolve bug fixes in
multiple applications at once by upgrading a central component - such as
drools.

Any additional advice would be greatly appreciated.


-- 
View this message in context:
http://www.nabble.com/Deploy-rules-to-JBoss-server-tp20194303p20251471.h
tml
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Deploy rules to JBoss server

2008-10-28 Thread Joe White
We use JBoss and put them in an EAR and it works fine. Probably  best to
treat the Drools jars the same as the rest of your third party
dependencies.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dan Seaver
Sent: Monday, October 27, 2008 2:57 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Deploy rules to JBoss server


What is the best (recommended) methodology for deploying drools to the
JBoss
application server? I will have some rule authoring capabilities in the
server application, so I'll need most of the jars included in the Drools
library. Should I just stick all of the jars in the server's default/lib
folder? Package them in an EAR? Other?

-- 
View this message in context:
http://www.nabble.com/Deploy-rules-to-JBoss-server-tp20194303p20194303.h
tml
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Display User friendly description for domain object'sproperties in Guvnor BRMS

2008-10-24 Thread Joe White
Devendra,

I would recommend using a DSL for to help with the user friendliness of
fields. We're currently adding the ability to add Date Selectors to DSL
statements so that the business user can use the nice calendar picker to
select dates.  There may be a way to do what you mention below with the
non-dsl version but I'm not sure what it is.

 

Joe

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Devendra
Sharma
Sent: Thursday, October 23, 2008 6:15 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Display User friendly description for domain
object'sproperties in Guvnor BRMS

 

Hi,

 

Is it possible to display in Guvnor BRMS, user friendly description
defined for a property in domain object? 

for e.g. In domain object a field called 'dob' but on the screen when
user wants to define 

a rule for this field and selects 'dob' he should see 'Date of Birth' in
a hovering text as html ALT.

 

Thanks,

 

Devendra Sharma

 

 


This email and/or any files or attachments transmitted with it are
confidential and intended solely for the use of the individual or entity
to whom they are addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable
law. If you are not the intended recipient, or the employee or agent
responsible for delivering the message to the intended recipient, you
are hereby notified that any dissemination, distribution or copying of
this e-mail and/or any files or attachments transmitted with it is
strictly forbidden. If you have received this email in error, please
delete the e-mail and/or any files or attachments, and also notify the
system manager ([EMAIL PROTECTED]) of the error. Please
note that any views or opinions presented in this email are solely those
of the author and do not necessarily represent those of the company.
Finally, the recipient should check this email and any attachments for
the presence of viruses. The company accepts no liability for any damage
caused by any virus transmitted by this email and/or any files or
attachments transmitted with it. 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Mvel autoboxing math

2008-08-14 Thread Joe White
The drl test case below illustrates a problem with math inside of drools
when using the mvel dialect. When using autoboxing the order of
operations (and parens)  are not respected. This is using drools 5.0M1
and mvel-2.0-dp4.jar. The correct answer is 80 and the answer provided
with autoboxing in the mvel dialect is 100.

 

I'm uncertain of how to create a viable test case in pure mvel to add it
to their jira. Any help is appreciated,

 

Thanks,

 

Joe

 

 

package test;

 

dialect mvel

 

rule TestRule

  when

  then



double value=(2*new Double(50))-10-10;

System.out.println(value);



double valueTwo=(2*50)-10-10;

System.out.println(valueTwo);

End

 

RESULTS

Wrong = 100.0

Right = 80.0

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Max packages

2008-08-13 Thread Joe White
Mark, thank you very much for your help, it is greatly appreciated.

 

There are improvements we can make to generated code into a single
class and use a switch statement to invoke the correct part, but we
don't have time for that right now, so would need to come from the
community.

 

I would be interested in doing this work if someone can point me in the
right direction on where to start. I also would be interested in doing
the work to allow drools to reference multiple levels of inner classes.
Our work would benefit from both pieces of functionality. I'll move this
to the developer list, but would appreciate if somebody knowledgeable
could show me where to get started on the code necessary to generate to
a single class.

 

Thanks,

Joe



 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Wednesday, August 13, 2008 2:53 AM
To: Rules Users List
Subject: Re: [rules-users] Max packages

 

Joe White wrote: 

Can someone help me understand the relationship between the number of
Packages in a single RuleBase and PermGen memory consumption? I have a
test that generates  200 rules and then adds those rules as different
packages to a single rule base. PermGen consumption grows near linearly
with the addition of Packages to the rule base and on a default PermGen
setting the JVM runs out of PermGen after about 120 packages.

It's not related to Packages, it's related to the number of rules and
whether those rules have compiled java parts  - like the consequence,
eval etc - each one adds an additional class.



 

Is every new Package and RuleBase backed by a set of generated Classes?
Is there a way to get around the amount of class generation that is
taking place?

The test has been run against Drools 5.

You can use MVEL, which has no class generation. There are improvements
we can make to generated code into a single class and use a switch
statement to invoke the correct part, but we don't have time for that
right now, so would need to come from the community.



 

Thank you for your help,

Joe

 






 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
  

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Max packages

2008-08-12 Thread Joe White
Can someone help me understand the relationship between the number of
Packages in a single RuleBase and PermGen memory consumption? I have a
test that generates  200 rules and then adds those rules as different
packages to a single rule base. PermGen consumption grows near linearly
with the addition of Packages to the rule base and on a default PermGen
setting the JVM runs out of PermGen after about 120 packages.

 

Is every new Package and RuleBase backed by a set of generated Classes?
Is there a way to get around the amount of class generation that is
taking place?

The test has been run against Drools 5.

 

Thank you for your help,

Joe

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Perm gen addPackageFromDrl

2008-08-08 Thread Joe White
HI all,

We've got an application that has the need to deploy dynamically
generated drl periodically. The drl is regenerated from a set of
database tables whenever a change is made to the tables. After running
through the generation and package building we eventually get an out of
memory error for permGen. The error is hit with 128 and 256mb of perm
gen.

 

The method that seems to cause the error is addPackageFromDRL on the
PackageBuilder. I've attached a method that represents what we are doing
with the drl and the package building in the 4.0.4 form. I get the error
in both 4.0.4 and in the 5.0 versions of drools. In the 4.0.4 version
shadow facts are disabled on the rule base. 

 

Is regenerating rules frequently from a drl format a valid use case? 

 

Any help in improving the perm gen consumption or fixing our use of
drools is greatly appreciated.

 

Thanks,

Joe

 

 



PermGenFail.java
Description: PermGenFail.java
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Date arithmeti c in “when” session

2008-05-07 Thread Joe White
I'm not enough of an expert to say why, but if you change your condition to put 
the variable on the left of the comparison and the numeric operation on the 
right then it will work. For example:

flight : Flight( $reqTime(departure.time - 2 * 
360),$reqTime(departure.time + 4 * 36))

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sridhar123
Sent: Wednesday, May 07, 2008 7:51 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Date arithmetic in “when” session


I tried this approach, but I get compilation errors for tokens '-' and '+'  I
get similar errors for any arithmetic symbols (*, + or -) 

What is the right way to add or subtract or multiply with in when session?


Errors:

unknown:26:27 Unexpected token '-'  DroolsEval/src/main/rules
TravelPolicy.drlline 26 1210167094487   1018
unknown:28:27 Unexpected token '+'  DroolsEval/src/main/rules
TravelPolicy.drlline 28 1210167094487   1019




Christine-27 wrote:
 
 Hi,
 you shouldn't put part of the if or when part after the then. Put
 all conditions after the when so the rule engine will evaluate them.
 
 I guess you mean to write something like (although I haven't tested this):
 
 rule ITR Discard
when
   req : LowFareRequest(
  $reqTime : requestedDeparture.time)
   itr : AirItinerary( discarded == false )
   flight : Flight(
 departure.time - 2 * 360 
$reqTime,
 departure.time + 4 * 360 
$reqTime)
then
  System.out.println(discard true);
end
 
 
 Christine
 
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 

-- 
View this message in context: 
http://www.nabble.com/Re%3A-Date-arithmetic-in--%C3%A2%C2%80%C2%9Cwhen%C3%A2%C2%80%C2%9D-session-tp17103754p17105416.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Janino Autoboxing inside drools

2008-04-10 Thread Joe White
According to the Janino Jira in
http://jira.codehaus.org/browse/JANINO-72 autoboxing was supported in
version 2.5.6. It looks like drools 4.0.4 uses Janino 2.5.10. The test
below uses a DRL file that would require autoboxing and it produces a
runtime exception from Janino. Does anybody know of a way to make a
Janino/Drools Autoboxing combination work? I have to use autoboxing and
I would very much prefer to use Janino over MVEL for drl compilation.

 

 

Thanks for your help,

 

Joe

 

The information below includes the stack trace, the Input java file, the
DRL, and a snippet for the drools setup and execution. The exception is
easy to produce and the info below should be enough to reproduce it.

 

 

/INPUT JAVA OBJECT ***/

package com.sample;

 

public class Input {

  public Double valOne;

  public Double valTwo;

  

  public Double getValOne() {

return valOne;

  }

  public void setValOne(Double valOne) {

this.valOne = valOne;

  }

  public Double getValTwo() {

return valTwo;

  }

  public void setValTwo(Double valTwo) {

this.valTwo = valTwo;

  }

}

 

/END ***/

 

 

 

/DRL ***/

package test;

import com.sample.Input

dialect java 

rule test 293

when

inputVal : Input()

then

//double valOne = 0;

double deductibleapplied =inputVal.valOne*inputVal.valTwo;

end

/END ***/

 

 

/DROOLS SETUP ***/

...

PackageBuilderConfiguration pkgBuilderCfg = new
PackageBuilderConfiguration();

JavaDialectConfiguration javaConf = (JavaDialectConfiguration)
pkgBuilderCfg.getDialectConfiguration( java );

javaConf.setCompiler( JavaDialectConfiguration.JANINO );

PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);

 

...

 

Input input = new Input();

input.setValOne(10.0);

input.setValTwo(1000.0);

workingMemory.insert( input );

workingMemory.fireAllRules();   

/END ***/

 

/ STACK TRACE ***/

java.lang.RuntimeException: SNO: Conversion failed

  at
org.codehaus.janino.UnitCompiler.binaryNumericPromotion(UnitCompiler.jav
a)

  at
org.codehaus.janino.UnitCompiler.compileArithmeticOperation(UnitCompiler
.java)

  at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$39(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$7.visitBinaryOperation(UnitCompiler.jav
a)

  at org.codehaus.janino.Java$BinaryOperation.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$12(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$2.visitLocalVariableDeclarationStatemen
t(UnitCompiler.java)

  at
org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.j
ava)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$3(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$2.visitBlock(UnitCompiler.java)

  at org.codehaus.janino.Java$Block.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$1.visitPackageMemberClassDeclaration(Un
itCompiler.java)

  at
org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java)

  at org.codehaus.janino.Compiler.compile(Compiler.java)

  at
org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCo
mpiler.java:174)

  at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJa
vaCompiler.java:51)

  at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.
java:332)

  at
org.drools.compiler.DialectRegistry.compileAll(DialectRegistry.java:60)

  at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:308)

  at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java
:167)

  at com.sample.SimpleTester.readRule(SimpleTester.java:62)

  at 

RE: [rules-users] Janino Autoboxing inside drools

2008-04-10 Thread Joe White
A word of caution on this topic. It looks like drools 4.0.4 works great
with janino2.5.10 which drools comes packaged with, but does not work
with janino2.5.13 (the latest release).

 

Joe

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joe White
Sent: Thursday, April 10, 2008 5:28 PM
To: Rules Users List
Subject: RE: [rules-users] Janino Autoboxing inside drools

 

Thanks for the quick reply. In my attempts to reproduce the issue
outside of Drools I have found that the issue was caused by an antique
version of Janino hiding in a library in an imported eclipse project.
After upgrading to the newer version of Janino things appear to be
working.

 

Thanks for your help,

Joe

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Thursday, April 10, 2008 12:46 PM
To: Rules Users List
Subject: Re: [rules-users] Janino Autoboxing inside drools

 

Janno has no configurations as such, so it should work. If it doesn't
work I'm guessing it's a bug with Janino. You could probably recreate
the issue outside of Drools and submit a bug to the Janino author.

Mark
Joe White wrote: 

According to the Janino Jira in
http://jira.codehaus.org/browse/JANINO-72 autoboxing was supported in
version 2.5.6. It looks like drools 4.0.4 uses Janino 2.5.10. The test
below uses a DRL file that would require autoboxing and it produces a
runtime exception from Janino. Does anybody know of a way to make a
Janino/Drools Autoboxing combination work? I have to use autoboxing and
I would very much prefer to use Janino over MVEL for drl compilation.

 

 

Thanks for your help,

 

Joe

 

The information below includes the stack trace, the Input java file, the
DRL, and a snippet for the drools setup and execution. The exception is
easy to produce and the info below should be enough to reproduce it.

 

 

/INPUT JAVA OBJECT ***/

package com.sample;

 

public class Input {

  public Double valOne;

  public Double valTwo;

  

  public Double getValOne() {

return valOne;

  }

  public void setValOne(Double valOne) {

this.valOne = valOne;

  }

  public Double getValTwo() {

return valTwo;

  }

  public void setValTwo(Double valTwo) {

this.valTwo = valTwo;

  }

}

 

/END ***/

 

 

 

/DRL ***/

package test;

import com.sample.Input

dialect java 

rule test 293

when

inputVal : Input()

then

//double valOne = 0;

double deductibleapplied =inputVal.valOne*inputVal.valTwo;

end

/END ***/

 

 

/DROOLS SETUP ***/

...

PackageBuilderConfiguration pkgBuilderCfg = new
PackageBuilderConfiguration();

JavaDialectConfiguration javaConf = (JavaDialectConfiguration)
pkgBuilderCfg.getDialectConfiguration( java );

javaConf.setCompiler( JavaDialectConfiguration.JANINO );

PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);

 

...

 

Input input = new Input();

input.setValOne(10.0);

input.setValTwo(1000.0);

workingMemory.insert( input );

workingMemory.fireAllRules();   

/END ***/

 

/ STACK TRACE ***/

java.lang.RuntimeException: SNO: Conversion failed

  at
org.codehaus.janino.UnitCompiler.binaryNumericPromotion(UnitCompiler.jav
a)

  at
org.codehaus.janino.UnitCompiler.compileArithmeticOperation(UnitCompiler
.java)

  at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$39(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$7.visitBinaryOperation(UnitCompiler.jav
a)

  at org.codehaus.janino.Java$BinaryOperation.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$12(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$2.visitLocalVariableDeclarationStatemen
t(UnitCompiler.java)

  at
org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.j
ava)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$3(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$2.visitBlock(UnitCompiler.java)

  at org.codehaus.janino.Java$Block.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java

[rules-users] Order of operations

2008-04-09 Thread Joe White
I have a question regarding order of operations in the consequence of a
rule when using the mvel dialect. When executed the Drl below provides
Right =30.0 and Wrong =140.0. The only difference is the parens around
the multiplying expressions, which shouldn't be necessary given order of
operations. Is this a problem with the drools/mvel interaction or is it
completely an issue with mvel? 

 

Is the general expectation that all expressions must be completely
scoped by parens when using mvel? 

 

package test;

dialect mvel

rule test 11

when

 

then

double rightVal=((10-5)*2) + (5*(8-4));

double wrongVal=(10-5)*2 + 5*(8-4);

 

System.out.println(Right =+rightVal);

System.out.println(Wrong =+wrongVal);

End

 

After execution:

Right =30.0 

Wrong =140.0

 

 

Thank you for all of your help. We are using drools 4.0.4.

 

Joe

 

Also, I haven't figured out how it arrives at 140. The following format
also produces 140, which seems a little more strange.

double wrongVal=10-5*2 + 5*8-4;

 

 

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Order of operations

2008-04-09 Thread Joe White
Another bug that  I just came across while working on getting my parens
to work involved not handling scoped numbers properly. Similar to the
previous one, but different in that it ends the expression evaluation
prematurely. See the drl and result below:

 

package test;

dialect mvel

rule test 12

when

 

then

double rightVal=(10 + 12);

double wrongVal=(10) + (12);

double wrongValTwo = ((10)+12)

System.out.println(Right +rightVal);

System.out.println(Wrong +wrongVal);

   System.out.println(WrongTwo +wrongValTwo);

End

 

Results in:

Right 22.0

Wrong 10.0

WrongTwo 10.0

 

Thanks,

Joe

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Wednesday, April 09, 2008 12:39 PM
To: Rules Users List
Subject: Re: [rules-users] Order of operations

 


   Hi Joe,

   It seems someone skipped the elementary math lessons at school... :(

   Will open a JIRA for that.

   []s
   Edson

2008/4/9 Joe White [EMAIL PROTECTED]:

I have a question regarding order of operations in the consequence of a
rule when using the mvel dialect. When executed the Drl below provides
Right =30.0 and Wrong =140.0. The only difference is the parens around
the multiplying expressions, which shouldn't be necessary given order of
operations. Is this a problem with the drools/mvel interaction or is it
completely an issue with mvel? 

 

Is the general expectation that all expressions must be completely
scoped by parens when using mvel? 

 

package test;

dialect mvel

rule test 11

when

 

then

double rightVal=((10-5)*2) + (5*(8-4));

double wrongVal=(10-5)*2 + 5*(8-4);

 

System.out.println(Right =+rightVal);

System.out.println(Wrong =+wrongVal);

End

 

After execution:

Right =30.0 

Wrong =140.0

 

 

Thank you for all of your help. We are using drools 4.0.4.

 

Joe

 

Also, I haven't figured out how it arrives at 140. The following format
also produces 140, which seems a little more strange.

double wrongVal=10-5*2 + 5*8-4;

 

 

 


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] DRL Compilation exception

2008-03-26 Thread Joe White
We have a rule package with a target platform of a JBoss server. Based
on the recommendation at
http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesTomcat we changed the
package config to use the JavaDialectConfiguration.JANINO compiler.
However, when trying to load the package with the janino compiler we get
the stack trace included below. The rules load correctly if the compiler
change is not set (but they won't load in JBoss if we don't make the
compiler change). 

 

Is there an alternative workaround for the JDT issue that would allow us
to use something other than the janino compiler to load the rules inside
of JBoss? Or is there a known cause or workaround for the exception
below?

 

We are using Drools 4.0.4 and JBoss 4.0.5

 

Thanks for your help

Joe

 

 

java.lang.RuntimeException: SNO: Conversion failed

  at
org.codehaus.janino.UnitCompiler.binaryNumericPromotion(UnitCompiler.jav
a)

  at
org.codehaus.janino.UnitCompiler.compileArithmeticOperation(UnitCompiler
.java)

  at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$39(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$7.visitBinaryOperation(UnitCompiler.jav
a)

  at org.codehaus.janino.Java$BinaryOperation.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$12(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$2.visitLocalVariableDeclarationStatemen
t(UnitCompiler.java)

  at
org.codehaus.janino.Java$LocalVariableDeclarationStatement.accept(Java.j
ava)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.access$3(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$2.visitBlock(UnitCompiler.java)

  at org.codehaus.janino.Java$Block.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)

  at
org.codehaus.janino.UnitCompiler$1.visitPackageMemberClassDeclaration(Un
itCompiler.java)

  at
org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java)

  at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)

  at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java)

  at org.codehaus.janino.Compiler.compile(Compiler.java)

  at
org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCo
mpiler.java:174)

  at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJa
vaCompiler.java:51)

  at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.
java:332)

  at
org.drools.compiler.DialectRegistry.compileAll(DialectRegistry.java:60)

  at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:308)

  at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java
:167)

  at com.sample.DroolsTest.readRule(DroolsTest.java:63)

  at com.sample.DroolsTest.main(DroolsTest.java:24)

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users