Re: [rules-users] How to monitor drools execution time?

2011-11-13 Thread Benson Fung
You can use the Drools guvnor to measure the execution time of each rule.
This is the feature of that.



On Mon, Nov 14, 2011 at 11:00 AM, Zhao Yi zhaoyi0...@gmail.com wrote:

 I want to check how long each rule executed. Can I add any listener on
 drools
 run time to get the rule time?

 Thanks,
 Zhao Yi

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/How-to-monitor-drools-execution-time-tp3505792p3505792.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] BRMS on WebLogic

2011-07-12 Thread Benson Fung
Hi,

Is there installation documentation how BRMS/Drools Guvnor is
installed on WebLogic server?  Please help.


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


Re: [rules-users] Error opening dslr in Eclipse on Mac

2011-04-29 Thread Benson Fung
What version of jdk and Drools plugin are you using?

2011/4/29 Steven Williams stevearoo...@gmail.com:
 Hi,
 I am running Eclipse Helios on Mac OS X 10.6.7 with the Drools 5.1.1 plugin
 and cannot open DSLR files with the error below. This error also occurs if I
 create a new Drools project, create a new rule resource and select the Use a
 DSL checkbox. DRL files open fine.
 Could not open the editor: 1
 java.lang.ArrayIndexOutOfBoundsException: 1
 at
 org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea(StyledTextRenderer.java:230)
 at org.eclipse.swt.custom.StyledText.handleResize(StyledText.java:6169)
 at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5662)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3783)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1398)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1379)
 at org.eclipse.swt.widgets.Control.resized(Control.java:2944)
 at org.eclipse.swt.widgets.Composite.resized(Composite.java:929)
 at org.eclipse.swt.widgets.Control.setFrameSize(Control.java:3428)
 at org.eclipse.swt.widgets.Display.windowProc(Display.java:4975)
 at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
 at org.eclipse.swt.internal.cocoa.NSView.setFrameSize(NSView.java:259)
 at org.eclipse.swt.widgets.Control.setBounds(Control.java:3171)
 at org.eclipse.swt.widgets.Control.setSize(Control.java:3668)
 at
 org.eclipse.jface.text.source.SourceViewer$RulerLayout.getVerticalScrollArrowHeights(SourceViewer.java:200)
 at
 org.eclipse.jface.text.source.SourceViewer$RulerLayout.layout(SourceViewer.java:157)
 at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1183)
 at org.eclipse.swt.widgets.Composite.layout(Composite.java:703)
 at org.eclipse.swt.widgets.Composite.layout(Composite.java:661)
 at
 org.eclipse.jface.text.source.CompositeRuler.layoutTextViewer(CompositeRuler.java:611)
 at
 org.eclipse.jface.text.source.CompositeRuler.addDecorator(CompositeRuler.java:565)
 at
 org.eclipse.jface.text.source.projection.ProjectionViewer.addVerticalRulerColumn(ProjectionViewer.java:1289)
 at
 org.eclipse.jface.text.source.projection.ProjectionSupport.doEnableProjection(ProjectionSupport.java:310)
 at
 org.eclipse.jface.text.source.projection.ProjectionSupport$ProjectionListener.projectionEnabled(ProjectionSupport.java:143)
 at
 org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:489)
 at
 org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:537)
 at
 org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1441)
 at org.drools.eclipse.editors.AbstractRuleEditor.createPartControl(Unknown
 Source)
 at
 org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:241)
 at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:325)
 at
 org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:211)
 at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:308)
 at org.drools.eclipse.dsl.editor.DSLRuleEditor2.addPages(Unknown Source)
 at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
 at
 org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
 at
 org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
 at
 org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
 at
 org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
 at
 org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
 at
 org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863)
 at
 org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768)
 at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760)
 at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711)
 at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
 at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707)
 at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691)
 at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2682)
 at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
 at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
 at org.drools.eclipse.wizard.rule.NewRulePackagePage.finish(Unknown Source)
 at org.drools.eclipse.wizard.rule.NewRulePackageWizard.performFinish(Unknown
 Source)
 at
 org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
 at
 org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
 at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
 at 

Re: [rules-users] Memory issue with drools (using 10000 rules)

2011-04-26 Thread Benson Fung
is it necessary to execute 1 rules in one time for your case?

Why don't execute rule selectively?



2011/4/26 Mark Proctor mproc...@codehaus.org

  There is no out of the box way to improve that, beyond just partitioning
 your rulebases yourself.

 If you would like to get involved in RD we can do lazy network building
 and try pushing unused parts of the rule network to disk.

 Mark

 On 26/04/2011 12:05, Shebs, Liron wrote:

  Hello All,



 I’m working at HP Software RD and we are considering using drools in our
 product.

 Benchmarking tests showed that running 10,000 rules consumes 382mb.

 This is too high for our system requirements, and we would like to know how
 we can improve it.

 Technical details:

 -  Drools version: 5.1 with default configuration.

 -  All rules look like this:



 rule status-Fixed-Open

when

  event : FieldChangedEvent(fieldName ==
 status, oldValue == Fixed);

  entity : Entity(entityType == mock-entity);

  eval(((String)
 entity.getFieldValue(status)).equals(Open));

then

   do Something…

 end



 -  Loading code:



 KnowledgeBuilder knowledgeBuilder =
 KnowledgeBuilderFactory.newKnowledgeBuilder();

 for(all resources)

 {

 knowledgeBuilder.add(resource, ResourceType.DRL);

 }

 knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();


 knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());



 Any insights are most appreciated.



 Thank You,

 Liron, HP Software RD








 ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://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] execute particular rules programmatically and dynamically

2011-04-14 Thread Benson Fung
Thanks Michael, let me think about your solution seriously afterwards.
  Actually, I am using GWT.
I would like to say that sometimes customer's requirement is picky and
unexpectable.  They really want to have close coupling between UI and
Rules.  haha.  :)Do you think it is helpless as a
consultant???   :~(

If anyone has another idea of this scenario, you are welcome to post
your idea out there.


Thank you very much



2011/4/14 Michael Anstis michael.ans...@gmail.com:
 In my example Rule 1 was shared between screen1.panel1.editbox1 and
 screen1.panel1.editbox2:-

 rule Rule1
   salience 1
   dialect mvel
     when
   ApplicationContext( context in (screen1.panel1.editbox1,
 screen1.panel1.editbox2) )
       ad : ApplicationData( age ==  || (  == null ))
     then
       ad.setReturnMsg( \n age should not be null or empty );
 end

 This is an approach and may not be the best available; I was trying to
 demonstrate how your problem can be solved without having to worry about
 explicitly executing individual rules.For example, depending on what UI
 technology you are using (Swing, JSF) you could subclass the UI components
 and use these as facts - but such close coupling between UI and Rules may be
 undesirable.

 With kind regards,

 Mike

 On 14 April 2011 03:52, Benson Fung benson.red...@gmail.com wrote:

 Good, Michael.

 'context' is used to distinguish which part of the UI which will be
 validated, right?  The customer will ask if they have 1 rules in
 the rulebase.  And some of them are redundant, so they want to make
 some of the rules share with several part of UI, e.g.  editbox 6,
 editbox 7 and editbox 8 these 3 boxes' value range is within 0 and
 600.  Therefore, Rule3 can be shared for these 3 editbox validation,
 right?  However, for the context variable approach, it seems Rule3
 cannot be shared for another editbox with same value range validation.
  So these could be a key for the BRMS/Drools.


 Benson

 2011/4/14 Michael Anstis michael.ans...@gmail.com:
  Sure, whenever you copy values from your UI to your model for validation
  you
  also enter a fact representing the context of the values.
 
  Using your example you have two edit boxes on one screen and your rule
  simply checks for the value of a single edit box; in this case the
  context
  differentiates the two.
 
  Walking your example:
 
  (1) When editbox 1 looses focus you copy the value from the dropdown and
  edit box 1 into your model, plus you enter a context fact stating that
  these values relate to that part of the UI (say
  screen1.panel1.editbox1).
  You then insert these facts into WM and call fireAllRules. The rules
  check
  the context and only execute if the values are for the (rule)
  applicable
  context. (2) Editbox 2 works in a similar way, but has a different
  context
  ((say screen1.panel1.editbox2).
 
  Have a look at Plugtree - I believe they're quite well customed to
  writing
  UIs backed with rules; salaboy or esteban (or IRC #drools) might be able
  to
  offer more practical advice.
 
  With kind regards,
 
  Mike
 
 
 
  On 13 April 2011 17:48, Benson Fung benson.red...@gmail.com wrote:
 
  Hi Michael,
 
  Can you elaborate more for the uses of the ApplicationContext?  I
  can't follow its uses.
 
 
  Thanks
  Benson
 
  2011/4/14 Michael Anstis michael.ans...@gmail.com:
   Here's a quick (and probably sub-optimal way) ;)
  
   When you copy values from the UI to Facts for validation you also
   include
   the context of the validation.
  
   I've also removed the inline evals you were using.
  
   rule Rule1
     salience 1
     dialect mvel
       when
     ApplicationContext( context == * )
         ad : ApplicationData( age ==  || (  == null ))
       then
         ad.setReturnMsg( \n age should not be null or empty );
   end
  
   rule Rule2
     dialect mvel
       when
         ApplicationContext( context == screen1.panel1.ed )
         ad : ApplicationData( $age : age != null , age !=  , age  0
   ||
   
   100, minIssrdAge == Years )
       then
         ad.setReturnMsg( \nage is out of the range(i.e.   0 and 
   100)
   );
   end
  
   rule Rule3
      dialect mvel
        when
          ad : ApplicationData( $age : age != null , age !=  , age 0
   ||
   
   600, minIssrdAge == Years )
        then
          ad.setReturnMsg( \nage is out of the range(i.e.   0 and 
   600)
   );
   end
  
   On 13 April 2011 17:19, Benson Fung benson.red...@gmail.com wrote:
  
   Hi,
  
   Here is the scenario :
  
   If there are 2 edit boxes and 2 dropdown list at the frontend like.
  
  
   dropdown(minIssrdAge1)   editbox(age1)
   dropdown(minIssrdAge2)   editbox(age2)
  
   everytime when I lost focus the editbox(age1 or age2),  the
   editbox(age1 or age2) value will be validated against the following
   rules.
   i.e.  minIssrdAge1 and age1 will be validated together if lost focus
   the editbox age1.
         minIssrdAge2 and age2 will be validated together if lost focus

Re: [rules-users] execute particular rules programmatically and dynamically

2011-04-14 Thread Benson Fung
Hi Bob,

Thanks for your input and looks like close to the point.
AgendaFilter interface could be the key point of the solution plus the
rule attribute(I guess).  Can you try to elaborate more with simple
example how you can implement it?


Thanks

On Thu, Apr 14, 2011 at 5:38 PM, Robert Christenson r...@akc.org wrote:
 We've come across something similar in our project just recently as well.

 We have a requirement to have some rules activate based on a tab-off action 
 but also at a higher level (such as validating an entire event entry in the 
 GUI). I also need these rules to activate if initiated from an external 
 webservice (no GUI at all).

 What we've decided to utilize is a meta identifier in certain rules called 
 FieldsAffected which may contain a delimited list of field identifiers.

 An AgendaFilter implementation is created for GUI side requests and passed to 
 fireAllRules. The filter implementation compares any/all field identifiers 
 passed within the request and keeps only those activations which contain the 
 field identifier in it's metadata field.

 Our RHS creates a validation msg which contains the field identifiers so that 
 the calling GUI can display the proper msgs to the field.

 This allows us to support multiple call scenarios without duplicating the 
 logic in multiple rules just based on context info.

 Hope this helps,

 Bob Christenson


 --

 Message: 2
 Date: Thu, 14 Apr 2011 15:23:44 +0800
 From: Benson Fung benson.red...@gmail.com
 Subject: Re: [rules-users] execute particular rules programmatically
    and    dynamically
 To: Rules Users List rules-users@lists.jboss.org
 Message-ID: BANLkTi=OGO=rwfenybhm144gvst+p_k...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1

 Thanks Michael, let me think about your solution seriously afterwards.
  Actually, I am using GWT.
 I would like to say that sometimes customer's requirement is picky and
 unexpectable.  They really want to have close coupling between UI and
 Rules.  haha.  :)    Do you think it is helpless as a
 consultant???   :~(

 If anyone has another idea of this scenario, you are welcome to post
 your idea out there.


 Thank you very much



 2011/4/14 Michael Anstis michael.ans...@gmail.com:
 In my example Rule 1 was shared between screen1.panel1.editbox1 and
 screen1.panel1.editbox2:-

 rule Rule1
 ? salience 1
 ? dialect mvel
 ??? when
 ? ApplicationContext( context in (screen1.panel1.editbox1,
 screen1.panel1.editbox2) )
 ? ? ? ad : ApplicationData( age ==  || ( ?== null ))
 ? ? then
 ? ??? ad.setReturnMsg( \n age should not be null or empty );
 end

 This is an approach and may not be the best available; I was trying to
 demonstrate how your problem can be solved without having to worry about
 explicitly executing individual rules.For example, depending on what UI
 technology you are using (Swing, JSF) you could subclass the UI components
 and use these as facts - but such close coupling between UI and Rules may be
 undesirable.

 With kind regards,

 Mike

 On 14 April 2011 03:52, Benson Fung benson.red...@gmail.com wrote:

 Good, Michael.

 'context' is used to distinguish which part of the UI which will be
 validated, right? ?The customer will ask if they have 1 rules in
 the rulebase. ?And some of them are redundant, so they want to make
 some of the rules share with several part of UI, e.g. ?editbox 6,
 editbox 7 and editbox 8 these 3 boxes' value range is within 0 and
 600. ?Therefore, Rule3 can be shared for these 3 editbox validation,
 right? ?However, for the context variable approach, it seems Rule3
 cannot be shared for another editbox with same value range validation.
 ?So these could be a key for the BRMS/Drools.


 Benson

 2011/4/14 Michael Anstis michael.ans...@gmail.com:
 Sure, whenever you copy values from your UI to your model for validation
 you
 also enter a fact representing the context of the values.

 Using your example you have two edit boxes on one screen and your rule
 simply checks for the value of a single edit box; in this case the
 context
 differentiates the two.

 Walking your example:

 (1) When editbox 1 looses focus you copy the value from the dropdown and
 edit box 1 into your model, plus you enter a context fact stating that
 these values relate to that part of the UI (say
 screen1.panel1.editbox1).
 You then insert these facts into WM and call fireAllRules. The rules
 check
 the context and only execute if the values are for the (rule)
 applicable
 context. (2) Editbox 2 works in a similar way, but has a different
 context
 ((say screen1.panel1.editbox2).

 Have a look at Plugtree - I believe they're quite well customed to
 writing
 UIs backed with rules; salaboy or esteban (or IRC #drools) might be able
 to
 offer more practical advice.

 With kind regards,

 Mike



 On 13 April 2011 17:48, Benson Fung benson.red...@gmail.com wrote:

 Hi Michael,

 Can you elaborate more for the uses of the ApplicationContext? ?I

Re: [rules-users] execute particular rules programmatically and dynamically

2011-04-14 Thread Benson Fung
Hi Bob,

I don't understand about your statement :

'An AgendaFilter implementation is created for GUI side requests and
passed to fireAllRules. The filter implementation compares any/all
field identifiers passed within the request and keeps only those
activations which contain the field identifier in it's metadata
field.'

Can you show me how you implement AgendaFilter?

Benson

On Thu, Apr 14, 2011 at 5:38 PM, Robert Christenson r...@akc.org wrote:
 We've come across something similar in our project just recently as well.

 We have a requirement to have some rules activate based on a tab-off action 
 but also at a higher level (such as validating an entire event entry in the 
 GUI). I also need these rules to activate if initiated from an external 
 webservice (no GUI at all).

 What we've decided to utilize is a meta identifier in certain rules called 
 FieldsAffected which may contain a delimited list of field identifiers.

 An AgendaFilter implementation is created for GUI side requests and passed to 
 fireAllRules. The filter implementation compares any/all field identifiers 
 passed within the request and keeps only those activations which contain the 
 field identifier in it's metadata field.

 Our RHS creates a validation msg which contains the field identifiers so that 
 the calling GUI can display the proper msgs to the field.

 This allows us to support multiple call scenarios without duplicating the 
 logic in multiple rules just based on context info.

 Hope this helps,

 Bob Christenson


 --

 Message: 2
 Date: Thu, 14 Apr 2011 15:23:44 +0800
 From: Benson Fung benson.red...@gmail.com
 Subject: Re: [rules-users] execute particular rules programmatically
    and    dynamically
 To: Rules Users List rules-users@lists.jboss.org
 Message-ID: BANLkTi=OGO=rwfenybhm144gvst+p_k...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1

 Thanks Michael, let me think about your solution seriously afterwards.
  Actually, I am using GWT.
 I would like to say that sometimes customer's requirement is picky and
 unexpectable.  They really want to have close coupling between UI and
 Rules.  haha.  :)    Do you think it is helpless as a
 consultant???   :~(

 If anyone has another idea of this scenario, you are welcome to post
 your idea out there.


 Thank you very much



 2011/4/14 Michael Anstis michael.ans...@gmail.com:
 In my example Rule 1 was shared between screen1.panel1.editbox1 and
 screen1.panel1.editbox2:-

 rule Rule1
 ? salience 1
 ? dialect mvel
 ??? when
 ? ApplicationContext( context in (screen1.panel1.editbox1,
 screen1.panel1.editbox2) )
 ? ? ? ad : ApplicationData( age ==  || ( ?== null ))
 ? ? then
 ? ??? ad.setReturnMsg( \n age should not be null or empty );
 end

 This is an approach and may not be the best available; I was trying to
 demonstrate how your problem can be solved without having to worry about
 explicitly executing individual rules.For example, depending on what UI
 technology you are using (Swing, JSF) you could subclass the UI components
 and use these as facts - but such close coupling between UI and Rules may be
 undesirable.

 With kind regards,

 Mike

 On 14 April 2011 03:52, Benson Fung benson.red...@gmail.com wrote:

 Good, Michael.

 'context' is used to distinguish which part of the UI which will be
 validated, right? ?The customer will ask if they have 1 rules in
 the rulebase. ?And some of them are redundant, so they want to make
 some of the rules share with several part of UI, e.g. ?editbox 6,
 editbox 7 and editbox 8 these 3 boxes' value range is within 0 and
 600. ?Therefore, Rule3 can be shared for these 3 editbox validation,
 right? ?However, for the context variable approach, it seems Rule3
 cannot be shared for another editbox with same value range validation.
 ?So these could be a key for the BRMS/Drools.


 Benson

 2011/4/14 Michael Anstis michael.ans...@gmail.com:
 Sure, whenever you copy values from your UI to your model for validation
 you
 also enter a fact representing the context of the values.

 Using your example you have two edit boxes on one screen and your rule
 simply checks for the value of a single edit box; in this case the
 context
 differentiates the two.

 Walking your example:

 (1) When editbox 1 looses focus you copy the value from the dropdown and
 edit box 1 into your model, plus you enter a context fact stating that
 these values relate to that part of the UI (say
 screen1.panel1.editbox1).
 You then insert these facts into WM and call fireAllRules. The rules
 check
 the context and only execute if the values are for the (rule)
 applicable
 context. (2) Editbox 2 works in a similar way, but has a different
 context
 ((say screen1.panel1.editbox2).

 Have a look at Plugtree - I believe they're quite well customed to
 writing
 UIs backed with rules; salaboy or esteban (or IRC #drools) might be able
 to
 offer more practical advice.

 With kind regards,

 Mike



 On 13 April 2011

Re: [rules-users] execute particular rules programmatically and dynamically

2011-04-14 Thread Benson Fung
Hi Wolfgang,

Please see the following scenario.



On Thu, Apr 14, 2011 at 12:19 AM, Benson Fung benson.red...@gmail.com wrote:
 Hi,

 Here is the scenario :

 If there are 2 edit boxes and 2 dropdown list at the frontend like.


 dropdown(minIssrdAge1)   editbox(age1)
 dropdown(minIssrdAge2)   editbox(age2)

 everytime when I lost focus the editbox(age1 or age2),  the
 editbox(age1 or age2) value will be validated against the following
 rules.
 i.e.  minIssrdAge1 and age1 will be validated together if lost focus
 the editbox age1.
       minIssrdAge2 and age2 will be validated together if lost focus
 the editbox age2

 Rule1 is mandatory because both editbox are required field.
 However, editbox(age1) is only valid within the 0 and 100.  and
 editbox(age2) is only valid within 0 and 600.

 In other words, editbox(age1) have to be validated against Rule1 +
 Rule2.  However, editbox(age2) have to validated against Rule1 +
 Rule3.

 My question, how to design the rule attribute or at the java program
 side so that different editbox can be validated against different
 rule.

 Please help.  I can't find any solution by now.

 rule Rule1
        salience 1
        dialect mvel
        when
                ad : ApplicationData( age ==  || (  == null ))
        then
                ad.setReturnMsg( \n age should not be null or empty );
 end


 rule Rule2
        dialect mvel
        when
                ad : ApplicationData( $age : age != null , age !=  , 
 minIssrdAge
 == Years )
                eval(Integer.parseInt($age)  0) or 
 eval(Integer.parseInt($age)  100)
        then
                ad.setReturnMsg( \nage is out of the range(i.e.   0 and  
 100) );
 end

 rule Rule3
        dialect mvel
        when
                ad : ApplicationData( $age : age != null , age !=  , 
 minIssrdAge
 == Years )
                eval(Integer.parseInt($age)  0) or 
 eval(Integer.parseInt($age)  600)
        then
                ad.setReturnMsg( \nage is out of the range(i.e.   0 and  
 600) );
 end


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


Re: [rules-users] execute particular rules programmatically and dynamically

2011-04-14 Thread Benson Fung
Hi Bob,

Let me try to implement the AgendaFIlter :

import java.util.List;

import org.drools.runtime.rule.Activation;
import org.drools.runtime.rule.AgendaFilter;

public class RuleNameContainsAgendaFilter implements AgendaFilter {


private ListString rules;

public RuleNameContainsAgendaFilter(ListString rules) {
this.rules = rules;
}

public boolean accept(Activation activation) {
// TODO Auto-generated method stub
String activationRuleName = activation.getRule().getName();
if(rules.contains(activationRuleName)) {
return true;
} else {
return false;
}
}

}

I think the above the AgendaFilter can resolve the particular rule
execution value, i.e.  Just pass all the specific rule into a List
object and create the above AgendaFilter, then those particular rule
can be executed.


Please comment.


Benson

On Thu, Apr 14, 2011 at 5:38 PM, Robert Christenson r...@akc.org wrote:
 We've come across something similar in our project just recently as well.

 We have a requirement to have some rules activate based on a tab-off action 
 but also at a higher level (such as validating an entire event entry in the 
 GUI). I also need these rules to activate if initiated from an external 
 webservice (no GUI at all).

 What we've decided to utilize is a meta identifier in certain rules called 
 FieldsAffected which may contain a delimited list of field identifiers.

 An AgendaFilter implementation is created for GUI side requests and passed to 
 fireAllRules. The filter implementation compares any/all field identifiers 
 passed within the request and keeps only those activations which contain the 
 field identifier in it's metadata field.

 Our RHS creates a validation msg which contains the field identifiers so that 
 the calling GUI can display the proper msgs to the field.

 This allows us to support multiple call scenarios without duplicating the 
 logic in multiple rules just based on context info.

 Hope this helps,

 Bob Christenson


 --

 Message: 2
 Date: Thu, 14 Apr 2011 15:23:44 +0800
 From: Benson Fung benson.red...@gmail.com
 Subject: Re: [rules-users] execute particular rules programmatically
    and    dynamically
 To: Rules Users List rules-users@lists.jboss.org
 Message-ID: BANLkTi=OGO=rwfenybhm144gvst+p_k...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1

 Thanks Michael, let me think about your solution seriously afterwards.
  Actually, I am using GWT.
 I would like to say that sometimes customer's requirement is picky and
 unexpectable.  They really want to have close coupling between UI and
 Rules.  haha.  :)    Do you think it is helpless as a
 consultant???   :~(

 If anyone has another idea of this scenario, you are welcome to post
 your idea out there.


 Thank you very much



 2011/4/14 Michael Anstis michael.ans...@gmail.com:
 In my example Rule 1 was shared between screen1.panel1.editbox1 and
 screen1.panel1.editbox2:-

 rule Rule1
 ? salience 1
 ? dialect mvel
 ??? when
 ? ApplicationContext( context in (screen1.panel1.editbox1,
 screen1.panel1.editbox2) )
 ? ? ? ad : ApplicationData( age ==  || ( ?== null ))
 ? ? then
 ? ??? ad.setReturnMsg( \n age should not be null or empty );
 end

 This is an approach and may not be the best available; I was trying to
 demonstrate how your problem can be solved without having to worry about
 explicitly executing individual rules.For example, depending on what UI
 technology you are using (Swing, JSF) you could subclass the UI components
 and use these as facts - but such close coupling between UI and Rules may be
 undesirable.

 With kind regards,

 Mike

 On 14 April 2011 03:52, Benson Fung benson.red...@gmail.com wrote:

 Good, Michael.

 'context' is used to distinguish which part of the UI which will be
 validated, right? ?The customer will ask if they have 1 rules in
 the rulebase. ?And some of them are redundant, so they want to make
 some of the rules share with several part of UI, e.g. ?editbox 6,
 editbox 7 and editbox 8 these 3 boxes' value range is within 0 and
 600. ?Therefore, Rule3 can be shared for these 3 editbox validation,
 right? ?However, for the context variable approach, it seems Rule3
 cannot be shared for another editbox with same value range validation.
 ?So these could be a key for the BRMS/Drools.


 Benson

 2011/4/14 Michael Anstis michael.ans...@gmail.com:
 Sure, whenever you copy values from your UI to your model for validation
 you
 also enter a fact representing the context of the values.

 Using your example you have two edit boxes on one screen and your rule
 simply checks for the value of a single edit box; in this case the
 context
 differentiates the two.

 Walking your example:

 (1) When editbox 1 looses focus you copy the value from

Re: [rules-users] execute particular rules programmatically and dynamically

2011-04-13 Thread Benson Fung
Hi,

Here is the scenario :

If there are 2 edit boxes and 2 dropdown list at the frontend like.


dropdown(minIssrdAge1)   editbox(age1)
dropdown(minIssrdAge2)   editbox(age2)

everytime when I lost focus the editbox(age1 or age2),  the
editbox(age1 or age2) value will be validated against the following
rules.
i.e.  minIssrdAge1 and age1 will be validated together if lost focus
the editbox age1.
   minIssrdAge2 and age2 will be validated together if lost focus
the editbox age2

Rule1 is mandatory because both editbox are required field.
However, editbox(age1) is only valid within the 0 and 100.  and
editbox(age2) is only valid within 0 and 600.

In other words, editbox(age1) have to be validated against Rule1 +
Rule2.  However, editbox(age2) have to validated against Rule1 +
Rule3.

My question, how to design the rule attribute or at the java program
side so that different editbox can be validated against different
rule.

Please help.  I can't find any solution by now.

rule Rule1
salience 1
dialect mvel
when
ad : ApplicationData( age ==  || (  == null ))
then
ad.setReturnMsg( \n age should not be null or empty );
end


rule Rule2
dialect mvel
when
ad : ApplicationData( $age : age != null , age !=  , 
minIssrdAge
== Years )
eval(Integer.parseInt($age)  0) or eval(Integer.parseInt($age) 
 100)
then
ad.setReturnMsg( \nage is out of the range(i.e.   0 and  
100) );
end

rule Rule3
dialect mvel
when
ad : ApplicationData( $age : age != null , age !=  , 
minIssrdAge
== Years )
eval(Integer.parseInt($age)  0) or eval(Integer.parseInt($age) 
 600)
then
ad.setReturnMsg( \nage is out of the range(i.e.   0 and  
600) );
end
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] execute particular rules programmatically and dynamically

2011-04-13 Thread Benson Fung
Hi Michael,

Can you elaborate more for the uses of the ApplicationContext?  I
can't follow its uses.


Thanks
Benson

2011/4/14 Michael Anstis michael.ans...@gmail.com:
 Here's a quick (and probably sub-optimal way) ;)

 When you copy values from the UI to Facts for validation you also include
 the context of the validation.

 I've also removed the inline evals you were using.

 rule Rule1
   salience 1
   dialect mvel
     when
   ApplicationContext( context == * )
       ad : ApplicationData( age ==  || (  == null ))
     then
       ad.setReturnMsg( \n age should not be null or empty );
 end

 rule Rule2
   dialect mvel
     when
       ApplicationContext( context == screen1.panel1.ed )
       ad : ApplicationData( $age : age != null , age !=  , age  0 || 
 100, minIssrdAge == Years )
     then
       ad.setReturnMsg( \nage is out of the range(i.e.   0 and  100) );
 end

 rule Rule3
    dialect mvel
      when
        ad : ApplicationData( $age : age != null , age !=  , age 0 || 
 600, minIssrdAge == Years )
      then
        ad.setReturnMsg( \nage is out of the range(i.e.   0 and  600) );
 end

 On 13 April 2011 17:19, Benson Fung benson.red...@gmail.com wrote:

 Hi,

 Here is the scenario :

 If there are 2 edit boxes and 2 dropdown list at the frontend like.


 dropdown(minIssrdAge1)   editbox(age1)
 dropdown(minIssrdAge2)   editbox(age2)

 everytime when I lost focus the editbox(age1 or age2),  the
 editbox(age1 or age2) value will be validated against the following
 rules.
 i.e.  minIssrdAge1 and age1 will be validated together if lost focus
 the editbox age1.
       minIssrdAge2 and age2 will be validated together if lost focus
 the editbox age2

 Rule1 is mandatory because both editbox are required field.
 However, editbox(age1) is only valid within the 0 and 100.  and
 editbox(age2) is only valid within 0 and 600.

 In other words, editbox(age1) have to be validated against Rule1 +
 Rule2.  However, editbox(age2) have to validated against Rule1 +
 Rule3.

 My question, how to design the rule attribute or at the java program
 side so that different editbox can be validated against different
 rule.

 Please help.  I can't find any solution by now.

 rule Rule1
        salience 1
        dialect mvel
        when
                ad : ApplicationData( age ==  || (  == null ))
        then
                ad.setReturnMsg( \n age should not be null or empty );
 end


 rule Rule2
        dialect mvel
        when
                ad : ApplicationData( $age : age != null , age !=  ,
 minIssrdAge
 == Years )
                eval(Integer.parseInt($age)  0) or
 eval(Integer.parseInt($age)  100)
        then
                ad.setReturnMsg( \nage is out of the range(i.e.   0 and 
 100) );
 end

 rule Rule3
        dialect mvel
        when
                ad : ApplicationData( $age : age != null , age !=  ,
 minIssrdAge
 == Years )
                eval(Integer.parseInt($age)  0) or
 eval(Integer.parseInt($age)  600)
        then
                ad.setReturnMsg( \nage is out of the range(i.e.   0 and 
 600) );
 end
 ___
 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] execute particular rules programmatically and dynamically

2011-04-13 Thread Benson Fung
Good, Michael.

'context' is used to distinguish which part of the UI which will be
validated, right?  The customer will ask if they have 1 rules in
the rulebase.  And some of them are redundant, so they want to make
some of the rules share with several part of UI, e.g.  editbox 6,
editbox 7 and editbox 8 these 3 boxes' value range is within 0 and
600.  Therefore, Rule3 can be shared for these 3 editbox validation,
right?  However, for the context variable approach, it seems Rule3
cannot be shared for another editbox with same value range validation.
 So these could be a key for the BRMS/Drools.


Benson

2011/4/14 Michael Anstis michael.ans...@gmail.com:
 Sure, whenever you copy values from your UI to your model for validation you
 also enter a fact representing the context of the values.

 Using your example you have two edit boxes on one screen and your rule
 simply checks for the value of a single edit box; in this case the context
 differentiates the two.

 Walking your example:

 (1) When editbox 1 looses focus you copy the value from the dropdown and
 edit box 1 into your model, plus you enter a context fact stating that
 these values relate to that part of the UI (say screen1.panel1.editbox1).
 You then insert these facts into WM and call fireAllRules. The rules check
 the context and only execute if the values are for the (rule) applicable
 context. (2) Editbox 2 works in a similar way, but has a different context
 ((say screen1.panel1.editbox2).

 Have a look at Plugtree - I believe they're quite well customed to writing
 UIs backed with rules; salaboy or esteban (or IRC #drools) might be able to
 offer more practical advice.

 With kind regards,

 Mike



 On 13 April 2011 17:48, Benson Fung benson.red...@gmail.com wrote:

 Hi Michael,

 Can you elaborate more for the uses of the ApplicationContext?  I
 can't follow its uses.


 Thanks
 Benson

 2011/4/14 Michael Anstis michael.ans...@gmail.com:
  Here's a quick (and probably sub-optimal way) ;)
 
  When you copy values from the UI to Facts for validation you also
  include
  the context of the validation.
 
  I've also removed the inline evals you were using.
 
  rule Rule1
    salience 1
    dialect mvel
      when
    ApplicationContext( context == * )
        ad : ApplicationData( age ==  || (  == null ))
      then
        ad.setReturnMsg( \n age should not be null or empty );
  end
 
  rule Rule2
    dialect mvel
      when
        ApplicationContext( context == screen1.panel1.ed )
        ad : ApplicationData( $age : age != null , age !=  , age  0 ||
  
  100, minIssrdAge == Years )
      then
        ad.setReturnMsg( \nage is out of the range(i.e.   0 and  100)
  );
  end
 
  rule Rule3
     dialect mvel
       when
         ad : ApplicationData( $age : age != null , age !=  , age 0 ||
  
  600, minIssrdAge == Years )
       then
         ad.setReturnMsg( \nage is out of the range(i.e.   0 and  600)
  );
  end
 
  On 13 April 2011 17:19, Benson Fung benson.red...@gmail.com wrote:
 
  Hi,
 
  Here is the scenario :
 
  If there are 2 edit boxes and 2 dropdown list at the frontend like.
 
 
  dropdown(minIssrdAge1)   editbox(age1)
  dropdown(minIssrdAge2)   editbox(age2)
 
  everytime when I lost focus the editbox(age1 or age2),  the
  editbox(age1 or age2) value will be validated against the following
  rules.
  i.e.  minIssrdAge1 and age1 will be validated together if lost focus
  the editbox age1.
        minIssrdAge2 and age2 will be validated together if lost focus
  the editbox age2
 
  Rule1 is mandatory because both editbox are required field.
  However, editbox(age1) is only valid within the 0 and 100.  and
  editbox(age2) is only valid within 0 and 600.
 
  In other words, editbox(age1) have to be validated against Rule1 +
  Rule2.  However, editbox(age2) have to validated against Rule1 +
  Rule3.
 
  My question, how to design the rule attribute or at the java program
  side so that different editbox can be validated against different
  rule.
 
  Please help.  I can't find any solution by now.
 
  rule Rule1
         salience 1
         dialect mvel
         when
                 ad : ApplicationData( age ==  || (  == null ))
         then
                 ad.setReturnMsg( \n age should not be null or empty );
  end
 
 
  rule Rule2
         dialect mvel
         when
                 ad : ApplicationData( $age : age != null , age !=  ,
  minIssrdAge
  == Years )
                 eval(Integer.parseInt($age)  0) or
  eval(Integer.parseInt($age)  100)
         then
                 ad.setReturnMsg( \nage is out of the range(i.e.   0
  and 
  100) );
  end
 
  rule Rule3
         dialect mvel
         when
                 ad : ApplicationData( $age : age != null , age !=  ,
  minIssrdAge
  == Years )
                 eval(Integer.parseInt($age)  0) or
  eval(Integer.parseInt($age)  600)
         then
                 ad.setReturnMsg( \nage is out of the range(i.e.   0
  and 
  600) );
  end

[rules-users] Strange java.lang.NoClassDefFoundError

2011-04-11 Thread Benson Fung
Hi,

I have a GWT RPC method as follows :

public String validate(ApplicationData ad) {
Object dataObj = null;

KnowledgeAgent kagent =
(KnowledgeAgent)getServletContext().getAttribute(KNOWLEDGE_AGENT);
KnowledgeBase kbase = kagent.getKnowledgeBase();
StatefulKnowledgeSession sf = 
kbase.newStatefulKnowledgeSession();
FactType ft = kbase.getFactType(axaPMTPOCPackage, 
ApplicationData);
try {
dataObj = ft.newInstance();
ft.set(dataObj, name, ad.getName());
ft.set(dataObj, sex, ad.getSex());
ft.set(dataObj, minIssrdAge, ad.getMinIssrdAge());
ft.set(dataObj, age, ad.getAge());
ft.set(dataObj, boxname, ad.getBoxname());
sf.insert(dataObj);
RuleNameStartsWithAgendaFilter filter = new
RuleNameStartsWithAgendaFilter(ad.getRuleName());
sf.fireAllRules(filter);
sf.dispose();
} catch(Exception e) {
e.printStackTrace();
}

String returnMsg = (String)ft.get(dataObj, returnMsg);
return returnMsg;
}

At the client side, I made 2000 times of the above ajax call to
validate 2000 fields.
However, I got the following java exception after making certain
number of calls.

2011-04-11 15:45:17,438 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/axa_pmt_poc]]
(http-127.0.0.1-8080-8) Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract java.lang.String
com.axa.pmt.poc.client.ExecuteRuleService.validate(com.axa.pmt.poc.data.ApplicationData)'
threw an unexpected exception: java.lang.NoClassDefFoundError:
axaPMTPOCPackage/ApplicationData
at 
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
at 
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
at 
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at 
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at 
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: axaPMTPOCPackage/ApplicationData
at ASMAccessorImpl_19303314141302536715970.getValue(Unknown Source)
at 
org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:66)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:96)
at 

Re: [rules-users] Strange java.lang.NoClassDefFoundError

2011-04-11 Thread Benson Fung
Hi,

Please note that, if I make 200 ajax call to validate 200 fields.  It
works fine without any problem.
But if validate 2000 fields, the exception comes up.  Please advise
what is the root cause in the BRMS(Drools Guvnor).


Thanks
Benson

On Tue, Apr 12, 2011 at 2:00 AM, Benson Fung benson.red...@gmail.com wrote:
 Hi,

 I have a GWT RPC method as follows :

        public String validate(ApplicationData ad) {
                Object dataObj = null;

                KnowledgeAgent kagent =
 (KnowledgeAgent)getServletContext().getAttribute(KNOWLEDGE_AGENT);
                KnowledgeBase kbase = kagent.getKnowledgeBase();
                StatefulKnowledgeSession sf = 
 kbase.newStatefulKnowledgeSession();
                FactType ft = kbase.getFactType(axaPMTPOCPackage, 
 ApplicationData);
                try {
                        dataObj = ft.newInstance();
                        ft.set(dataObj, name, ad.getName());
                        ft.set(dataObj, sex, ad.getSex());
                        ft.set(dataObj, minIssrdAge, ad.getMinIssrdAge());
                        ft.set(dataObj, age, ad.getAge());
                        ft.set(dataObj, boxname, ad.getBoxname());
                        sf.insert(dataObj);
                        RuleNameStartsWithAgendaFilter filter = new
 RuleNameStartsWithAgendaFilter(ad.getRuleName());
                        sf.fireAllRules(filter);
                        sf.dispose();
                } catch(Exception e) {
                        e.printStackTrace();
                }

                String returnMsg = (String)ft.get(dataObj, returnMsg);
                return returnMsg;
        }

 At the client side, I made 2000 times of the above ajax call to
 validate 2000 fields.
 However, I got the following java exception after making certain
 number of calls.

 2011-04-11 15:45:17,438 ERROR
 [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/axa_pmt_poc]]
 (http-127.0.0.1-8080-8) Exception while dispatching incoming RPC call
 com.google.gwt.user.server.rpc.UnexpectedException: Service method
 'public abstract java.lang.String
 com.axa.pmt.poc.client.ExecuteRuleService.validate(com.axa.pmt.poc.data.ApplicationData)'
 threw an unexpected exception: java.lang.NoClassDefFoundError:
 axaPMTPOCPackage/ApplicationData
        at 
 com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
        at 
 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
        at 
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
        at 
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
        at 
 com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
        at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
        at 
 org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
        at 
 org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
        at 
 org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
        at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at 
 org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
        at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
        at 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
        at 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
        at 
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:662)
 Caused by: java.lang.NoClassDefFoundError

Re: [rules-users] execute particular rules programmatically and dynamically

2011-03-31 Thread Benson Fung
The reason is that as the no. of rules in the rulebase grows, it is
possible that some of the rule can be re-used/shared for specific
purpose.

I am not sure this is the good reason.  Of course, like you said, if
it can solved by using agenda-group, activation-group, salience. That
will be wonderful.


Thanks

2011/3/31 Michael Anstis michael.ans...@gmail.com:
 Why would you want to execute a single rule?

 The logic you'd write to determine which rule to fire should itself be part
 of the rules: So, for example, if you want to validate facts of type Smurf
 then write a rule that matches on Smurf. When you insert a Smurf only
 the rules that match on this will become candidates for execution when you
 call fireAllRules. Perhaps use of a stateless session would simplify things
 so you need not worry about other facts in WM polluting the results you
 expect to see?

 More and more questions are posted here asking how to make individual rules
 execute; IMO the solution is to change your thinking about how Rules Engines
 work.

 If you give your use-case we might be able to advise a better approach.

 With kind regards,

 Mike

 2011/3/31 Wolfgang Laun wolfgang.l...@gmail.com


 On 31 March 2011 07:58, Benson Fung benson.red...@gmail.com wrote:

 Hi,

 If there are 10 rules in the drools rulebase, and right now I would
 like to execute one of the particular rule.  Is there any approach/way
 to execute particular rule programmatically?

 No. The right hand side of a rule (code between then and end) is
 executed whenever there is a set of fact objects in Working Memory
 satisfying the condition. If you insert such a set of facts and call
 fireAllRules(), then it will happen.



  I don't think
 agenda-group or activation-group can do that, right?  Or is it
 possible to create an agenda programmatically ?

 No to both.
 -W


 Thanks
 ___
 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] execute particular rules programmatically and dynamically

2011-03-31 Thread Benson Fung
Hi Steven,

Would you share your case?


Thanks
Benson

2011/4/1 Steven Williams stevearoo...@gmail.com:
 I have actually used this method for the one valid case I have thought of -
 unit testing rules.
 Steve


 2011/4/1 Swindells, Thomas tswinde...@nds.com

 Agreed,

 But if you really do want to you can setup an agenda filter so that only
 the activation for the rule you care about is fired – but I don’t think
 there are many valid cases where this is needed/desirable/appropriate.



 Thomas



 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
 Sent: 31 March 2011 10:08
 To: Rules Users List
 Subject: Re: [rules-users] execute particular rules programmatically and
 dynamically



 Why would you want to execute a single rule?

 The logic you'd write to determine which rule to fire should itself be
 part of the rules: So, for example, if you want to validate facts of type
 Smurf then write a rule that matches on Smurf. When you insert a Smurf
 only the rules that match on this will become candidates for execution when
 you call fireAllRules. Perhaps use of a stateless session would simplify
 things so you need not worry about other facts in WM polluting the results
 you expect to see?

 More and more questions are posted here asking how to make individual
 rules execute; IMO the solution is to change your thinking about how Rules
 Engines work.

 If you give your use-case we might be able to advise a better approach.

 With kind regards,

 Mike

 2011/3/31 Wolfgang Laun wolfgang.l...@gmail.com



 On 31 March 2011 07:58, Benson Fung benson.red...@gmail.com wrote:

 Hi,

 If there are 10 rules in the drools rulebase, and right now I would
 like to execute one of the particular rule.  Is there any approach/way
 to execute particular rule programmatically?

 No. The right hand side of a rule (code between then and end) is
 executed whenever there is a set of fact objects in Working Memory
 satisfying the condition. If you insert such a set of facts and call
 fireAllRules(), then it will happen.



  I don't think
 agenda-group or activation-group can do that, right?  Or is it
 possible to create an agenda programmatically ?

 No to both.
 -W


 Thanks
 ___
 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



 

 **
 This message is confidential and intended only for the addressee. If you
 have received this message in error, please immediately notify the
 postmas...@nds.com and delete it from your system as well as any copies. The
 content of e-mails as well as traffic data may be monitored by NDS for
 employment and security purposes. To protect the environment please do not
 print this e-mail unless necessary.

 NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
 4EX, United Kingdom. A company registered in England and Wales. Registered
 no. 3080780. VAT no. GB 603 8808 40-00

 **

 ___
 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] execute particular rules programmatically and dynamically

2011-03-31 Thread Benson Fung
Yes, this is simple and easy to simple.  However, if the solution is
an enterprise level with tons of rules.   It will have a lot of rule
files in the repository, it will make the rule
maintenance/house-keeping difficult.  I prefer to design an
algorithm/framework programmatically to handle this situation.

Thanks

On Fri, Apr 1, 2011 at 11:38 AM, Jevon Wright je...@jevon.org wrote:
 If you split up your rules across many rule files, you can selectively
 execute specific rule files. Very simple but it works :-)

 Jevon

 On Thu, Mar 31, 2011 at 6:58 PM, Benson Fung benson.red...@gmail.com wrote:
 Hi,

 If there are 10 rules in the drools rulebase, and right now I would
 like to execute one of the particular rule.  Is there any approach/way
 to execute particular rule programmatically?  I don't think
 agenda-group or activation-group can do that, right?  Or is it
 possible to create an agenda programmatically ?

 Thanks
 ___
 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] execute particular rules programmatically and dynamically

2011-03-30 Thread Benson Fung
Hi,

If there are 10 rules in the drools rulebase, and right now I would
like to execute one of the particular rule.  Is there any approach/way
to execute particular rule programmatically?  I don't think
agenda-group or activation-group can do that, right?  Or is it
possible to create an agenda programmatically ?

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


Re: [rules-users] execute Rules selectively

2011-03-25 Thread Benson Fung
Hi Leonardo,

Thanks for your patience.  Let me try to describe what I want in details.

e.g.  There is a variable A with 3 rules in BRMS.

The variable A is input by a user via an edit box at the frontend.
Now there are 1000 rules in the BRMS rulebase.  However, 3 out of 1000
rules are related to this variable A, like

rule 'check_a_empty'
when (( A == null) || (A == ) )

then  return a message 'A cannot be empty'

rule 'A_Range_0_100'
when ((A  0 ) || (A  100) )

then return a message 'A must be within the range between 0 and 100'

rule 'check_A_Character'
when ((A is not an integer))

return a message 'A must be an integer'


If I would like to execute the above 3 rules at the same time, how to
write/develop the AgendaFilter class?

Please advise


Thank you very much
Benson

2011/3/25 Leonardo Gomes leonardo.f.go...@gmail.com:
 Hi Benson,

 What exactly do you want to achieve? You want to execute rules in parallel?



 On Fri, Mar 25, 2011 at 2:08 AM, Benson Fung benson.red...@gmail.com
 wrote:

 Hi,

 I have setup about 10 rules in the rulebase.  Can you tell me how I
 can execute more than one specific rule at the same time?  Please help


 Thanks
 Benson
 ___
 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] execute Rules selectively

2011-03-25 Thread Benson Fung
Thanks Mauricio,

What I want is to only execute these 3 rules simultaneously out of
1000 rules in the rulebase.  Can you advise programmatically how to
achieve?

Thanks


On Fri, Mar 25, 2011 at 9:19 PM, Mauricio Salatino sala...@gmail.com wrote:
 If you include all that rules inside a knowledge session and then if you
 insert A, all the rules will be evaluated.
 There is no need to create an agenda group for that, unless I'm missing
 something else that you don't mention :)
 Greetings.

 On Fri, Mar 25, 2011 at 10:10 AM, Benson Fung benson.red...@gmail.com
 wrote:

 Hi Leonardo,

 Thanks for your patience.  Let me try to describe what I want in details.

 e.g.  There is a variable A with 3 rules in BRMS.

 The variable A is input by a user via an edit box at the frontend.
 Now there are 1000 rules in the BRMS rulebase.  However, 3 out of 1000
 rules are related to this variable A, like

 rule 'check_a_empty'
 when (( A == null) || (A == ) )

 then  return a message 'A cannot be empty'

 rule 'A_Range_0_100'
 when ((A  0 ) || (A  100) )

 then return a message 'A must be within the range between 0 and 100'

 rule 'check_A_Character'
 when ((A is not an integer))

 return a message 'A must be an integer'


 If I would like to execute the above 3 rules at the same time, how to
 write/develop the AgendaFilter class?

 Please advise


 Thank you very much
 Benson

 2011/3/25 Leonardo Gomes leonardo.f.go...@gmail.com:
  Hi Benson,
 
  What exactly do you want to achieve? You want to execute rules in
  parallel?
 
 
 
  On Fri, Mar 25, 2011 at 2:08 AM, Benson Fung benson.red...@gmail.com
  wrote:
 
  Hi,
 
  I have setup about 10 rules in the rulebase.  Can you tell me how I
  can execute more than one specific rule at the same time?  Please help
 
 
  Thanks
  Benson
  ___
  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



 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -


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


Re: [rules-users] execute Rules selectively

2011-03-25 Thread Benson Fung
The other 997 rules are for another Fact.  Sorry for my misleading you.


Benson

On Fri, Mar 25, 2011 at 9:35 PM, Mauricio Salatino sala...@gmail.com wrote:
 but you have another 997 rules about the A() Fact? or the other rules are
 about another facts??
 Greetings.

 On Fri, Mar 25, 2011 at 10:29 AM, Benson Fung benson.red...@gmail.com
 wrote:

 Thanks Mauricio,

 What I want is to only execute these 3 rules simultaneously out of
 1000 rules in the rulebase.  Can you advise programmatically how to
 achieve?

 Thanks


 On Fri, Mar 25, 2011 at 9:19 PM, Mauricio Salatino sala...@gmail.com
 wrote:
  If you include all that rules inside a knowledge session and then if you
  insert A, all the rules will be evaluated.
  There is no need to create an agenda group for that, unless I'm missing
  something else that you don't mention :)
  Greetings.
 
  On Fri, Mar 25, 2011 at 10:10 AM, Benson Fung benson.red...@gmail.com
  wrote:
 
  Hi Leonardo,
 
  Thanks for your patience.  Let me try to describe what I want in
  details.
 
  e.g.  There is a variable A with 3 rules in BRMS.
 
  The variable A is input by a user via an edit box at the frontend.
  Now there are 1000 rules in the BRMS rulebase.  However, 3 out of 1000
  rules are related to this variable A, like
 
  rule 'check_a_empty'
  when (( A == null) || (A == ) )
 
  then  return a message 'A cannot be empty'
 
  rule 'A_Range_0_100'
  when ((A  0 ) || (A  100) )
 
  then return a message 'A must be within the range between 0 and 100'
 
  rule 'check_A_Character'
  when ((A is not an integer))
 
  return a message 'A must be an integer'
 
 
  If I would like to execute the above 3 rules at the same time, how to
  write/develop the AgendaFilter class?
 
  Please advise
 
 
  Thank you very much
  Benson
 
  2011/3/25 Leonardo Gomes leonardo.f.go...@gmail.com:
   Hi Benson,
  
   What exactly do you want to achieve? You want to execute rules in
   parallel?
  
  
  
   On Fri, Mar 25, 2011 at 2:08 AM, Benson Fung
   benson.red...@gmail.com
   wrote:
  
   Hi,
  
   I have setup about 10 rules in the rulebase.  Can you tell me how I
   can execute more than one specific rule at the same time?  Please
   help
  
  
   Thanks
   Benson
   ___
   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
 
 
 
  --
   - CTO @ http://www.plugtree.com
   - MyJourney @ http://salaboy.wordpress.com
   - Co-Founder @ http://www.jbug.com.ar
 
   - Salatino Salaboy Mauricio -
 



 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -


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


[rules-users] Ask for help on rule authoring

2011-03-25 Thread Benson Fung
Hi,

I got the following rule problem.

The rule is like :

1.  |   rule Rule1
2.  |   dialect mvel
3.  |   when
4.  |   ad : ApplicationData( age == null , age.size() == 0)
5.  |   then
6.  |   ad.setReturnMsg( age should not be null or empty );
7.  |   end

where setReturnMsg is a method of ApplicationData Fact();

However, I got the validation error :

[Rule1] [ERR 101] Line 4:49 no viable alternative at input ')' in rule
Rule1 in pattern ApplicationData
[Rule1] [ERR 102] Line 4:51 mismatched input '==' expecting ')' in
rule Rule1 in pattern ApplicationData

Please help what the problem is.


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


Re: [rules-users] Ask for help on rule authoring

2011-03-25 Thread Benson Fung
Thank you very much.




2011/3/26 Wolfgang Laun wolfgang.l...@gmail.com:
 You can't use a method call as the left hand side operand in a constraint;
 thus
    age.size() == 0
 is not correct.

 Do you really mean
    age == null

 Probably
   ApplicationData( age == null || age ==  )
 is the right thing to do, provided that ApplicationData.age is a String.

 -W

 On 25 March 2011 17:32, Benson Fung benson.red...@gmail.com wrote:

 Hi,

 I got the following rule problem.

 The rule is like :

 1.      |       rule Rule1
 2.      |           dialect mvel
 3.      |           when
 4.      |               ad : ApplicationData( age == null , age.size()
 == 0)
 5.      |           then
 6.      |               ad.setReturnMsg( age should not be null or empty
 );
 7.      |       end

 where setReturnMsg is a method of ApplicationData Fact();

 However, I got the validation error :

 [Rule1] [ERR 101] Line 4:49 no viable alternative at input ')' in rule
 Rule1 in pattern ApplicationData
 [Rule1] [ERR 102] Line 4:51 mismatched input '==' expecting ')' in
 rule Rule1 in pattern ApplicationData

 Please help what the problem is.


 Thanks
 ___
 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] Ask for help on rule authoring

2011-03-25 Thread Benson Fung
Hi Wolfgang,

I managed to author this rule(ApplicationData( age == null || age ==
 )) via Technical Rules editor of BRMS.
However, I cannot create this rule via Business Rule Guided Editor of BRMS.

Could you let me know how?


Thanks



2011/3/26 Wolfgang Laun wolfgang.l...@gmail.com:
 You can't use a method call as the left hand side operand in a constraint;
 thus
    age.size() == 0
 is not correct.

 Do you really mean
    age == null

 Probably
   ApplicationData( age == null || age ==  )
 is the right thing to do, provided that ApplicationData.age is a String.

 -W

 On 25 March 2011 17:32, Benson Fung benson.red...@gmail.com wrote:

 Hi,

 I got the following rule problem.

 The rule is like :

 1.      |       rule Rule1
 2.      |           dialect mvel
 3.      |           when
 4.      |               ad : ApplicationData( age == null , age.size()
 == 0)
 5.      |           then
 6.      |               ad.setReturnMsg( age should not be null or empty
 );
 7.      |       end

 where setReturnMsg is a method of ApplicationData Fact();

 However, I got the validation error :

 [Rule1] [ERR 101] Line 4:49 no viable alternative at input ')' in rule
 Rule1 in pattern ApplicationData
 [Rule1] [ERR 102] Line 4:51 mismatched input '==' expecting ')' in
 rule Rule1 in pattern ApplicationData

 Please help what the problem is.


 Thanks
 ___
 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] Ask for help on rule authoring

2011-03-25 Thread Benson Fung
suppose String first

2011/3/26 Mauricio Salatino sala...@gmail.com:
 yeah... that it's age? an int?


 2011/3/25 Wolfgang Laun wolfgang.l...@gmail.com

 You can't use a method call as the left hand side operand in a constraint;
 thus
    age.size() == 0
 is not correct.

 Do you really mean
    age == null

 Probably
   ApplicationData( age == null || age ==  )
 is the right thing to do, provided that ApplicationData.age is a String.

 -W

 On 25 March 2011 17:32, Benson Fung benson.red...@gmail.com wrote:

 Hi,

 I got the following rule problem.

 The rule is like :

 1.      |       rule Rule1
 2.      |           dialect mvel
 3.      |           when
 4.      |               ad : ApplicationData( age == null , age.size()
 == 0)
 5.      |           then
 6.      |               ad.setReturnMsg( age should not be null or
 empty );
 7.      |       end

 where setReturnMsg is a method of ApplicationData Fact();

 However, I got the validation error :

 [Rule1] [ERR 101] Line 4:49 no viable alternative at input ')' in rule
 Rule1 in pattern ApplicationData
 [Rule1] [ERR 102] Line 4:51 mismatched input '==' expecting ')' in
 rule Rule1 in pattern ApplicationData

 Please help what the problem is.


 Thanks
 ___
 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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

 ___
 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] Ask for help on rule authoring

2011-03-25 Thread Benson Fung
If the age is String type, can I use Integer.parseInt(age) to change
to integer and then evaluate it?

like

when
   ad : ApplicationData(Integer.parseInt(age)  0)
then
  ad.setReturnMsg(age should not be negative 0)
end




2011/3/26 Wolfgang Laun wolfgang.l...@gmail.com:
 Sorry, I don't use guided editors.
 -W

 On 25 March 2011 18:17, Benson Fung benson.red...@gmail.com wrote:

 Hi Wolfgang,

 I managed to author this rule(ApplicationData( age == null || age ==
  )) via Technical Rules editor of BRMS.
 However, I cannot create this rule via Business Rule Guided Editor of
 BRMS.

 Could you let me know how?


 Thanks



 2011/3/26 Wolfgang Laun wolfgang.l...@gmail.com:
  You can't use a method call as the left hand side operand in a
  constraint;
  thus
     age.size() == 0
  is not correct.
 
  Do you really mean
     age == null
 
  Probably
    ApplicationData( age == null || age ==  )
  is the right thing to do, provided that ApplicationData.age is a String.
 
  -W
 
  On 25 March 2011 17:32, Benson Fung benson.red...@gmail.com wrote:
 
  Hi,
 
  I got the following rule problem.
 
  The rule is like :
 
  1.      |       rule Rule1
  2.      |           dialect mvel
  3.      |           when
  4.      |               ad : ApplicationData( age == null ,
  age.size()
  == 0)
  5.      |           then
  6.      |               ad.setReturnMsg( age should not be null or
  empty
  );
  7.      |       end
 
  where setReturnMsg is a method of ApplicationData Fact();
 
  However, I got the validation error :
 
  [Rule1] [ERR 101] Line 4:49 no viable alternative at input ')' in rule
  Rule1 in pattern ApplicationData
  [Rule1] [ERR 102] Line 4:51 mismatched input '==' expecting ')' in
  rule Rule1 in pattern ApplicationData
 
  Please help what the problem is.
 
 
  Thanks
  ___
  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 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] Ask for help on rule authoring

2011-03-25 Thread Benson Fung
so how can I change it to integer in the rule?



2011/3/26 Wolfgang Laun wolfgang.l...@gmail.com:
 If it's stored in a fact field of type int: yes.

 The way you write it: no.

 -W


 On 25 March 2011 18:37, Benson Fung benson.red...@gmail.com wrote:

 If the age is String type, can I use Integer.parseInt(age) to change
 to integer and then evaluate it?

 like

 when
   ad : ApplicationData(Integer.parseInt(age)  0)
 then
  ad.setReturnMsg(age should not be negative 0)
 end




 2011/3/26 Wolfgang Laun wolfgang.l...@gmail.com:
  Sorry, I don't use guided editors.
  -W
 
  On 25 March 2011 18:17, Benson Fung benson.red...@gmail.com wrote:
 
  Hi Wolfgang,
 
  I managed to author this rule(ApplicationData( age == null || age ==
   )) via Technical Rules editor of BRMS.
  However, I cannot create this rule via Business Rule Guided Editor of
  BRMS.
 
  Could you let me know how?
 
 
  Thanks
 
 
 
  2011/3/26 Wolfgang Laun wolfgang.l...@gmail.com:
   You can't use a method call as the left hand side operand in a
   constraint;
   thus
      age.size() == 0
   is not correct.
  
   Do you really mean
      age == null
  
   Probably
     ApplicationData( age == null || age ==  )
   is the right thing to do, provided that ApplicationData.age is a
   String.
  
   -W
  
   On 25 March 2011 17:32, Benson Fung benson.red...@gmail.com wrote:
  
   Hi,
  
   I got the following rule problem.
  
   The rule is like :
  
   1.      |       rule Rule1
   2.      |           dialect mvel
   3.      |           when
   4.      |               ad : ApplicationData( age == null ,
   age.size()
   == 0)
   5.      |           then
   6.      |               ad.setReturnMsg( age should not be null or
   empty
   );
   7.      |       end
  
   where setReturnMsg is a method of ApplicationData Fact();
  
   However, I got the validation error :
  
   [Rule1] [ERR 101] Line 4:49 no viable alternative at input ')' in
   rule
   Rule1 in pattern ApplicationData
   [Rule1] [ERR 102] Line 4:51 mismatched input '==' expecting ')' in
   rule Rule1 in pattern ApplicationData
  
   Please help what the problem is.
  
  
   Thanks
   ___
   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 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] execute Rules selectively

2011-03-24 Thread Benson Fung
Hi,

I have setup about 10 rules in the rulebase.  Can you tell me how I
can execute more than one specific rule at the same time?  Please help


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


Re: [rules-users] not sure if this is a bug of drools or my bad usage...

2011-03-07 Thread Benson Fung
Hi Simon,

Could you tell me a bit more about your logic below in code level?  I
can't imagine how it goes.

So, I first insert an A(), print all the objects. Retract A(), and
print all the objects. Here's what I got:
com.sample.B@42
com.sample.C@43
com.sample.A@548997d1
after retract!
com.sample.B@42
com.sample.C@43


Benson

On Tue, Mar 8, 2011 at 3:33 AM, Simon Chen simonche...@gmail.com wrote:
 Hi all,

 An interesting finding:

 I have three simple rules:
 rule A2B
        when
                A()
        then
                insertLogical(new B());
 end
 rule B2C
        when
                B()
        then
                insertLogical(new C());
 end
 rule C2B
        when
                C()
        then
                insertLogical(new B());
 end

 Basically, once we have an A(), we'll logically insert a B(). Once we
 have a B(), we'll logically insert a C(). Once we have a C(), we'll
 logically insert a B().

 So, I first insert an A(), print all the objects. Retract A(), and
 print all the objects. Here's what I got:
 com.sample.B@42
 com.sample.C@43
 com.sample.A@548997d1
 after retract!
 com.sample.B@42
 com.sample.C@43

 So, B() and C(), which should be logically depend on A(), somehow are
 not retracted. The problem I see is the truth maintenance system allow
 B() and C() to depend on each other, thus not affected by losing A().

 Is this a bug or my bad usage?

 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


Re: [rules-users] How to obtain the object/fact created in the rule file?

2011-01-28 Thread Benson Fung
Thanks, could you show me some examples?


Benson

2011/1/29 Esteban Aliverti esteban.alive...@gmail.com:
 One thing you can do is to define a global to store that object. Then you
 could retrieve it from the outside.
 Best,

 

 Esteban Aliverti
 - Developer @ http://www.plugtree.com
 - Blog @ http://ilesteban.wordpress.com


 On Fri, Jan 28, 2011 at 2:02 PM, Benson Fung benson.red...@gmail.com
 wrote:

 Hi,

 I developed a rule as below:

        rule Rule1
            dialect mvel
            when
                Fields( field1  100 )
            then
                FieldResults fact0 = new FieldResults();
                fact0.setField1( This is Correct! );
                insert(fact0 );
        end

 After calling fireAllRules(...), the above rule will be fired and
 created a fact object in the working memory.
 My problem is how to obtain the FieldResults object in the java
 program.  Please advise.


 Thanks
 Benson
 ___
 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





-- 
Benson Fung
Solution Architect, Global Services, Greater China
| Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
Causeway Bay, Hong Kong || Office : 852-31802332 || Cell :
852-98369898 || benson.f...@redhat.com || http://www.hk.redhat.com||

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


Re: [rules-users] How to obtain the object/fact created in the rule file?

2011-01-28 Thread Benson Fung
Thanks, could you show me some examples?

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


Re: [rules-users] How to obtain the object/fact created in the rule file?

2011-01-28 Thread Benson Fung
ok, do you mean it is like :

global FieldResults frs
 rule Rule1
   dialect mvel
   when
   Fields( field1  100 )
   then
   frs.setField1(This is Correct!)
   end

In the java file :

Fields fs = new Fields();
fs.setField1(100);
FieldResults frs = new FieldResults();
sf.insert(fs);
sf.insert(frs);
sf.fireAllRules();

right?

2011/1/29 Esteban Aliverti esteban.alive...@gmail.com:
 One thing you can do is to define a global to store that object. Then you
 could retrieve it from the outside.
 Best,

 

 Esteban Aliverti
 - Developer @ http://www.plugtree.com
 - Blog @ http://ilesteban.wordpress.com


 On Fri, Jan 28, 2011 at 2:02 PM, Benson Fung benson.red...@gmail.com
 wrote:

 Hi,

 I developed a rule as below:

        rule Rule1
            dialect mvel
            when
                Fields( field1  100 )
            then
                FieldResults fact0 = new FieldResults();
                fact0.setField1( This is Correct! );
                insert(fact0 );
        end

 After calling fireAllRules(...), the above rule will be fired and
 created a fact object in the working memory.
 My problem is how to obtain the FieldResults object in the java
 program.  Please advise.


 Thanks
 Benson
 ___
 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] How to obtain the object/fact created in the rule file?

2011-01-28 Thread Benson Fung
Sorry, there is no subsection 5.5.2 in Drools Expert.  ---
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html

2011/1/29 Wolfgang Laun wolfgang.l...@gmail.com:
 Drools Expert in subsection 5.5.2, global has an example showing the DRL and
 the Java code.

 -W


 On 28 January 2011 18:29, Benson Fung benson.red...@gmail.com wrote:

 Thanks, could you show me some examples?

 Benson
 ___
 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] Looking for smart way to import huge amount of rules into BRMS

2011-01-27 Thread Benson Fung
Hi,

Please help on the case below.  I tried to create a package last night by
importing a drl file with 9000 rules.  However, it takes almost 4 hours to
finish the importing.  And my application is going to integrate with the
BRMS, however, it also take more than 2 hours to download the binary package
to build the KnowledgeBase/RuleBase.  Why is this so slow?  Is there any way
to speed up the process?


Thanks

On Thu, Jan 27, 2011 at 3:18 PM, Benson Fung benson.red...@gmail.comwrote:

 Hi,

 I need to import a drl file with 9000 rules inside into BRMS.  However, I
 found that it takes very long time to import and it also takes long time to
 get downloaded into the application to build the ruleBase.  Is there any
 smart way or faster way to manage this procedure?  Please advise


 Thanks

___
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-27 Thread Benson Fung
Hi,

I created a package by uploading a large drl file with 9000 rules into the
Guvnor/BRMS.  It takes almost 4 hours to complete.  Could you tell me how
you can upload ~76,000 rules in 7 minutes to the package?  It is very fast.
Please advise


Thanks

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

  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


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


Re: [rules-users] Looking for smart way to import huge amount of rules into BRMS

2011-01-27 Thread Benson Fung
Hi Wolfgang,

Thanks for your information.  Can you tell me more about how to build the
knowledge base off line? And how to load the serialized object during
startup?  What I usually do is put the following code fragment into the
init(...) method of the Servlet first and it will be invoked during
application Startup.

KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(
BenAgent );

kagent.applyChangeSet(ResourceFactory.newClassPathResource(change-set.xml));
KnowledgeBase kbase = kagent.getKnowledgeBase();
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
getServletContext().setAttribute(KNOWLEDGE_AGENT, kagent);


Please comments


Thanks

2011/1/27 Wolfgang Laun wolfgang.l...@gmail.com

 Consider building the Knowledge Base off-line and to load the serialized
 object during application startup.
 -W

 2011/1/27 Benson Fung benson.red...@gmail.com

 Hi,

 I need to import a drl file with 9000 rules inside into BRMS.  However, I
 found that it takes very long time to import and it also takes long time to
 get downloaded into the application to build the ruleBase.  Is there any
 smart way or faster way to manage this procedure?  Please advise


 Thanks

 ___
 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 amount of rules deployment

2011-01-26 Thread Benson Fung
Hi,

I have 9000 rules in a DRL file and would like to import to BRMS.  Please
suggest a way to import it efficiently.


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


[rules-users] Looking for smart way to import huge amount of rules into BRMS

2011-01-26 Thread Benson Fung
Hi,

I need to import a drl file with 9000 rules inside into BRMS.  However, I
found that it takes very long time to import and it also takes long time to
get downloaded into the application to build the ruleBase.  Is there any
smart way or faster way to manage this procedure?  Please advise


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


Re: [rules-users] Drools 5.1 JMX Monitoring.

2011-01-11 Thread Benson Fung
Thanks,  Let me check.



On Tue, Jan 11, 2011 at 6:09 AM, plugtreelabs plugtreel...@gmail.comwrote:


 Benson, I think you'll find the next post very useful

 http://lucazamador.wordpress.com/2011/01/07/drools-metrics-persistence/

 Hope it helps.


 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-1-JMX-Monitoring-tp2196951p2230790.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




-- 
Benson Fung
Solution Architect, Global Services, Greater China
| Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
Causeway Bay, Hong Kong || Office : 852-31802332 || Cell : 852-98369898 ||
benson.f...@redhat.com || http://www.hk.redhat.com||
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] KnowledgeAgent and applyChangeSet

2011-01-11 Thread Benson Fung
can you capture the exception for reference?  Looks like I got similar
exceptions before.



On Wed, Jan 12, 2011 at 12:31 AM, bob.breitling bob.breitl...@rrd.comwrote:


 If I have a KnowledgeAgent and I create a URL Resource and set its
 basicAuthenication, username and password attributes then I call the agents
 applyChangeSet method I get a HTTPD 401 response from the Guvnor.  It does
 not happen to my resourse which has a valid username and password, but it
 happens to the resource in the changeSet xml tag.

 It would seem to me that the resources that are built from the resource I
 passed would inherit the basicAuthenication, username and password
 attributes that I set and know work, but they don't and I get this error.

 If I debug the code and filling in those values on the resource passed to
 the createPackageFromResource method before the resource stream is read the
 code works.

 I am using the NilAuthenicator in the Guvnor components.xml and that seems
 to be working.  I get access to the Guvnor without being asked for
 credentials.

 I tried to configure my jboss (4.2.0) in login-config.xml to allow access
 to
 everything as guest.  But no luck.

 Any suggestions?

 Bob
 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-applyChangeSet-tp2235189p2235189.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




-- 
Benson Fung
Solution Architect, Global Services, Greater China
| Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
Causeway Bay, Hong Kong || Office : 852-31802332 || Cell : 852-98369898 ||
benson.f...@redhat.com || http://www.hk.redhat.com||
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Implementation of Drools 5.1 JMX Monitoring

2011-01-05 Thread Benson Fung
Hi,

Can you teach me how to implement the JMX Monitoring of Drools 5.1 like what
the following link mentions?

http://blog.athico.com/2009/10/drools-monitoring-with-jmx.html


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


[rules-users] Drools 5.1 JMX Monitoring.

2011-01-04 Thread Benson Fung
Hi ,

As I understand, Drools 5.1 made API enhancement to support JMX standard and
enables knowledge base and knowledge session monitoring and inspection using
any JMX console.
It also can display the average firing time.  How to implement this?  Is
there any sample for this?  Please advise.


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


[rules-users] QA features in BRMS

2010-12-30 Thread Benson Fung
Hi,

Can anyone know whether QA features can provide the rule conflict checks?


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


Re: [rules-users] QA features in BRMS

2010-12-30 Thread Benson Fung
I would like to check if there is any conflict among the created rules in
the BRMS 5.1.  Can the QA/Verify can check this out?



On Thu, Dec 30, 2010 at 5:24 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Please don't assume that everybody knows which features and
 which conflicts and which checks you have in mind.
 -W

 2010/12/30 Benson Fung benson.red...@gmail.com:
  Hi,
 
  Can anyone know whether QA features can provide the rule conflict checks?
 
 
  Thanks
 
  ___
  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




-- 
Benson Fung
Solution Architect, Global Services, Greater China
| Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
Causeway Bay, Hong Kong || Office : 852-31802332 || Cell : 852-98369898 ||
benson.f...@redhat.com || http://www.hk.redhat.com||
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] QA features in BRMS

2010-12-30 Thread Benson Fung
I would like to check if there is any conflict among the created rules in
the BRMS 5.1.  Can the QA/Verify function button in BRMS can check this out?

On Thu, Dec 30, 2010 at 5:24 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Please don't assume that everybody knows which features and
 which conflicts and which checks you have in mind.
 -W

 2010/12/30 Benson Fung benson.red...@gmail.com:
  Hi,
 
  Can anyone know whether QA features can provide the rule conflict checks?
 
 
  Thanks
 
  ___
  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] QA features in BRMS

2010-12-30 Thread Benson Fung
Hi Wolfgang Laun,

QA features is a features in BRMS/Drools Guvnor.  If you have opened up the
Drools Guvnor to take to look, you can see there is QA section at the left
hand side.  Please try.



On Thu, Dec 30, 2010 at 5:24 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Please don't assume that everybody knows which features and
 which conflicts and which checks you have in mind.
 -W

 2010/12/30 Benson Fung benson.red...@gmail.com:
  Hi,
 
  Can anyone know whether QA features can provide the rule conflict checks?
 
 
  Thanks
 
  ___
  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] QA features in BRMS

2010-12-30 Thread Benson Fung
The conflict is like :

E.g.
If (X = 90) then Score = 10;
If (X = 90) then Score = 100;

Can the BRMS detect this?



On Thu, Dec 30, 2010 at 5:52 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Please define conflict.
 -W

 2010/12/30 Benson Fung benson.f...@redhat.com:
  I would like to check if there is any conflict among the created rules in
  the BRMS 5.1.  Can the QA/Verify can check this out?
 
 
 
  On Thu, Dec 30, 2010 at 5:24 PM, Wolfgang Laun wolfgang.l...@gmail.com
  wrote:
 
  Please don't assume that everybody knows which features and
  which conflicts and which checks you have in mind.
  -W
 
  2010/12/30 Benson Fung benson.red...@gmail.com:
   Hi,
  
   Can anyone know whether QA features can provide the rule conflict
   checks?
  
  
   Thanks
  
   ___
   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
 
 
 
  --
  Benson Fung
  Solution Architect, Global Services, Greater China
  | Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
  Causeway Bay, Hong Kong || Office : 852-31802332 || Cell : 852-98369898
 ||
  benson.f...@redhat.com || http://www.hk.redhat.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] QA features in BRMS

2010-12-30 Thread Benson Fung
Yes, I tried QA analysis.  But it only can find out the problems of the
individual rules like what you said.  I tried to develop two rules with
sames conditions but different consequences and do the QA analysis, it
cannot detect it unfortunately.  :(




2010/12/30 Esteban Aliverti esteban.alive...@gmail.com

 I think QA analysis should find some of those problems. Did you try it? As
 far as I know, it looks for range completeness, missing gaps, etc.

 Best Regards,

 

 Esteban Aliverti
 - Developer @ http://www.plugtree.com
 - Blog @ http://ilesteban.wordpress.com


 2010/12/30 Wolfgang Laun wolfgang.l...@gmail.com

 The general case would be extremely difficult to solve. It would require
 heavy expression manipulation. Consider a very simple variation:
X($f: foo)
Y(bar == $f)
 as compared to
Y($b: bar)
X(foo == $b)

 And you can play this game at any level of complexity.

 And even your straightforward case would require the consideration of
 rule attributes, since there would not be a conflict if they are in
 different agenda groups, etc.


 -W



 2010/12/30 Benson Fung benson.red...@gmail.com:
  The conflict is like :
 
  E.g.
  If (X = 90) then Score = 10;
  If (X = 90) then Score = 100;
 
  Can the BRMS detect this?
 
 
 
  On Thu, Dec 30, 2010 at 5:52 PM, Wolfgang Laun wolfgang.l...@gmail.com
 
  wrote:
 
  Please define conflict.
  -W
 
  2010/12/30 Benson Fung benson.f...@redhat.com:
   I would like to check if there is any conflict among the created
 rules
   in
   the BRMS 5.1.  Can the QA/Verify can check this out?
  
  
  
   On Thu, Dec 30, 2010 at 5:24 PM, Wolfgang Laun 
 wolfgang.l...@gmail.com
   wrote:
  
   Please don't assume that everybody knows which features and
   which conflicts and which checks you have in mind.
   -W
  
   2010/12/30 Benson Fung benson.red...@gmail.com:
Hi,
   
Can anyone know whether QA features can provide the rule conflict
checks?
   
   
Thanks
   
___
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
  
  
  
   --
   Benson Fung
   Solution Architect, Global Services, Greater China
   | Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan
 Avenue,
   Causeway Bay, Hong Kong || Office : 852-31802332 || Cell :
 852-98369898
   ||
   benson.f...@redhat.com || http://www.hk.redhat.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
 
 


 ___
 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] Rule removal in BRMS 5.1/Drools Guvnor

2010-12-30 Thread Benson Fung
I am using BRMS 5.1.  Yes, I did try it.  I need to archive it first, and
then go to archive under Administration.  Choose the asset which I archived
before, then choose 'Delete selected assets'


Thank you very much

2010/12/30 Esteban Aliverti esteban.alive...@gmail.com

 Which version of Guvnor are you using? I think you have to archive it
 first.

 Best Regards,

 

 Esteban Aliverti
 - Developer @ http://www.plugtree.com
 - Blog @ http://ilesteban.wordpress.com


 2010/12/30 Benson Fung benson.red...@gmail.com

 Hi,

 I created a rule(Technical rule) in the BRMS.  But I would like to remove
 it now.  When I pull down the Action at the top right hand corner, the
 delete is greyed.  Please teach me how to remove the rule, otherwise, so
 many garbage rule will be accumulated in the BRMS.


 Thanks
 Benson

 ___
 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] QA features in BRMS

2010-12-30 Thread Benson Fung
Hi Esteban,

Could you elaborate with your wordings 'audit rules'?  I mean if there are
two rules with same conditions but different consequences within a package,
it could not be an error/warning as you said.  Could you give me an
example/typical situation?

Thanks for your explaination.



2010/12/30 Esteban Aliverti esteban.alive...@gmail.com

 This is because the scenario you are describing is not always an
 error/warning. Maybe for you it is an error, but for other people could be a
 typical situation. I.e: if you have audit rules.

 Best Regards,

 

 Esteban Aliverti
 - Developer @ http://www.plugtree.com
 - Blog @ http://ilesteban.wordpress.com


 2010/12/30 Benson Fung benson.red...@gmail.com

 Yes, I tried QA analysis.  But it only can find out the problems of the
 individual rules like what you said.  I tried to develop two rules with
 sames conditions but different consequences and do the QA analysis, it
 cannot detect it unfortunately.  :(




 2010/12/30 Esteban Aliverti esteban.alive...@gmail.com

 I think QA analysis should find some of those problems. Did you try it? As
 far as I know, it looks for range completeness, missing gaps, etc.

 Best Regards,

 

 Esteban Aliverti
 - Developer @ http://www.plugtree.com
 - Blog @ http://ilesteban.wordpress.com


 2010/12/30 Wolfgang Laun wolfgang.l...@gmail.com

 The general case would be extremely difficult to solve. It would require
 heavy expression manipulation. Consider a very simple variation:
X($f: foo)
Y(bar == $f)
 as compared to
Y($b: bar)
X(foo == $b)

 And you can play this game at any level of complexity.

 And even your straightforward case would require the consideration of
 rule attributes, since there would not be a conflict if they are in
 different agenda groups, etc.


 -W



 2010/12/30 Benson Fung benson.red...@gmail.com:
  The conflict is like :
 
  E.g.
  If (X = 90) then Score = 10;
  If (X = 90) then Score = 100;
 
  Can the BRMS detect this?
 
 
 
  On Thu, Dec 30, 2010 at 5:52 PM, Wolfgang Laun 
 wolfgang.l...@gmail.com
  wrote:
 
  Please define conflict.
  -W
 
  2010/12/30 Benson Fung benson.f...@redhat.com:
   I would like to check if there is any conflict among the created
 rules
   in
   the BRMS 5.1.  Can the QA/Verify can check this out?
  
  
  
   On Thu, Dec 30, 2010 at 5:24 PM, Wolfgang Laun 
 wolfgang.l...@gmail.com
   wrote:
  
   Please don't assume that everybody knows which features and
   which conflicts and which checks you have in mind.
   -W
  
   2010/12/30 Benson Fung benson.red...@gmail.com:
Hi,
   
Can anyone know whether QA features can provide the rule
 conflict
checks?
   
   
Thanks
   
___
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
  
  
  
   --
   Benson Fung
   Solution Architect, Global Services, Greater China
   | Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan
 Avenue,
   Causeway Bay, Hong Kong || Office : 852-31802332 || Cell :
 852-98369898
   ||
   benson.f...@redhat.com || http://www.hk.redhat.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
 
 


 ___
 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 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] QA features in BRMS

2010-12-30 Thread Benson Fung
Hi Mark,

Do you have example how to use the DroolsVerifier?  It is used at rule level
or at java level?



2010/12/31 Mark Proctor mproc...@codehaus.org

  On 30/12/2010 08:53, Benson Fung wrote:

 Hi,

 Can anyone know whether QA features can provide the rule conflict checks?

 http://community.jboss.org/wiki/DroolsVerifier

 Mark



 Thanks


 ___
 rules-users mailing 
 listrules-us...@lists.jboss.orghttps://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] Rule removal in BRMS 5.1/Drools Guvnor

2010-12-29 Thread Benson Fung
Hi,

I created a rule(Technical rule) in the BRMS.  But I would like to remove it
now.  When I pull down the Action at the top right hand corner, the delete
is greyed.  Please teach me how to remove the rule, otherwise, so many
garbage rule will be accumulated in the BRMS.


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


Re: [rules-users] BRMS 5.1 change-set.xml

2010-12-18 Thread Benson Fung
Yes, I tried to put the URL on the browser, and I am prompted to download
the PKG file without any problem.  So that is the thing I am wondering.

I am using Drools 5.0.2 version.


Thanks


2010/12/18 Michael Anstis michael.ans...@gmail.com

 Have you tried accessing the URL from a browser to confirm you are prompted
 for a username and password and that the credentials you show can be
 confirmed as valid?

 What version of Drools are you running client side too?

 2010/12/18 Benson Fung benson.red...@gmail.com

 Hi

 I am using the BRMS 5.1 with the following change-set.xml at the client
 side.

 change-set xmlns='http://drools.org/drools-5.0/change-set'
 xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
 xs:schemaLocation='http://drools.org/drools-5.0/change-set
 http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd'
 
 add
  resource source='
 http://192.168.11.8:8080/jboss-brms/org.drools.guvnor.Guvnor/package/axaDemoPackage/LATEST'
 type='PKG' basicAuthentication=enabled username=admin password=admin/
 /add
 /change-set


 Howerver, I still get the following exceptions.  Please help

 Caused by: java.io.IOException: Server returned HTTP response code: 401
 for URL:
 http://192.168.11.8:8080/jboss-brms/org.drools.guvnor.Guvnor/package/axaDemoPackage/LATEST
 at
 sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
 at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:76)
 at
 org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:407)
 ... 3 more


 Thanks
 ___
 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




-- 
Benson Fung
Solution Architect, Global Services, Greater China
| Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
Causeway Bay, Hong Kong || Office : 852-31802332 || Cell : 852-98369898 ||
benson.f...@redhat.com || http://www.hk.redhat.com||
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] BRMS 5.1 change-set.xml

2010-12-18 Thread Benson Fung
Yeah!  It works, Michael.   Thanks



2010/12/18 Michael Anstis michael.ans...@gmail.com

 AFAIK you'd need to run 5.1 against BRMS 5.1, as the code to handle sending
 authentication details wasn't introduced until 5.1...

 2010/12/18 Benson Fung benson.f...@redhat.com

 Yes, I tried to put the URL on the browser, and I am prompted to download
 the PKG file without any problem.  So that is the thing I am wondering.

 I am using Drools 5.0.2 version.


 Thanks


 2010/12/18 Michael Anstis michael.ans...@gmail.com

 Have you tried accessing the URL from a browser to confirm you are
 prompted for a username and password and that the credentials you show can
 be confirmed as valid?

 What version of Drools are you running client side too?

 2010/12/18 Benson Fung benson.red...@gmail.com

  Hi

 I am using the BRMS 5.1 with the following change-set.xml at the client
 side.

 change-set xmlns='http://drools.org/drools-5.0/change-set'
 xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
 xs:schemaLocation='http://drools.org/drools-5.0/change-set
 http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd'
 
 add
  resource source='
 http://192.168.11.8:8080/jboss-brms/org.drools.guvnor.Guvnor/package/axaDemoPackage/LATEST'
 type='PKG' basicAuthentication=enabled username=admin 
 password=admin/
 /add
 /change-set


 Howerver, I still get the following exceptions.  Please help

 Caused by: java.io.IOException: Server returned HTTP response code: 401
 for URL:
 http://192.168.11.8:8080/jboss-brms/org.drools.guvnor.Guvnor/package/axaDemoPackage/LATEST
 at
 sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
 at
 org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:76)
 at
 org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:407)
 ... 3 more


 Thanks
 ___
 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




 --
 Benson Fung
 Solution Architect, Global Services, Greater China
 | Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
 Causeway Bay, Hong Kong || Office : 852-31802332 || Cell : 852-98369898 ||
 benson.f...@redhat.com || http://www.hk.redhat.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




-- 
Benson Fung
Solution Architect, Global Services, Greater China
| Redhat Hong Kong Limited || 45/F., The Lee Gardens, 33 Hysan Avenue,
Causeway Bay, Hong Kong || Office : 852-31802332 || Cell : 852-98369898 ||
benson.f...@redhat.com || http://www.hk.redhat.com||
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] BRMS 5.1 change-set.xml

2010-12-17 Thread Benson Fung
Hi

I am using the BRMS 5.1 with the following change-set.xml at the client
side.

change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd'

add
 resource source='
http://192.168.11.8:8080/jboss-brms/org.drools.guvnor.Guvnor/package/axaDemoPackage/LATEST'
type='PKG' basicAuthentication=enabled username=admin password=admin/
/add
/change-set


Howerver, I still get the following exceptions.  Please help

Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL:
http://192.168.11.8:8080/jboss-brms/org.drools.guvnor.Guvnor/package/axaDemoPackage/LATEST
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:76)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:407)
... 3 more


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