Order of firing rules
by Rajesh.Sachin10
Hi,
I asserted 4 objects of a class with class name “DemoClass” in to
working memory. In rule one I am creating a reference for the DemoClass and
implementing the logic.
In rule2,… I am creating another reference of the DemoClass .so that time it
is accessing the next asserted object present in the workingmemory. But my
requirement is to access the same object which is accessed in rule 1. I
don't need to access other 3 objects in working memory.
It is possible to access the same object in rule 2, which I accessed in
rule 1?
--
View this message in context: http://www.nabble.com/Order-of-firing-rules-tf3865719.html#a10951337
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 5 months
compiler problems
by Guillermo Arias del Rio
Hi Mark,
I don't know what you mean with that. Do you mean that I don't have the
Janino libraries? I put them all, but JBoss still gets the old compiler...
Is there a way to know exactly what's happening? The methods setCompiler
and addPackageFromDrl don't complain about JANINO, but ignore it.
-----------
You don't have all he necessary dependencies in your classpath.
Mark
Guillermo Arias del Rio wrote:
>/ Hi all,
/>/
/>/ I am new to JBoss. I just finished making my first program with Rules and it
/>/ works fine, but when I try to integrate all that into my web application
/>/ (using Jetty), I get the following error:
/>/
/>/ [java] java.lang.NoSuchMethodError:
/>/ org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()
/>/ [Lorg/eclipse/jdt/core/compiler/IProblem;
/>/ [java] at
/>/ org.apache.jasper.compiler.JDTCompiler$2.acceptResult(JDTCompiler.java:341)
/>/ [java] at
/>/ org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417)
/>/ ...
/>/
/>/ I tried to fix the problem with:
/>/
/>/ conf = new PackageBuilderConfiguration();
/>/ conf.setCompiler(PackageBuilderConfiguration.JANINO);
/>/
/>/ ...
/>/
/>/ PackageBuilder builder = new PackageBuilder(conf);
/>/ builder.addPackageFromDrl(new StringReader(rule.getText()));
/>/ ruleBase.addPackage(builder.getPackage());
/>/
/>/ as in
/>/ http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesTomcat
/>/
/>/ but it's not working either. Same message.
/>/
/>/ Can you help me?
/>/
/>/ Thanks
/>/
/>/ G. Arias del RIo
/>/ _______________________________________________
/>/ rules-users mailing list
/>/ rules-users at lists.jboss.org <https://lists.jboss.org/mailman/listinfo/rules-users>
/>/ https://lists.jboss.org/mailman/listinfo/rules-users
/>/
/>/
/
17 years, 5 months
Localization in DSL
by ps-wakisaka
Hi.
I'd like to use Japanese in DSL.
Is it possible?
Or, Do you have a plan to do the localize-stuff with DSL syntax?
( great BRMS stuff,as well )
Thanks in advance.
Shige
17 years, 5 months
Wading through the Drools knowledge waters
by Anup Joshi
Greetings:
I am a graduate student working on rules based systems in design. I had a
very fundamental (theoretical) question
on rules usage and would appreciate if you could be so kind as to help.
Consider a hypothetical university application that has the following
objects:
GradStudent
GradStudentRecord (which contains details such as GPA etc.)
GIven the above(and based on the drools docs I have read so far)
I can write a rule as:
when GradStudent.Record.GPA > 3 then student.standing = good
So far everything is okay.
Now consider the case where the University decides to have PhD Students.
Note that there are no PhDStudent objects in the application yet but
I wish to have a rule such as:
when PhDStudentRecord.GPA > 3.5 then student.standing = good
Does the above scenario mean that I would have to code the application
and add an extra PhDStudent object before I can write a rule ?
In other words, is the following proposition true?
Proposition: if there are N objects in an application, and I wish to use
JBoss rules then the rule can be written only "in terms" of the N objects.
If there is a rule to be written for a new (K+1)th object, I would have to
first code
that new object in the application and then write the rule.
I would appreciate if anyone could validate my thoughts above.
Sincerely,
Anup
GradStudent
Michigan Tech.
17 years, 5 months
Relative Newbie Eclipse Problems
by J Michael Dean
I am trying to incorporate JBoss Rules into an existing RCP. I have
tried to follow directions. First, I have installed the plugin and
can recreate a rules project, and can run the demo rules project. My
problem is adding this to my existing RCP. I have tried to follow
information on the Wiki, so here are my .classpath and .project
files, followed by the errors that are logged when I try to open a
rules file. Sorry for the length of the post:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>edu.utah.cdmcc.decisionsupport.glucose</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.hibernate.eclipse.console.hibernateBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.hyades.test.tools.core.java.junit.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.drools.ide.droolsbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.hibernate.eclipse.console.hibernateNature</nature>
<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="tests"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="DROOLS/JBoss Rules"/>
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
When I create a simple rule resource using the wizard, I get errors:
!ENTRY org.eclipse.ui.workbench 4 2 2007-06-02 17:54:21.688
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationFile
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationURL
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassLoader
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.generateParsedResource
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.parseResource(Unknown Source)
at
org.drools.eclipse.editors.outline.RuleContentOutlinePage.initRules
(Unknown Source)
at org.drools.eclipse.editors.outline.RuleContentOutlinePage.update
(Unknown Source)
at
org.drools.eclipse.editors.outline.RuleContentOutlinePage.createControl(
Unknown Source)
at org.eclipse.ui.views.contentoutline.ContentOutline.doCreatePage
(ContentOutline.java:134)
at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:399)
at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:
743)
at
org.eclipse.ui.views.contentoutline.ContentOutline.partBroughtToTop
(ContentOutline.java:209)
at org.eclipse.ui.internal.PartListenerList$2.run
(PartListenerList.java:87)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.PartListenerList.fireEvent
(PartListenerList.java:57)
at org.eclipse.ui.internal.PartListenerList.firePartBroughtToTop
(PartListenerList.java:85)
at org.eclipse.ui.internal.PartService.firePartBroughtToTop
(PartService.java:87)
at org.eclipse.ui.internal.WorkbenchPagePartList.firePartBroughtToTop
(WorkbenchPagePartList.java:75)
at
org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEditorChanged
(WorkbenchPagePartList.java:51)
at org.eclipse.ui.internal.PartList.setActiveEditor(PartList.java:152)
at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor
(WorkbenchPage.java:1181)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart
(WorkbenchPage.java:3200)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:
588)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched
(WorkbenchPage.java:2604)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10
(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2500)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2485)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
at
org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.internalOpenEdi
tor(ResourceUiBridge.java:68)
at org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.open
(ResourceUiBridge.java:50)
at
org.eclipse.mylar.internal.resources.ui.ContextEditorManager.contextActi
vated(ContextEditorManager.java:72)
at
org.eclipse.mylar.internal.context.core.MylarContextManager.activateCont
ext(MylarContextManager.java:448)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$1.taskActivated
(TasksUiPlugin.java:203)
at org.eclipse.mylar.tasks.ui.TaskListManager.activateTask
(TaskListManager.java:634)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$7.run(TasksUiPlugin.java:
411)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2944)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplicat
ion(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
!ENTRY csdl.jupiter 1 0 2007-06-02 17:54:24.380
!MESSAGE Jupiter Review Plugin is up.
!ENTRY org.eclipse.ui.workbench 4 2 2007-06-02 17:54:25.215
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationFile
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationURL
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassLoader
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.generateParsedResource
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.parseResource(Unknown Source)
at
org.drools.eclipse.editors.outline.RuleContentOutlinePage.initRules
(Unknown Source)
at org.drools.eclipse.editors.outline.RuleContentOutlinePage.update
(Unknown Source)
at
org.drools.eclipse.editors.outline.RuleContentOutlinePage.createControl(
Unknown Source)
at org.eclipse.ui.views.contentoutline.ContentOutline.doCreatePage
(ContentOutline.java:134)
at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:399)
at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:
743)
at org.eclipse.ui.internal.PartListenerList$1.run
(PartListenerList.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.PartListenerList.fireEvent
(PartListenerList.java:57)
at org.eclipse.ui.internal.PartListenerList.firePartActivated
(PartListenerList.java:70)
at org.eclipse.ui.internal.PartService.firePartActivated
(PartService.java:73)
at org.eclipse.ui.internal.PartService.setActivePart
(PartService.java:171)
at
org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged
(WorkbenchPagePartList.java:56)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:126)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart
(WorkbenchPage.java:3207)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:
588)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched
(WorkbenchPage.java:2604)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10
(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2500)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2485)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
at
org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.internalOpenEdi
tor(ResourceUiBridge.java:68)
at org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.open
(ResourceUiBridge.java:50)
at
org.eclipse.mylar.internal.resources.ui.ContextEditorManager.contextActi
vated(ContextEditorManager.java:72)
at
org.eclipse.mylar.internal.context.core.MylarContextManager.activateCont
ext(MylarContextManager.java:448)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$1.taskActivated
(TasksUiPlugin.java:203)
at org.eclipse.mylar.tasks.ui.TaskListManager.activateTask
(TaskListManager.java:634)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$7.run(TasksUiPlugin.java:
411)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2944)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplicat
ion(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
!ENTRY org.drools.eclipse 4 120 2007-06-02 17:54:25.531
!MESSAGE Internal error in Drools Plugin:
!STACK 0
java.lang.NullPointerException
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationFile
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationURL
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassLoader
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.generateParsedResource
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.generateParsedResource
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.parseResource(Unknown Source)
at
org.drools.eclipse.editors.DroolsLineBreakpointAdapter.canToggleLineBrea
kpoints(Unknown Source)
at
org.eclipse.debug.internal.ui.actions.breakpoints.RetargetToggleLineBrea
kpointAction.canPerformAction(RetargetToggleLineBreakpointAction.java:
36)
at org.eclipse.debug.internal.ui.actions.RetargetAction$1.run
(RetargetAction.java:204)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2944)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:322)
at org.eclipse.jface.util.SafeRunnable.handleException
(SafeRunnable.java:60)
at org.eclipse.core.runtime.SafeRunner.handleException
(SafeRunner.java:68)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.PartListenerList.fireEvent
(PartListenerList.java:57)
at org.eclipse.ui.internal.PartListenerList.firePartActivated
(PartListenerList.java:70)
at org.eclipse.ui.internal.PartService.firePartActivated
(PartService.java:73)
at org.eclipse.ui.internal.PartService.setActivePart
(PartService.java:171)
at
org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged
(WorkbenchPagePartList.java:56)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:126)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart
(WorkbenchPage.java:3207)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:
588)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched
(WorkbenchPage.java:2604)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10
(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2500)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2485)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
at
org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.internalOpenEdi
tor(ResourceUiBridge.java:68)
at org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.open
(ResourceUiBridge.java:50)
at
org.eclipse.mylar.internal.resources.ui.ContextEditorManager.contextActi
vated(ContextEditorManager.java:72)
at
org.eclipse.mylar.internal.context.core.MylarContextManager.activateCont
ext(MylarContextManager.java:448)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$1.taskActivated
(TasksUiPlugin.java:203)
at org.eclipse.mylar.tasks.ui.TaskListManager.activateTask
(TaskListManager.java:634)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$7.run(TasksUiPlugin.java:
411)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2944)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplicat
ion(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
!ENTRY org.drools.eclipse 4 120 2007-06-02 17:54:25.552
!MESSAGE Internal error in Drools Plugin:
!STACK 0
java.lang.NullPointerException
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationFile
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getRawLocationURL
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassPathURLs
(Unknown Source)
at org.drools.eclipse.util.ProjectClassLoader.getProjectClassLoader
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.generateParsedResource
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.generateParsedResource
(Unknown Source)
at org.drools.eclipse.DroolsEclipsePlugin.parseResource(Unknown Source)
at
org.drools.eclipse.editors.DroolsLineBreakpointAdapter.canToggleLineBrea
kpoints(Unknown Source)
at
org.eclipse.debug.internal.ui.actions.breakpoints.RetargetToggleLineBrea
kpointAction.canPerformAction(RetargetToggleLineBreakpointAction.java:
36)
at org.eclipse.debug.internal.ui.actions.RetargetAction$1.run
(RetargetAction.java:204)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2944)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:322)
at org.eclipse.jface.util.SafeRunnable.handleException
(SafeRunnable.java:60)
at org.eclipse.core.runtime.SafeRunner.handleException
(SafeRunner.java:68)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.PartListenerList.fireEvent
(PartListenerList.java:57)
at org.eclipse.ui.internal.PartListenerList.firePartActivated
(PartListenerList.java:70)
at org.eclipse.ui.internal.PartService.firePartActivated
(PartService.java:73)
at org.eclipse.ui.internal.PartService.setActivePart
(PartService.java:171)
at
org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged
(WorkbenchPagePartList.java:56)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:126)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart
(WorkbenchPage.java:3207)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:
588)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched
(WorkbenchPage.java:2604)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor
(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10
(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2500)
at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:2485)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
at
org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.internalOpenEdi
tor(ResourceUiBridge.java:68)
at org.eclipse.mylar.internal.resources.ui.ResourceUiBridge.open
(ResourceUiBridge.java:50)
at
org.eclipse.mylar.internal.resources.ui.ContextEditorManager.contextActi
vated(ContextEditorManager.java:72)
at
org.eclipse.mylar.internal.context.core.MylarContextManager.activateCont
ext(MylarContextManager.java:448)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$1.taskActivated
(TasksUiPlugin.java:203)
at org.eclipse.mylar.tasks.ui.TaskListManager.activateTask
(TaskListManager.java:634)
at org.eclipse.mylar.tasks.ui.TasksUiPlugin$7.run(TasksUiPlugin.java:
411)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2944)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplicat
ion(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
17 years, 5 months
Tutorial?
by Dou Hu
New to this maling list.
Any tutorial for
1. Deploy JBoss Rules to JBoss AS?
2. Start Web Based Visual Rule Editor.
3. Define a DSL.
4. Create rules.
5. Sample code to invoke rules.
Not have to be very detail. Just hight level steps are ok.
Thanks!
17 years, 5 months
Loading a precompiled binary package from BRMS [Re: Help Needed]
by Fernando Meyer
Hi Rajesh,
You can use the org.drools.util.BinaryRuleBaseLoader to load a
precompiled binary package into your classes.
public void testLoadAndExecBinary() throws Exception {
Person p = new Person();
BinaryRuleBaseLoader loader = new BinaryRuleBaseLoader();
loader.addPackage( this.getClass().getResourceAsStream( "/
RepoBinPackage.pkg" ) );
RuleBase rb = loader.getRuleBase();
StatelessSession sess = rb.newStatelessSession();
sess.execute( p );
assertEquals(42, p.getAge());
}
ps: next time use the Rules Users maillist rules-users(a)lists.jboss.org
Fernando Meyer
fmcamargo(a)gmail.com
GPG: 5A6D 3374 B055 A513 9A02 A03B 3DB3 7485 D804 DDFB
On Jun 1, 2007, at 3:20 AM, Rajesh_Kumar wrote:
>
> hi ,
>
> First of all congratulations to you for JBRMS release.
>
> You and your team has done a great job.
>
>
> I am facing some issue , when I use jbrms.
>
> I have written a sample technical rule by following all the steps
> as mentioned in the document.
>
> I am able to download binary package also,but when I tried to use
> this package in my rule engine class using following code it’s
> giving some error like …
>
>
>
> FileInputStream fis = new FileInputStream( "C:/drools/
> TestPackage.pkg" );
>
> ObjectInputStream ois = new ObjectInputStream( fis );
>
> Object objPackage = ois.readObject() ;
>
>
> when ObjectInputStream object tries to read the object , its
> giving some an error
>
> ois.close();
>
> fis.close();
>
> Could you please help me out for this …
>
> java.io.InvalidClassException: org.drools.rule.Rule; incompatible
> types for field salience
>
> at java.io.ObjectStreamClass.matchFields(Unknown Source)
>
> at java.io.ObjectStreamClass.getReflector(Unknown Source)
>
> at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
>
> at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
>
> at java.io.ObjectInputStream.readClassDesc(Unknown Source)
>
> at java.io.ObjectInputStream.readOrdinaryObject(Unknown
> Source)
>
> at java.io.ObjectInputStream.readObject0(Unknown Source)
>
> at java.io.ObjectInputStream.readObject(Unknown Source)
>
> at java.util.HashMap.readObject(Unknown Source)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
>
> at java.io.ObjectInputStream.readSerialData(Unknown Source)
>
> at java.io.ObjectInputStream.readOrdinaryObject(Unknown
> Source)
>
> at java.io.ObjectInputStream.readObject0(Unknown Source)
>
> at java.io.ObjectInputStream.readObject(Unknown Source)
>
> at org.drools.rule.PackageCompilationData.readExternal
> (PackageCompilationData.java:128)
>
> at java.io.ObjectInputStream.readExternalData(Unknown Source)
>
> at java.io.ObjectInputStream.readOrdinaryObject(Unknown
> Source)
>
> at java.io.ObjectInputStream.readObject0(Unknown Source)
>
> at java.io.ObjectInputStream.readObject(Unknown Source)
>
> at org.drools.rule.Package.readExternal(Package.java:160)
>
> at java.io.ObjectInputStream.readExternalData(Unknown Source)
>
> at java.io.ObjectInputStream.readOrdinaryObject(Unknown
> Source)
>
> at java.io.ObjectInputStream.readObject0(Unknown Source)
>
> at java.io.ObjectInputStream.readObject(Unknown Source)
>
> at com.sample.DroolsTest.readRule(DroolsTest.java:36)
>
> at com.sample.DroolsTest.main(DroolsTest.java:17)
>
>
17 years, 5 months
Re: Usage of 'exists' keyword to get the number of occurance?
by Edson Tirelli
Yes, the "from collect" is new to 4.0.
If you are using 3.0.6, you must use 2 rules and a helper class to do the
count:
rule "counting"
salience 10
when
$counter : Counter()
Student( name == "Drools" )
then
$counter.setValue( $counter.getValue() + 1 );
end
rule "Total instances"
when
$counter : Counter( )
then
System.out.println( "Total instances = "+$counter.getValue() );
end
Please not the higher salience value in the first rule. Also, remember to
assert all your objects into the working memory, not only the list.
The Counter class is a simple java bean to help you do the count.
Hope it helps.
[]s
Edson
2007/6/1, rajesh_sachin10(a)yahoo.co.in <rajesh_sachin10(a)yahoo.co.in>:
>
> Hi
> I'm working on Drools 3.06. I am not able to decipher the drl snippet you
> have posted.
> I'am not clear about the <b>'from collect'</b> Keywords. My problem
> statement is to get the number of
> occurance of a Student(Name =="Drools") in a collection.
>
> Please find below a small java snippet which is equivalent to what I'm
> tring to do.
>
> int count = 0;
> List<Student> nameList = getListofNames();
> while(nameList.iterator().hasNext())
> {
> Student student = (Student)nameList.iterator().next();
> if(Student.getName.equals("Drools"))
> {
> count++;
> }
> }
> System.out.println("Occurance Count" + count);
>
>
> Edson Tirelli-3 wrote:
> >
> > Nope, if you want actual instances you must use "collect":
> >
> > when
> > context : Context(state == Context:START_UP)
> > list : ArrayList( size > 0 ) from collect( ClassName(varName =="value"
> )
> > )
> > then
> > // list has your matching ClassName objects
> > end
> >
> > []s
> > Edson
> >
> >
> >
> > 2007/6/1, Rajesh.Sachin10 <rajesh_sachin10(a)yahoo.co.in>:
> >>
> >>
> >> Its possible to use 'exists' keyword to get the number of occurance?
> >>
> >> Eg:
> >>
> >> context : Context(state == Context:START_UP) exists ClassName(varName
> ==
> >> "value")
> >>
> >>
> >> The ClassName is an Object array..... So to get the number of occurance
> >> of
> >> the "value" in varName, we have any method or keywords?
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Usage-of-%27exists%27-keyword-to-get-the-number-of-...
> >> Sent from the drools - user mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users(a)lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> >
> >
> > --
> > Edson Tirelli
> > Software Engineer - JBoss Rules Core Developer
> > Office: +55 11 3529-6000
> > Mobile: +55 11 9287-5646
> > JBoss, a division of Red Hat @ www.jboss.com
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> Quoted from:
>
> http://www.nabble.com/Usage-of-%27exists%27-keyword-to-get-the-number-of-...
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
17 years, 5 months
Use of Relational operator in Drools
by Rajesh.Sachin10
How to check a variable in a class contains any of the four or five value. I
tried the below codes, but it throws error.
Codes
context : Context(state == Context.START_UP) exists Classname(varName
: "1" || "2" || "3")
context : Context(state == Context.START_UP) exists
Classname(varName : "1" || varName : "2" || varName : "3")
There is anyother alternate way to check this condition?
--
View this message in context: http://www.nabble.com/Use-of-Relational-operator-in-Drools-tf3851675.html...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 5 months