Re: [rules-users] CompositiveClassLoader$CachingLoader$load method intermittently hangs

2014-05-15 Thread Steven Williams
We are also experiencing the same problems using 5.x and it is causing us
big problems.

I haven't had time to try it yet but do any developers know whether we
would be safe to change the HashMap the CompositiveClassLoader is using to
a ConcurrentHashMap?

thanks
Steve

---
Steven Williams



On Wed, Mar 19, 2014 at 12:31 AM, mikerod  wrote:

> I cannot easily reproduce an issue that I'm seeing.  This is an
> intermittent
> issue that happens probably 3% of the time or less.
>
> This is observed behavior in
> * Drools v5.6.0.Final, using
> * Janino compiler v2.5.16 && transitively Drools brings
> * mvel2 v2.1.8.Final
>
> We have an environment that loads around 10 different KnowledgeBases into a
> list.
> Then one-by-one a single StatefulKnowledgeSession is created for a single
> KnowledgeBase, facts are inserted, and then fireAllRules is called.
>
> Every so often, we noticed that we were getting what seemed to be ininite
> looping behavior for during either insertion time or fireAllRules time.
> When we subsequently re-run the *same* session with the *same*
> KnowledgeBase
> and the *same* facts inserted, it was successful and finished in
> milliseconds (the average for our successful runs).  We have repeatedly
> seen
> this behavior of 1 failure, followed by a re-run that is successful.
>
> We were able to attach a profiler to several of these hung sessions to
> determine what was happening.  It turns out that in both the scenario where
> we saw a hang up on fact insertion and on fireAllRules call, the thread
> dump
> was the same.
>
> The stack looks like:
> ```
> "main" - Thread t@1
>java.lang.Thread.State: RUNNABLE
>  at java.util.HashMap.getEntry(HashMap.java:347)
>  at java.util.HashMap.containsKey(HashMap.java:335)
>  at
>
> org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:244)
>  at
>
> org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:237)
>  at
>
> org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:88)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>  at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(Class.java:247)
>  at
>
> org.mvel2.ParserConfiguration.checkForDynamicImport(ParserConfiguration.java:163)
>  at
> org.mvel2.ParserConfiguration.hasImport(ParserConfiguration.java:191)
>  at org.mvel2.ParserContext.hasImport(ParserContext.java:360)
>  at org.mvel2.ParserContext.isVariableVisible(ParserContext.java:715)
>  at
> org.mvel2.compiler.ExpressionCompiler.verify(ExpressionCompiler.java:394)
>  at
> org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:250)
>  at
> org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
>  at org.mvel2.MVEL.compileExpression(MVEL.java:810)
>  at
>
> org.drools.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:417)
>  at
>
> org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:238)
>  at
>
> org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:224)
>  at
> org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:208)
>  at
>
> org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:175)
>  at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:133)
>  at
>
> org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
>  at
>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
>  at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:302)
>  at
> org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:254)
>  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:366)
>  at
> org.drools.common.SimpleBeliefSystem.insert(SimpleBeliefSystem.java:38)
>  at
>
> org.drools.common.TruthMaintenanceSystem.addLogicalDependency(TruthMaintenanceSystem.java:207)
>  at
>
> org.drools.common.TruthMaintenanceSystem.addLogicalDependency(TruthMaintenanceSystem.java:179)
>  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:247)
>  at
>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:950)
>  at
>
> org.drools.base.DefaultKnowledgeHelper.insertLogical(DefaultKnowledgeHelper.java:263)
>  at
>
> org.drools.base.DefaultKnowledgeHelper.insertLogical(DefaultKnowledgeHelper.java:228)
>  at

Re: [rules-users] Jetty NoSuchMethodError Lorg/eclipse/jdt/core/compiler/CategorizedProblem

2013-11-26 Thread Steven Williams
I noticed this same error when attempting to use the Run Jetty Run eclipse
plugin with Jetty 6.1.26. Changing it to use Jetty 7.5.1 fixed the problem.
We still use version 6 on our test servers without a problem though so I
just put it down to some classpath issue with the plug-in.

---
Steven Williams



On Wed, Nov 27, 2013 at 3:01 AM, captainrhino <
graeme.kitc...@axa-travel-insurance.com> wrote:

>
> I am running some drools application code through Jetty and I get the
> following error.  I'm guessing its something to do with a conflicting jar
> or
> dependency?  Any help would be much appreciated.  It does not happen when I
> run it through tomcat 7.
>
> java.lang.NoSuchMethodError:
>
> org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
> at
>
> org.drools.compiler.commons.jci.compilers.EclipseJavaCompiler$3.acceptResult(EclipseJavaCompiler.java:375)
> at
> org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:335)
> at
>
> org.drools.compiler.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:405)
> at
>
> org.drools.compiler.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
> at
>
> org.drools.compiler.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:405)
> at
>
> org.drools.compiler.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:46)
> at
>
> org.drools.compiler.compiler.PackageRegistry.compileAll(PackageRegistry.java:107)
> at
>
> org.drools.compiler.compiler.PackageBuilder.compileAll(PackageBuilder.java:1218)
> at
>
> org.drools.compiler.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:955)
> at
>
> org.drools.compiler.compiler.PackageBuilder.addPackage(PackageBuilder.java:943)
> at
>
> org.drools.compiler.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:507)
> at
>
> org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:714)
> at
>
> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
> at
>
> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Jetty-NoSuchMethodError-Lorg-eclipse-jdt-core-compiler-CategorizedProblem-tp4026946.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] How to use type-safe enums in rule condition

2013-11-13 Thread Steven Williams
We use drools for validation rules in our application. Some of these rules
are dependent on which CRUD operation is being performed at the time, so as
part of our validation aspect we insert a CrudMode enum with the current
action (by annotating the advised method). e.g.

@Validate(validators = BusinessRulesValidator.class, mode = CREATE)
public void create(@DTO SomeDTO incomingDto)

In our rules we can then go:

CrudMode(this == CrudMode.CREATE)

The second way we use it (and this one I don't like so much) is that our
validation aspect runs both before and after a method (PRE and POST). We
use an agenda-group to to indicate which phase a rule should be included
which works fine, however we were finding that some conditions were
relatively expensive which had performance implications. Our solution was
to also include a ValidationPhase enum as a fact and use that to
short-circuit the rules. I reckon there is probably a better way to achieve
this however we didn't spend a lot of time thinking about it.

cheers
Steve

-------
Steven Williams



On Thu, Nov 14, 2013 at 12:40 AM, Wolfgang Laun wrote:

> Just curiosity.
>
> On 13/11/2013, Steven Williams  wrote:
> > I use something like the following in rules to good effect:
> >
> > Country( this == Country.USA )
>
> Granted, you can add any number of attributes to an enum so that it's
> just another way of writing a static set of bean objects. But is there
> a "good effect" to be had from a pattern that merely ascertains the
> presence of an enum instance
> in the Working Memory?
>
> Other than this, a pattern like
>City( country == Country.USA )
> doesn't require the insertion of the Country enums.
>
> Cheers
> Wolfgang
> ___
> 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 use type-safe enums in rule condition

2013-11-12 Thread Steven Williams
I use something like the following in rules to good effect:

Country( this == Country.USA )

---
Steven Williams



On Wed, Nov 13, 2013 at 12:20 AM, droolster  wrote:

> Thanks Steve for the advice and code! Awesome.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-use-type-safe-enums-in-rule-condition-tp4026739p4026745.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Classloading error with AspectJ and Drools 5.2.0.Final

2011-09-07 Thread Steven Williams
FYI - https://issues.jboss.org/browse/JBRULES-3122 was raised for this.

cheers
Steve

2011/8/31 Wolfgang Laun 

> This should be fixed by now on the way to 5.3.0, returning an empty
> collection -  I've seen a confirming email from Mark Proctor.
> -W
>
>
> On 30 August 2011 13:27, Sammi  wrote:
>
>> We got exactly the same issue, but I think it could just return empty
>> enumeration rather than null?
>>
>> Cited from the javadoc *Enumberation getResources(String name)*
>> /An enumeration of URL objects for the resource. If no resources could be
>> found, the enumeration will be empty. Resources that the class loader
>> doesn't have access to will not be in the enumeration./
>>
>> stevearoonie wrote:
>> >
>> > Clarification to this - it does also happen when we run our server. So
>> > this
>> > is preventing us from upgrading to 5.2
>> >
>> > My guess is that getResources should return getParent().getResources()
>> > rather than null.
>> >
>> > regards
>> > Steve
>> >
>> >
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/rules-users-Classloading-error-with-AspectJ-and-Drools-5-2-0-Final-tp3143394p3295236.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Classloading error with AspectJ and Drools 5.2.0.Final

2011-07-05 Thread Steven Williams
Clarification to this - it does also happen when we run our server. So this
is preventing us from upgrading to 5.2

My guess is that getResources should return getParent().getResources()
rather than null.

regards
Steve

On Wed, Jul 6, 2011 at 1:42 PM, Steven Williams wrote:

> Hi,
>
> I have just upgraded to Drools 5.2.0.Final and am getting a weird error
> when running unit tests.
>
> java.lang.NullPointerException
>
> at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
> ClassLoaderWeavingAdaptor.java:251)
>
> at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
> DefaultWeavingContext.java:130)
>
> at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
> ClassLoaderWeavingAdaptor.java:161)
>
> at
> org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
> Aj.java:271)
>
> at
> org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
> Aj.java:276)
>
> at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)
>
> at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)
>
> at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
> ClassPreProcessorAgentAdapter.java:54)
>
> at sun.instrument.TransformerManager.transform(TransformerManager.java:169
> )
>
> at sun.instrument.InstrumentationImpl.transform(
> InstrumentationImpl.java:365)
>
> at java.lang.ClassLoader.defineClass1(Native Method)
>
> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
>
> at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
>
> at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
> JavaDialectRuntimeData.java:570)
>
> at org.drools.util.CompositeClassLoader$CachingLoader.load(
> CompositeClassLoader.java:258)
>
> at org.drools.util.CompositeClassLoader$CachingLoader.load(
> CompositeClassLoader.java:241)
>
> at org.drools.util.CompositeClassLoader.loadClass(
> CompositeClassLoader.java:88)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>
> at org.drools.rule.JavaDialectRuntimeData.wire(
> JavaDialectRuntimeData.java:405)
>
> at org.drools.rule.JavaDialectRuntimeData.wire(
> JavaDialectRuntimeData.java:396)
>
> at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
> JavaDialectRuntimeData.java:237)
>
> at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
> DialectRuntimeRegistry.java:132)
>
> at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)
>
> at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)
>
> at org.drools.compiler.PackageBuilder.addPackageFromDrl(
> PackageBuilder.java:360)
>
> at org.drools.compiler.PackageBuilder.addKnowledgeResource(
> PackageBuilder.java:538)
>
> at org.drools.builder.impl.KnowledgeBuilderImpl.add(
> KnowledgeBuilderImpl.java:28)
>
> at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
> KnowledgeBaseBuilder.java:108)
>
> at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
> KnowledgeBaseBuilder.java:69)
>
> at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
> KnowledgeBaseBuilder.java:54)
>
>
> I have traced the problem to org.drools.rule.
> JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
> whereas AspectJ expects it to at least return an empty enumeration - hence
> the NPE. Interestingly the problem does not occur when running our server,
> however we can't upgrade unless our unit tests pass and we can't easily turn
> off aspectj for these.
>
> regards
> Steve
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Classloading error with AspectJ and Drools 5.2.0.Final

2011-07-05 Thread Steven Williams
Hi,

I have just upgraded to Drools 5.2.0.Final and am getting a weird error when
running unit tests.

   java.lang.NullPointerException

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
ClassLoaderWeavingAdaptor.java:251)

at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
DefaultWeavingContext.java:130)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
ClassLoaderWeavingAdaptor.java:161)

at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
Aj.java:271)

at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
Aj.java:276)

at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)

at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)

at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
ClassPreProcessorAgentAdapter.java:54)

at sun.instrument.TransformerManager.transform(TransformerManager.java:169)

at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365
)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
JavaDialectRuntimeData.java:570)

at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:258)

at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:241)

at org.drools.util.CompositeClassLoader.loadClass(
CompositeClassLoader.java:88)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:405)

at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:396)

at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
JavaDialectRuntimeData.java:237)

at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
DialectRuntimeRegistry.java:132)

at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)

at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)

at org.drools.compiler.PackageBuilder.addPackageFromDrl(
PackageBuilder.java:360)

at org.drools.compiler.PackageBuilder.addKnowledgeResource(
PackageBuilder.java:538)

at org.drools.builder.impl.KnowledgeBuilderImpl.add(
KnowledgeBuilderImpl.java:28)

at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
KnowledgeBaseBuilder.java:108)

at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:69)

at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:54)


I have traced the problem to org.drools.rule.
JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
whereas AspectJ expects it to at least return an empty enumeration - hence
the NPE. Interestingly the problem does not occur when running our server,
however we can't upgrade unless our unit tests pass and we can't easily turn
off aspectj for these.

regards
Steve
___
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-30 Thread Steven Williams
Java 1.6, Drools 5.1.1


On Fri, Apr 29, 2011 at 7:46 PM, Benson Fung wrote:

> What version of jdk and Drools plugin are you using?
>
> 2011/4/29 Steven Williams :
> > 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)

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

2011-04-29 Thread Steven Williams
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 org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
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:

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

2011-03-31 Thread Steven Williams
I have actually used this method for the one valid case I have thought of -
unit testing rules.

Steve


2011/4/1 Swindells, Thomas 

>  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 
>
>
>
> On 31 March 2011 07:58, Benson Fung  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] Configure custom SystemEventListener via Drools Spring

2011-03-23 Thread Steven Williams
Hi,

I have just started using the drools-spring integration (5.1.1) and I would
to use my own SystemEventListener instead of the default
PrintStreamSystemEventListener however I am not sure if it is possible or
how to configure it.

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


Re: [rules-users] KnowledgeAgent Issue

2011-03-21 Thread Steven Williams
I'm not sure whether they were added or not. I noticed the rules weren't
running when I expected them to though, so perhaps not. I have worked around
it by putting all my rules in the same package - luckily I only had about 30
different rule files, but it is a less than ideal solution.

Once I have everything working and checked in on my project I'll test
further to see what is going on.

Steve

On Tue, Mar 22, 2011 at 2:43 PM, Esteban Aliverti <
esteban.alive...@gmail.com> wrote:

> Someone mentioned me the problem some time ago. I have a fix for it in my
> local repo, butI was waiting for the trunk to be stable to test it.
> The problem is that under certain circumstances, the kagent is reusing the
> same kbuilder to compile all the resources present in a change-set (the
> modifications I have force the agent to use a new kbuilder for each
> resource).
> The only difference between what you are reporting and the problem I'm
> talking about is that in my case all the rules, functions, etc were added to
> the kbase, but all within the same package. No matter the real package
> definition. Is this your case also?
>
> Please file a bug report and let me know.
>
> Best Regards,
>
> 
>
> Esteban Aliverti
> - Developer @ http://www.plugtree.com
> - Blog @ http://ilesteban.wordpress.com
>
>
> 2011/3/21 Steven Williams 
>
>> Hi all,
>>
>> I am trying to use a Knowledge Agent in 5.1.1 with a change set with a few
>> different packages and resource types in it, and I am running into a problem
>> where it is not adding all the packages. Looking at the code I can see that
>> KnowledegeAgentImpl.createPackageFromResource has the following code when it
>> loads a resource:
>>
>> if (kbuilder.getKnowledgePackages().iterator().hasNext()) {
>>
>> return (KnowledgePackageImp)
>> kbuilder.getKnowledgePackages().iterator().next();
>>
>> }
>>
>>
>> and KnowledgeBuilderImpl.getKnowledgePackages does the following:
>>
>>
>> Package[] pkgs = pkgBuilder.getPackages();
>>
>> List list = new ArrayList(
>> pkgs.length );
>>
>>
>> and PackageBuilder.getPackages does the following:
>>
>>
>> for ( PackageRegistry pkgRegistry : this.pkgRegistryMap.values()
>> ) {
>>
>> Package pkg = pkgRegistry.getPackage();
>>
>> // add package to array
>>
>> }
>>
>>
>> pkgRegistryMap is implemented as a HashMap however so the order the
>> packages are returned in is not guaranteed. I seem to be hitting this
>> problem.
>>
>> This is a hard one to create a unit test for so I wanted to check that my
>> analysis is correct before raising a bug. Perhaps using a LinkedHashMap or
>> similar would fix it?
>>
>> thanks
>> Steve
>>
>> ___
>> 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] KnowledgeAgent Issue

2011-03-21 Thread Steven Williams
Hi all,

I am trying to use a Knowledge Agent in 5.1.1 with a change set with a few
different packages and resource types in it, and I am running into a problem
where it is not adding all the packages. Looking at the code I can see that
KnowledegeAgentImpl.createPackageFromResource has the following code when it
loads a resource:

if (kbuilder.getKnowledgePackages().iterator().hasNext()) {

return (KnowledgePackageImp)
kbuilder.getKnowledgePackages().iterator().next();

}


and KnowledgeBuilderImpl.getKnowledgePackages does the following:


Package[] pkgs = pkgBuilder.getPackages();

List list = new ArrayList( pkgs.length
);


and PackageBuilder.getPackages does the following:


for ( PackageRegistry pkgRegistry : this.pkgRegistryMap.values() ) {

Package pkg = pkgRegistry.getPackage();

// add package to array

}


pkgRegistryMap is implemented as a HashMap however so the order the packages
are returned in is not guaranteed. I seem to be hitting this problem.

This is a hard one to create a unit test for so I wanted to check that my
analysis is correct before raising a bug. Perhaps using a LinkedHashMap or
similar would fix it?

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


Re: [rules-users] Inserting collection of facts in rule Consequence

2009-02-15 Thread Steven Williams
I normally do something like

when
$creditContract : CreditContract()
$o : Applicant() from $creditContract.coApplicantArray
then
insert($o);
end

retract would be something like

when
$o : Applicant( )
CreditContract( coApplicantArray contains $o )
then
retract($o);
end

cheers
Steve



On Tue, Feb 10, 2009 at 6:36 AM,  wrote:

>
> There may be a better way but I did it using a function as below:
>
> *function* *void* insertArray(WorkingMemory workingMemory, Object[] array)
> {
> *for* (*int* i=0;i {
> workingMemory.*insert*(array[i]);
> }
> *return*;
> }
>
> ...
>
> *rule* "StarCoApplicants" *ruleflow-group* "STAR"
> *dialect* "mvel"
> *when*
> $creditContract : CreditContract ()
> *then*
>
> insertArray(drools.workingMemory,$creditContract.coApplicantArray);
>
> *end*
>
>
> Kent Symanzik
>
>
>
>  *techy *
> Sent by: rules-users-boun...@lists.jboss.org
>
> 02/09/2009 10:15 AM
>  Please respond to
> Rules Users List 
>
>   To
> rules-users@lists.jboss.org
>  cc
>   Subject
> Re: [rules-users] Inserting collection of facts in rule Consequence
>
>
>
>
>
> I would appreciate If someone can clarify this.
>
> Thanks in advance
>
>
> techy wrote:
> >
> > Hello,
> >
> > Is there way to insert all facts from collection (similar to
> > session.execute(collection)) in the rule consequence ?
> >
> > Thanks!
> >
>
> --
> View this message in context:
> http://www.nabble.com/Inserting-collection-of-facts-in-rule-Consequence-tp21814308p21914860.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> 
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Eclipse guvnor plugin issue

2009-02-05 Thread Steven Williams
Hi all,

I am using the snapshot version of the eclipse plugin from Feb 5. When I
attempt to drag a file from the repository explorer into the Navigator view
I get the following exception:

java.lang.Exception: Could not create directory C:\Documents and
Settings\Administrator\workspace\.metadata\.plugins\org.guvnor.tools\623d8213:11f48a3ddff:-7fff
at org.guvnor.tools.views.RepositoryView.prepareFileTransfer(Unknown
Source)
at org.guvnor.tools.views.RepositoryView.access$1(Unknown Source)
at org.guvnor.tools.views.RepositoryView$2.dragSetData(Unknown Source)
at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:54)
...

I am using Windows and can drag the file from a mapped webdav directory on
my computer. I think the problem is that the filename contains the invalid
character :

Should I raise a bug?

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


[rules-users] RuleFlow question

2009-01-28 Thread Steven Williams
Hi guys,

I am playing with the OrderExample in drools-examples and was wondering how
I get access in my rules to the parameters that are sent to startProcess?
e.g.

Map parameters = new HashMap();
parameters.put("order", order);
parameters.put("orderId", order.getOrderId());
parameters.put("email", emailTextField.getText());
ProcessInstance processInstance =
ksession.startProcess("org.drools.examples.process.ruleset.RuleSetExample",
parameters);

I have access to the ProcessInstance but there doesn't seem to be any clear
path to the parameters.

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


[rules-users] KnowledgeBuilderConfiguration

2009-01-20 Thread Steven Williams
Hi guys,

It's no biggy but I was wondering whether KnowledgeBuilderConfiguration will
get an addAccumulateFunction method, similar to PackageBuilderConfiguration?
In our project we use Spring to configure Drools, which means we have a
Map available for accumulate functions, so we could
previously do:

config.addAccumulateFunction(entry.getKey(), entry.getValue());

Now with KnowledgeBuilderConfiguration we had to change the Map to
Map and do the following:

config.setProperty("drools.accumulate.function." + entry.getKey(),
entry.getValue());

which seems like a retrograde step.

-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.willi...@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] guvnor - cannot delete business rule assets

2009-01-20 Thread Steven Williams
Hi Kent,

I think if you archive your rule (with the archive button) you can then go
into the archive area of Administration and delete them.

cheers
Steve

On Wed, Jan 21, 2009 at 7:09 AM,  wrote:

>
> *Drools 5.0.0.M4 Guvnor Standalone*
>
> There does not appear to be an option for deleting business rule assets.
>  The delete button does show up for technical assets.
>
> Is it based on some context that I am not aware of?
>
> Thanks
>
> Kent
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.willi...@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools 5 Accumulate Function

2009-01-18 Thread Steven Williams
Hi all,

I am converting over to Drools 5 and have run into a problem with
AccumulateFunction. I changed my classes to implement
org.drools.runtime.rule.AccumulateFunction however this causes the
ClassCastException below:

Caused by: java.lang.ClassCastException:
au.com.promedicus.rules.MaxPriceAccumulateFunction cannot be cast to
org.drools.base.accumulators.AccumulateFunction
at
org.drools.compiler.PackageBuilderConfiguration.getAccumulateFunction(PackageBuilderConfiguration.java:489)
at
org.drools.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:108)
...

My guess is this is a bug. For now I will just go back to implementing
org.drools.base.accumulators.AccumulateFunction.

cheers
Steve

-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.willi...@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to access data after rule fires

2009-01-12 Thread Steven Williams
If you put an X or something in the cell (i.e. just don't leave it empty) it
should also work.

On Tue, Jan 13, 2009 at 10:57 AM, Edson Tirelli  wrote:

>
>  The action is not being executed. I don't use decision tables
> frequently, but I think that it ignores empty cells and is generating an
> empty consequence for your rule. Usually, you would place the method call on
> the header prototype and the parameter in the cell. So your cell would be:
>
> | hoover | true |
> | xyz | false |
>
>  The method prototype would be something like (please check the correct
> syntax in the manual):
>
> brand.setGoodBrand( $param );
>
>  Where the engine would replace $param by the value you write in the
> cell.
>
>
>  []s
>  Edson
>
> 2009/1/12 Costello, Robert 
>
>>  I tried that and it returned false, which doesn't make sense to me since
>> the rule firing is to set the value to true, and in the execution the rule
>> does fire.
>>
>>
>>
>> StatefulKnowledgeSession session =
>> kbase.newStatefulKnowledgeSession();
>>
>> Product p = *new* Product();
>>
>> p.setBrand("hoover");
>>
>> session.insert( p );
>>
>> *int* u = session.fireAllRules();
>>
>>
>>
>> System.*out*.println(u + " many rules fired");
>>
>> System.*out*.println("is brand good? " + p.isGoodBrand());
>>
>>
>>
>> Here's a snippet of the rule (decision table)
>>
>>
>>
>>
>>
>> * *
>>
>> CONDITION
>>
>> ACTION
>>
>> * *
>>
>> Product
>>
>> * *
>>
>> brand
>>
>> setGoodBrand(true);
>>
>> *Cases*
>>
>> hoover match case
>>
>>
>>
>> *Brand Check*
>>
>> hoover
>>
>> * *
>>
>>
>>
>> And the console returns:
>>
>>
>>
>> 1 many rules fired
>>
>> is brand good? false
>>
>>
>>
>>
>>
>>
>>
>> Robert Costello
>>
>> Lead Systems Engineer
>>
>> IMA Performance
>>
>> E3- 279A
>>
>> 847.286.0910
>>
>>
>>
>>
>>
>> -Original Message-
>> *From:* rules-users-boun...@lists.jboss.org [mailto:
>> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
>> *Sent:* Monday, January 12, 2009 4:16 PM
>> *To:* Rules Users List
>> *Subject:* Re: [rules-users] How to access data after rule fires
>>
>>
>>
>>
>>Can't you keep the reference to your object while firing the rules?
>>
>> MyObject x = ...
>> ksession.insert( x );
>> ksession.fireAllRules();
>> boolean result = x.getBooleanAttribute();
>>
>> []s
>> Edson
>>
>> 2009/1/12 Costello, Robert 
>>
>> So, how do I access data after the rules fire?
>>
>> If one has a rule which modifies a field on an object (a boolean, for
>> example), and you want to return the object after the rules are
>> complete, how do you do it?
>>
>> I tried this using a StatefulKnowledgeSession, getting an object
>> collection after the rules fire, but I don't see that this works.
>>
>> Also googled the heck out of this and looked in all the documentation.
>> I must be missing something, because the docs generally are pretty good.
>>
>>
>> Any hints?
>>
>> Thanks in advance,
>>
>> Robert Costello
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>>
>> --
>>  Edson Tirelli
>>  JBoss Drools Core Development
>>  JBoss, a division of Red Hat @ www.jboss.com
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss, a division of Red Hat @ www.jboss.com
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.willi...@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools 5 migration

2009-01-08 Thread Steven Williams
Hi guys,

I have migrated my code over to Drools 5 and now regular expressions have to
be escaped. e.g. where previously I had

name matches "^\s*$"

instead I have to put

name matches "^\\s*$"

Is this a bug or am I missing a setting or something? I am running against
the 5 snapshot.

thanks
Steve
-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.willi...@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Re: Drools nightly snapshot

2009-01-08 Thread Steven Williams
Never mind. (I hate it when you post a question and then immediately find
the answer!)

For anybody else the correct dependency format is:


org.drools
drools-core
5.0.0.SNAPSHOT


NOT


org.drools
drools-core
5.0.0-SNAPSHOT



On Fri, Jan 9, 2009 at 2:01 PM, Steven Williams wrote:

> Hi all,
>
> I was wondering if anyone knows how to get the nightly snapshot for Drools
> 5 via maven?
>
> I am using the http://snapshots.jboss.org/maven2 repository but the
> snapshot jars have different names to what I was expecting (e.g.
> drools-core-5.0.0.20081110.114826-277.jar as opposed to
> drools-core-5.0.0-SNAPSHOT.jar). Can anyone tell me what settings I should
> use in my pom to get the latest version?
>
> thanks
> Steve
>
> --
> Steven Williams
>
> Supervising Consultant
>
> Object Consulting
> Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
> steven.willi...@objectconsulting.com.au
> www.objectconsulting.com.au
>
> consulting | development | training | support
> our experience makes the difference
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.willi...@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools nightly snapshot

2009-01-08 Thread Steven Williams
Hi all,

I was wondering if anyone knows how to get the nightly snapshot for Drools 5
via maven?

I am using the http://snapshots.jboss.org/maven2 repository but the snapshot
jars have different names to what I was expecting (e.g.
drools-core-5.0.0.20081110.114826-277.jar as opposed to
drools-core-5.0.0-SNAPSHOT.jar). Can anyone tell me what settings I should
use in my pom to get the latest version?

thanks
Steve

-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
steven.willi...@objectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools query

2008-12-10 Thread Steven Williams
Yeah - that discussion was before drools had the accumulate function.

On Thu, Dec 11, 2008 at 10:16 AM, Greg Barton <[EMAIL PROTECTED]> wrote:

> That approach looks a bit cartesian joiny.  I'd be interested in seeing how
> it compares to using accumulate.
>
> --- On Wed, 12/10/08, Steven Williams <[EMAIL PROTECTED]> wrote:
>
> > From: Steven Williams <[EMAIL PROTECTED]>
> > Subject: Re: [rules-users] drools query
> > To: "Rules Users List" 
> > Date: Wednesday, December 10, 2008, 4:59 PM
> > Have a look here
> > http://www.jboss.org/community/docs/DOC-11909 (this is to
> > find the max so just reverse it)
> >
> > cheers
> > Steve
> >
> > On Thu, Dec 11, 2008 at 9:48 AM, tati-2
> > <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > How to extract min age of many objects of the same
> > type "People" , which we
> > > inserted in the workspace ?
> > >
> > > Thank you very much in advance for help.
> > > --
> > > View this message in context:
> > >
> > http://www.nabble.com/drools-query-tp20945811p20945811.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
> > >
> >
> >
> >
> > --
> > Steven Williams
> >
> > Supervising Consultant
> >
> > Object Consulting
> > Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
> > [EMAIL PROTECTED]
> > www.objectconsulting.com.au
> >
> > consulting | development | training | support
> > our experience makes the difference
> > ___
> > 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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools query

2008-12-10 Thread Steven Williams
Have a look here http://www.jboss.org/community/docs/DOC-11909 (this is to
find the max so just reverse it)

cheers
Steve

On Thu, Dec 11, 2008 at 9:48 AM, tati-2 <[EMAIL PROTECTED]> wrote:

>
> How to extract min age of many objects of the same type "People" , which we
> inserted in the workspace ?
>
> Thank you very much in advance for help.
> --
> View this message in context:
> http://www.nabble.com/drools-query-tp20945811p20945811.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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] having counter in drl

2008-12-09 Thread Steven Williams
How about adding a flag to Event to indicate it has been processed?
You could then use:

when
  Event(processed == false)
  ...


On Wed, Dec 10, 2008 at 10:56 AM, techy <[EMAIL PROTECTED]> wrote:

>
> Thanks all for the reply.
> I executed following rules after adding Event fact id ranges from 1 to 8.
> Output is given below. counter rule was not executed for distinct event
> fact. some help please.
>
> output :
> -
> adding counter
> new count value: 4 , event : 8
> new count value: 3 , event : 7
> new count value: 2 , event : 8
> new count value: 1 , event : 7
> ---
>
> rule "init"
> lock-on-active true
> when
>then
>System.out.println("adding counter");
>Counter c = new Counter(4);// init with max count
> value
>insert(c);
>
> end
>
> rule "counter"
> no-loop true
>when
>event : Event()
>counter : Counter(count > 0)
>then
>System.out.println("new count value: "+counter.getCount()+" , event
> :
> "+event.getEventId());
>counter.setCount(counter.getCount()-1);
>update(counter);
> end
>
>
>
>
> dave sinclair wrote:
> >
> > Make counter an object
> >
> > when
> > $counter : Counter(value <= 100)
> > ...
> >
> >
> > On Mon, Dec 8, 2008 at 5:05 PM, techy <[EMAIL PROTECTED]> wrote:
> >
> >>
> >> Hello,
> >> I would like to take 100 sampling facts for rule and persist it in the
> db
> >> and ignore other data.
> >> How Can I maintain the counter? as global variable? Please clarify with
> >> sample code.
> >> I tried following way and but it does not work as expected.
> >>
> >> Ex:
> >> global Integer counter;
> >> rule "get sampling data"
> >>   when fact : Foo(some condition) && eval(counter <= 100)
> >>   then
> >>counter++
> >>   // do some condition
> >> end
> >> --
> >> View this message in context:
> >> http://www.nabble.com/having-counter-in-drl-tp20904469p20904469.html
> >> Sent from the drools - user mailing list archive at Nabble.com.
> >>
> >> ___
> >> rules-users mailing list
> >> rules-users@lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/having-counter-in-drl-tp20904469p20926420.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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] having counter in drl

2008-12-08 Thread Steven Williams
Sorry - I accidentally hit send.

Something like:

when
then
   insert(new Integer(0));
end
when
  $i: Integer(value < 100)
  Foo(some condition)
then
  retract($i);
  insert(new Integer($i.intValue() + 1));
  ...
end

On Tue, Dec 9, 2008 at 10:54 AM, Steven Williams <[EMAIL PROTECTED]>wrote:

> Globals should only be used for data that is constant over the life of the
> working memory, which is not so in your case.
>
> Maybe you should just use a fact counter. If you don't want to affect your
> code you could insert it in a separate rule.
>
> when
> then
>
>
>
> On Tue, Dec 9, 2008 at 9:05 AM, techy <[EMAIL PROTECTED]> wrote:
>
>>
>> Hello,
>> I would like to take 100 sampling facts for rule and persist it in the db
>> and ignore other data.
>> How Can I maintain the counter? as global variable? Please clarify with
>> sample code.
>> I tried following way and but it does not work as expected.
>>
>> Ex:
>> global Integer counter;
>> rule "get sampling data"
>>   when fact : Foo(some condition) && eval(counter <= 100)
>>   then
>>counter++
>>   // do some condition
>> end
>> --
>> View this message in context:
>> http://www.nabble.com/having-counter-in-drl-tp20904469p20904469.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
>>
>
>
>
> --
> Steven Williams
>
> Supervising Consultant
>
> Object Consulting
> Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
> [EMAIL PROTECTED]
> www.objectconsulting.com.au
>
> consulting | development | training | support
> our experience makes the difference
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] having counter in drl

2008-12-08 Thread Steven Williams
Globals should only be used for data that is constant over the life of the
working memory, which is not so in your case.

Maybe you should just use a fact counter. If you don't want to affect your
code you could insert it in a separate rule.

when
then


On Tue, Dec 9, 2008 at 9:05 AM, techy <[EMAIL PROTECTED]> wrote:

>
> Hello,
> I would like to take 100 sampling facts for rule and persist it in the db
> and ignore other data.
> How Can I maintain the counter? as global variable? Please clarify with
> sample code.
> I tried following way and but it does not work as expected.
>
> Ex:
> global Integer counter;
> rule "get sampling data"
>   when fact : Foo(some condition) && eval(counter <= 100)
>   then
>counter++
>   // do some condition
> end
> --
> View this message in context:
> http://www.nabble.com/having-counter-in-drl-tp20904469p20904469.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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] how to find the rule name

2008-07-02 Thread Steven Williams
try
String ruleName = ...

On Thu, Jul 3, 2008 at 7:09 AM, Marina <[EMAIL PROTECTED]> wrote:

> Hello,
>
> I need to know the rule name of the rule that fired in the consequence part
> of the rule. I tried something like the following, just trying to see if I
> can get it this way:
>
> package mode.simple;
> import java.lang.String;
> import java.util.List;
> import com.emptoris.ecm.domain.ContractRulesData;
>
> global java.util.Set approverList;
>
> rule "testOR_1"
>dialect "java"
>when
>$data : ContractRulesData (sum > 500 || name matches ".*important")
>then
>approverList.add("approver3, approver4, Level5");
>ruleName = drools.getRule().getName();
>System.out.println(ruleName + " is TRUE");
>
> end
>
> When I'm trying to compile the rule, I'm getting the following error:
> Builder errors:
> Rule Compilation error : [Rule name=testOR_1, agendaGroup=MAIN, salience=0,
> no-loop=false]
>mode/simple/Rule_testOR_1_0.java (8:391) : ruleName cannot be resolved
>mode/simple/Rule_testOR_1_0.java (9:452) : ruleName cannot be resolved
> java.lang.RuntimeException: Unable to compile rules file: testOR_1.drl
>
> I must be doing something wrong here... ?
>
> thanks!
> Marina
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] No accumulator function found for identifier

2008-05-20 Thread Steven Williams
Hi Jarek,

I have had a similar problem. For the moment I have put the
drools.packagebuilder.conf file in my home directory (e.g. c:\documents and
settings\username on windows). Whilst not ideal it works.

cheers
Steve

On Tue, May 20, 2008 at 10:36 PM, Jaroslaw Kijanowski <
[EMAIL PROTECTED]> wrote:

> Hi,
>  when I create my own accumulate function, I add it to
> src/main/java/META-INF/drools.packagebuilder.conf and it works fine.
>
> However, eclipse is showing one error:
> No accumulator function found for identifier: ...
>
> I've found this
> http://lists.jboss.org/pipermail/rules-users/2007-December/004349.html
> and tried to move META-INF to the root dir, but then my app doesn't work
> (and eclipse shows the same error).
>
> Any thoughts?
>
> Thanks,
>  Jarek
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] BRMS Security in Websphere 6.1

2008-05-14 Thread Steven Williams
itialization.java:964)
>at
> org.jboss.seam.init.Initialization.init(Initialization.java:536)
>at
> org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java
> :34)
>at
> com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebA
> pp.java:608)
>at
> com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.
> java:266)
>at
> com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:272)
>at
> com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.jav
> a:88)
>at
> com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java
> :157)
>at
> com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:655)
>at
> com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.ja
> va:608)
>at
> com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerI
> mpl.java:333)
>at
> com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImp
> l.java:549)
>at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl
> .java:1295)
>at
> com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectS
> tart(DeployedApplicationImpl.java:1129)
>at
> com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl
> .java:567)
>at
> com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedAppli
> cationImpl.java:814)
>at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(Applica
> tionMgrImpl.java:948)
>at
> com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(Appli
> cationMgrImpl.java:2114)
>at
> com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(W
> sComponentImpl.java:340)
>at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
> Caused by: java.security.AccessControlException: Access denied
> (java.lang.reflect.ReflectPermission suppressAccessChecks)
>at
> java.security.AccessController.checkPermission(AccessController.java:104
> )
>at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:547)
>at
> com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager
> .java:189)
>at
> java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:1
> 19)
>at org.jboss.seam.Component.scanMethod(Component.java:797)
>at org.jboss.seam.Component.initMembers(Component.java:548)
>at org.jboss.seam.Component.(Component.java:254)
>at org.jboss.seam.Component.(Component.java:217)
>at
> org.jboss.seam.init.Initialization.addComponent(Initialization.java:949)
>    ... 19 more
>
>
> This email and/or any files or attachments transmitted with it are
> confidential and intended solely for the use of the individual or entity to
> whom they are addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law. If you are not
> the intended recipient, or the employee or agent responsible for delivering
> the message to the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this e-mail and/or any files or
> attachments transmitted with it is strictly forbidden. If you have received
> this email in error, please delete the e-mail and/or any files or
> attachments, and also notify the system manager (
> [EMAIL PROTECTED]) of the error. Please note that any views
> or opinions presented in this email are solely those of the author and do
> not necessarily represent those of the company. Finally, the recipient
> should check this email and any attachments for the presence of !
>  viruses. The company accepts no liability for any damage caused by any
> virus transmitted by this email and/or any files or attachments transmitted
> with it.
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Re: Is this scenario suitable for using Drools?

2008-04-23 Thread Steven Williams
without knowing how you are accessing the database your two algorithms come
down to something like:

Alg. 1
max(select max(p) from y, select max(t) from z)

Alg. 2
select min(p) from y + select min(t) from z

which is basically the same as what Michael has proposed.

Personally I think if you are already using Drools then this would fit, but
it wouldn't seem like enough of a reason to introduce Drools on its own.

cheers
Steve



On Wed, Apr 23, 2008 at 2:27 AM, Cheng Wei Lee <[EMAIL PROTECTED]> wrote:

> I've 2 algorithms to calculate the cost of a product. At any one time,
> there is only 1 algorithm in use. Initially algorithm 1 will be the default.
> Subsequently, the decision to use which algorithm will depend on customers
> feedback. The algorithms are:
>
> Algorithm 1:
> Cost = MAX(P1, T1, P2, T2, P3, T3, ...)
>
> Algorithm 2:
> Cost = MIN(P1, P2, P3, ...) + MIN(T1, T2, T3, ...)
>
> The values of P1, P2, ... are stored within a database. The number of Ps &
> Ts are unknown but can be determined by querying the database, Would drools
> be a good option to use to store the algorithms? If so, how could I be able
> to retrieve the values of P1, P2, etc from the database from within drools?
>
> Thanks!
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Re: Is this scenario suitable for using Drools?

2008-04-23 Thread Steven Williams
change DBUtils to return a Collection and it should work I think.

On Wed, Apr 23, 2008 at 5:50 PM, Anstis, Michael (M.) <[EMAIL PROTECTED]>
wrote:

>  So, in my usual helpful manner I thought Drools would be a perfect match
> and put together what I thought would be a simple example:-
>
> package com.sample
>
> global com.sample.DBUtils dbutils;
> rule "a1"
> when
> $max : Integer() from accumulate( Integer( $v : intValue ) from
> dbutils.getNumbers(), max($v) )
> then
> System.out.println($max);
> end
>
>
> public class DBUtils {
>
> public Integer[] getNumbers() {
>
> Integer[] numbers = new Integer[10];
> for (int i = 0; i < numbers.length; i++) {
> numbers[i] = (int) (Math.random() * 100);
> }
> return numbers;
> }
> }
>
> However this led to some errors:-
>
> org.drools.RuntimeDroolsException: java.lang.ClassCastException:
> [Ljava.lang.Integer; incompatible with java.lang.Integer
>  at org.drools.rule.Accumulate.accumulate(Accumulate.java:131)
>  at org.drools.reteoo.AccumulateNode.assertTuple(AccumulateNode.java:127)
>  at
> org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTuple(CompositeTupleSinkAdapter.java:73)
>  at
> org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
>  at
> org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
>  at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
>  at org.drools.reteoo.Rete.assertObject(Rete.java:177)
>  at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>  at
> org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:179)
>  at
> org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1292)
>  at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:891)
>  at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
>  at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:659)
>  at com.sample.DroolsTest.main(DroolsTest.java:36)
> Caused by: java.lang.ClassCastException: [Ljava.lang.Integer; incompatible
> with java.lang.Integer
>  at
> org.drools.base.java.lang.Integer968047027$intValue.getIntValue(Unknown
> Source)
>  at
> org.drools.base.ClassFieldExtractor.getIntValue(ClassFieldExtractor.java:197)
>  at org.drools.rule.Declaration.getIntValue(Declaration.java:230)
>  at
> com.sample.Rule_a1_0AccumulateExpression0Invoker.evaluate(Rule_a1_0AccumulateExpression0Invoker.java:16)
>  at
> org.drools.base.accumulators.JavaAccumulatorFunctionExecutor.accumulate(JavaAccumulatorFunctionExecutor.java:74)
>  at org.drools.rule.Accumulate.accumulate(Accumulate.java:123)
>  ... 13 more
> Have I done something really stupid and is Drools a fit?
>
> Cheers,
>
> Mike
>
>  --
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Cheng Wei Lee
> *Sent:* 22 April 2008 17:27
> *To:* rules-users@lists.jboss.org
> *Subject:* [rules-users] Re: Is this scenario suitable for using Drools?
>
> I've 2 algorithms to calculate the cost of a product. At any one time,
> there is only 1 algorithm in use. Initially algorithm 1 will be the default.
> Subsequently, the decision to use which algorithm will depend on customers
> feedback. The algorithms are:
>
> Algorithm 1:
> Cost = MAX(P1, T1, P2, T2, P3, T3, ...)
>
> Algorithm 2:
> Cost = MIN(P1, P2, P3, ...) + MIN(T1, T2, T3, ...)
>
> The values of P1, P2, ... are stored within a database. The number of Ps &
> Ts are unknown but can be determined by querying the database, Would drools
> be a good option to use to store the algorithms? If so, how could I be able
> to retrieve the values of P1, P2, etc from the database from within drools?
>
> Thanks!
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Collection & Emptyness

2008-04-23 Thread Steven Williams
use sousVenues.empty == true

On Wed, Apr 23, 2008 at 5:32 PM, vdelbart <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I have an object 'VenueGlobal' with a property 'sousVenues' who is a List
> of
> SousVenue. I try to test the emptyness of this list in on sentence but i
> don't know why it doesn't work :
>
> I try this :
>
> VenueGlobal( sousVenues == null || sousVenues.empty )
>
> but I have this error :
>
> org.drools.rule.InvalidRulePackage: [11,53]: unknown:11:53 Unexpected
> token
> ')'
>at org.drools.rule.Package.checkValidity(Package.java:424)
>
> I try this :
>
> VenueGlobal( sousVenues == null || sousVenues.size == 0 )
>
> but I have this error :
>
> Caused by: org.mvel.PropertyAccessException: unable to resolve property:
> size
>at
>
> org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:382)
>
>
> I don't know what the solution ?
>
>
> regards,
>
> V.
>
>
> --
> View this message in context:
> http://www.nabble.com/Collection---Emptyness-tp16833060p16833060.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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Modifying fact object during rules execution

2008-04-13 Thread Steven Williams
You could then have a rule that checks not (Currency type == USD) and a RHS
with that inserts a new converted amount. If your conversion is rules-based
then just have a rule per currency conversion.

Your "processing rules" could then act on the converted amounts.

On Mon, Apr 14, 2008 at 2:33 AM, vmuthupal <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> Currently we have a rule defined like this
> When
>  Currency value = 300
>  Currency type = USD
>  Condition 3 = something
>  Condition 4 = something
> Then
>  do this
>
> If the input values are not of the same currency then we need to do a
> currency conversion and then evaluate the above rule. For example if the
> input value says Currency value = 250 and currency type = Euro. then we
> need
> to convert the currency value from Euro to USD and then execute the rule.
> Is
> this possible by using functions on the LHS. If possible is there a better
> way to do this as we are currently looking at 10,000 rules to go through
> this routine.
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Modifying-fact-object-during-rules-execution-tp16659936p16659936.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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Feature request

2008-04-09 Thread Steven Williams
I also have this requirement. I spoke to Michael Neale about it and he
thought that it shouldn't be too difficult. Michael, I wasn't sure if you
were going to add the feature request or if you want me to do it?

cheers
Steve

On Thu, Apr 10, 2008 at 9:30 AM, Brian Trezise <
[EMAIL PROTECTED]> wrote:

>  This is a feature request, or if the feature already exists, a request
> that somebody let me know :)
>
>
>
> I have a set of rules that heavily depend on regular expressions to
> operate.  The regular expression is matched on the LHS of the rule, and then
> passed to another object for additional processing in the RHS of the rule.
> We're looking at a few hundred rules here.  Here's the problem – because of
> needing to use the regexes twice, I have stored them in a separate container
> class as public static final String variables; however what we really want
> to do is to be able to make a modification to either the regex or the rules
> themselves, hot deploy the changes to the rule, and have everything work.
> We specifically do not want to have to try hot-deploying or re-compiling
> classes due to the potential issues that can arise.  As it stands now it's
> looking like we are going to have to endure a pretty heavy maintenance
> burden by changing the rule, hot deploying, then later in the evening
> redeploying the java code and rebooting the server whenever we make a
> change.
>
>
>
> The ideal solution for this problem would be if we could set
> package-scoped variables in the .drl file, outside of the rules.  For
> example, at the top of the drl file, below the import statements, if we
> could write something like the following:
>
>  let String THIS_STRING = "this regular expression";
>
>
>
> and then in the background when the rule classes are generated, have them
> be declared as static final/constant variables.  This way they could be used
> on either side of the rule, but if a change is made the RuleAgent will see
> that and overwrite the old version of the rule package and fact processing
> would be able to continue uninterrupted.
>
>
>
> If anybody has any suggestions on a work around, I would be appreciative.
>
>
>
> Oh, and thanks to everybody for helping me get the RuleAgent to work :)
>
> *___
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> *3173 s. uravan way
> aurora, colorado 80013
> T: 720.524.4864
> [EMAIL PROTECTED]
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Error on access variable in workingmemorylogger

2008-04-09 Thread Steven Williams
This may be http://jira.jboss.org/jira/browse/JBRULES-1415

cheers
Steve

On Wed, Apr 9, 2008 at 5:37 PM, vdelbart <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> I have an error on WorkingMemoryLogger with this rule :
>
> package example
> import mcmipih.rules.demo.model.*;
> global Param param;
>
> rule "Your Third Rule"
>dialect "mvel"
>when
>Param( iep : IEP  ) from param
>then
>System.out.println("Iep de param " + iep);
> end
>
> The error :
>
> java.lang.NullPointerException
>at
>
> org.drools.base.mcmipih.rules.demo.model.Param22676229$getIEP.getValue(Unknown
> Source)
>at
> org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:127)
>at org.drools.rule.Declaration.getValue(Declaration.java:198)
>at
>
> org.drools.audit.WorkingMemoryLogger.extractDeclarations(WorkingMemoryLogger.java:265)
>at
>
> org.drools.audit.WorkingMemoryLogger.activationCreated(WorkingMemoryLogger.java:199)
>at
>
> org.drools.event.AgendaEventSupport.fireActivationCreated(AgendaEventSupport.java:75)
>at
> org.drools.reteoo.RuleTerminalNode.assertTuple(RuleTerminalNode.java:331)
>at
> org.drools.reteoo.RuleTerminalNode.assertTuple(RuleTerminalNode.java:137)
>at
>
> org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(SingleTupleSinkAdapter.java:20)
>at org.drools.reteoo.FromNode.assertTuple(FromNode.java:90)
>at
>
> org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
>at
>
> org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
>at
>
> org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
>at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
>at org.drools.reteoo.Rete.assertObject(Rete.java:175)
>at
> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>at
>
> org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:179)
>at
>
> org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1315)
>at
>
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:462)
>at
>
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
>at
>
> execute.ExecReglesWorkingMemory.testExecReglesWorkingMemory(ExecReglesWorkingMemory.java:107)
>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 junit.framework.TestCase.runTest(TestCase.java:154)
>at junit.framework.TestCase.runBare(TestCase.java:127)
>at junit.framework.TestResult$1.protect(TestResult.java:106)
>at junit.framework.TestResult.runProtected(TestResult.java:124)
>at junit.framework.TestResult.run(TestResult.java:109)
>at junit.framework.TestCase.run(TestCase.java:118)
>at
>
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
>at
>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>
>
> The workingmemorylogger wants to show the value of the variable iep even
> if
> my 'param' is not present in the working memory !
>
> Is it a bug ?
>
> thanks for your help,
>
> regards,
>
> V.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Error-on-access-variable-in-workingmemorylogger-tp16581343p16581343.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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Can we do this with drools ?

2008-03-27 Thread Steven Williams
There are some undocumented classes in drools-decisiontables that should let
you do this. Have a look at DataProviderCompilerIntegrationTest.java

cheers
Steve*
*
On Tue, Mar 25, 2008 at 12:03 PM, ferry97 <[EMAIL PROTECTED]> wrote:

>
> Thanks Mark for the info.
> Could you show me how to do it using mvel ? or refer me a link that
> explaining all this ?
>
>
>
> Mark Proctor wrote:
> >
> > ferry97 wrote:
> >> Hi,
> >> I don't know how to ask this in words.
> >> But can we do something like :
> >>
> >> rule "define trx type"
> >> when
> >>Transaction(code == ${type1.code")
> >>
> > sorry no. But it's a nice idea, maybe submit a patch? You could probably
> > do this yourself already if you use MVEL templating as a pre-parser.
> >> then
> >>doSomething 
> >>
> >> So, we define the type.code in a properties file.
> >> Thanks
> >>
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Can-we-do-this-with-drools---tp16244282p16266150.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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Missing mvel class after upgrade 4.0.4 => 4.0.5

2008-03-27 Thread Steven Williams
Hi Christian,

I also ran into this problem. The mvel library on repo1.maven.org is wrong.
Try using the jboss or codehaus repos.

cheers
Steve

On Wed, Mar 26, 2008 at 10:28 PM, Christian Gorbach <[EMAIL PROTECTED]> wrote:

> hi ,
>
> I am using maven, I tried to upgrade to the latest release be just
> changing the dools pom version number to 4.0.5
> After the upgrade execution fails with the following stack trace:
>
> ...
> java.lang.NoClassDefFoundError: org/mvel/AbstractParser
>at
> org.drools.rule.builder.dialect.mvel.MVELDialect.setLanguageLevel(
> MVELDialect.java:128)
>at
> org.drools.rule.builder.dialect.java.AbstractJavaBuilder.(
> AbstractJavaBuilder.java:26)
>at
> org.drools.rule.builder.dialect.java.JavaDialect.(JavaDialect.java
> :78)
>at
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.getDialect(
> JavaDialectConfiguration.java:62)
>at
> org.drools.compiler.PackageBuilderConfiguration.buildDialectRegistry(
> PackageBuilderConfiguration.java:175)
>at org.drools.compiler.PackageBuilder.(PackageBuilder.java:142)
>at org.drools.compiler.PackageBuilder.(PackageBuilder.java:86)
> ..
>
> has anyone successfully switched to the latest version using the maven2
> poms?
> thanks in advance,
> c)hristian
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Re: Fire Rules in DT based on a rule in DT

2007-11-15 Thread Steven Williams
I'm not sure if it made its way into the doco. I don't have the code with me
but will check for you what the value is.

cheers
Steve

On Nov 16, 2007 1:21 PM, Arjun Dhar <[EMAIL PROTECTED]> wrote:

> Steven Williams  gmail.com> writes:
>
> >
> >
> > I added agenda-group to decision tables in September 2006.cheersSteve
>
> 2006, or 2007? Because it was not there in JBoss Rules 4.0.0 (at least not
> documented).
>
> Either way, it means it exists now. So will look at the latest release
> documentation.
>
> Thanks
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fire Rules in DT based on a rule in DT

2007-11-14 Thread Steven Williams
I added agenda-group to decision tables in September 2006.

cheers
Steve

On Nov 14, 2007 6:50 PM, Arjun Dhar <[EMAIL PROTECTED]> wrote:

> Hi,
>  I have the following scenario.
>
> SCENARIO (simplified for discussion from actual blown up scenario)
> -
>  1. A decision table (DT) with rules for "all types of employees" - Call
> it "Common DT"
>  2. The DT mentioned in Point 1 has a condition that fetched data
> depending
> on "Type Of Employee"
>
>  3. There are other decision tables that would like to use the the rules
> from "Common DT", but here are the challenges:
>
> Challenges
> --
> 1. Decision does not support Agenda Groups
> 2. Using a fact; to hold the evaluated result from a DT can pass it from a
> child to a parent; but it requires an "update()"; which can cause infinite
> recursion if i dont have a "Execute ONE Rule Only from Table" decision
> variable.
>
> (Parent) DT - Condition 1, condition 2, Condition 3 (Actually result of
> Child
> DT)
>
>
> (Child DT)
> ... The relation is maintained using decision variables.
>
> This relation works perfenctly good (been working for 3 months now), but
> issue
> is it creates a Sort of a Tree (with each node a DT); in shich I cannot
> fire a
> common set of rules from Any Node.
>
> As an alternative; I'm suggesting to the client to write replicated DT's
> for
> each type of employee instead of 1 generic DT.
>
> Can anyone help?
>
> I've been begging for agenda Groups in decision tables but I guess you
> guys are
> tied up. So at a design level can you suggest a work around?
>
> Thanks,
> Arjun
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools web project in eclipse - Drools Library issue

2007-10-03 Thread Steven Williams
Make sure the drools jars end up in your WEB-INF/lib directory.

cheers
Steve

On 10/4/07, Malika <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> I started to write web app using drools decision table. Here is what I
> have
> in my web project in eclipse 3.3,
> drools 4.0:
>
> 1. A Jsp page that takes input and pass it on to a servlet that fires the
> rules.
> 2. Servlet class has import statements:
> import org.drools.RuleBase;
> import org.drools.RuleBaseFactory;
> import org.drools.StatefulSession;
> import org.drools.StatelessSession;
> import org.drools.WorkingMemory; and so on..
> 3. When I run the jsp on tomcat, it starts but when i hit submit it throws
> the exception:
>
> java.lang.NoClassDefFoundError: org/drools/RuleBase
>
> 4. I have drools jar files added under project properties - build path->
> add
> external jars from
>
> "C:\wtp_all_in_one\eclipse\configuration\org.eclipse.osgi\bundles\503\1\.cp\lib".
> This is showing all drools jar files under Libraries hierarchy.
>
> Could anyone please suggest what to do to resolve this error?
>
> Thanks and Regards,
> Malika
>
>
> --
> View this message in context:
> http://www.nabble.com/Drools-web-project-in-eclipse---Drools-Library-issue-tf4564565.html#a13028564
> 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
>



-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] custom defined types in setter and getters

2007-10-03 Thread Steven Williams
No - you can use any java object as a fact, so both of your classes are
fine. For instance you could do:

when
  Car($p: paint)
then
  System.out.println($p.getName());
end

and using MVEL you could do:

when
  Car(paint.name == "red")
then
  ...


On 10/4/07, jack wu <[EMAIL PROTECTED]> wrote:
>
> Hi, i suppose the second form of fact is not supported. but i'd like to
> confirm.
>
> in other words, you can only have setters and getters that return basic
> java types. is that right? can i return java collections such as array and
> map? the documentation is not clear on that.
>
> thanks.
>
> public class Paint
> {
> String getName();
> String getColor();
> }
>
>
> public class Car
> {
> int getSize();
> Paint getPaint();
> }
>
>
> jack.
>
>
>
> --
> Got a little couch potato?
> Check out fun summer activities for 
> kids.<http://us.rd.yahoo.com/evt=48248/*http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz>
>
> _______
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to stop a rule from firing?

2007-06-21 Thread Steven Williams

One simple way is:

 [when] condition3 = not condition2 && \\someCondition;
 [then] assert the Object2 into Working Memory;

 [when] condition4 = not condition2 && \\someCondition;
 [then] Set the Error Message.

Generally you should keep your rules independent of each other.

If this is just a naive example of a more complex problem maybe you should
look at the RuleFlow (in v4) or agenda groups.

On 6/22/07, McShiv <[EMAIL PROTECTED]> wrote:



Hi,

I am using Drools 3.0.6. The rule is given below.

Rule:

  [when] condition1 = \\someCondition;
  [then] assert the Object1 into Working Memory;

  [when] condition2 = \\someCondition;
  [then] set the Error Message.

  [when] condition3 = \\someCondition;
  [then] assert the Object2 into Working Memory;

  [when] condition4 = \\someCondition;
  [then] Set the Error Message.

By requirement is when the condition2 is satisfied, the error code should
be
set and the following rules should not fire. If the condition2 is not
satisfied, it goes to the condition3 and condition4. If condition4
satisfies, it should set the error code and stop firing the rules again.

I dont know how to stop the rules from firing after the error code is set
in
the condition2.

Can someone help me on this issue.

Thanks & Regards
McShiv.
--
View this message in context:
http://www.nabble.com/How-to-stop-a-rule-from-firing--tf3961519.html#a11242241
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] NoMuchMethod - But there is!

2007-06-20 Thread Steven Williams

Hi Steven,

Looks like you are picking up the wrong org.eclipse.jdt.core jar at runtime.

cheers
Steve

On 6/19/07, Steven Waldren <[EMAIL PROTECTED]> wrote:


Hello,
I downloaded the JBoss Rules 4.0 Eclipse IDE.  I built a small project
with about 120 rules. My test asserts around 500 objects. When I try to add
one more rule (regardless of the content of the rule) I get the error below,
stating no such method error.  Even if I add the following rule, I still get
the error:

rule "new rule"
when
 Object()
then
 System.out.print("test");
end


What other problems can throw these errors?

Thanks,
Steven
--
Steven E. Waldren, M.D., M.S.
OpenHealth Data
Skype: steven.waldren

=== THE ERROR ==
java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
at org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(
EclipseJavaCompiler.java:295)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:454)
at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile(
EclipseJavaCompiler.java:332)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(
JavaDialect.java:311)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:237)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(
PackageBuilder.java:157)
at com.sample.DroolsTest.readRule(DroolsTest.java:78)
at com.sample.DroolsTest.main(DroolsTest.java:37)
java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
at org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(
EclipseJavaCompiler.java:295)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:454)
at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile(
EclipseJavaCompiler.java:332)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(
JavaDialect.java:311)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:237)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(
PackageBuilder.java:157)
at com.sample.DroolsTest.readRule(DroolsTest.java:78)
at com.sample.DroolsTest.main(DroolsTest.java:37)




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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] FW: Newbie: using a spreadsheet

2007-05-01 Thread Steven Williams

In your Action column you should have:

ACTION

singleStatus.setAnswer("$param");

cheers
Steve

On 5/1/07, Hehl, Thomas <[EMAIL PROTECTED]> wrote:


 OK, here's my rules table:



*RuleTable Court***



CONDITION

CONDITION

ACTION

singleStatus: SingleParticipantStatus

singleStatus: SingleParticipantStatus

singleStatus: SingleParticipantStatus

statusType

value

singleStatus.setAnswer("$param");



And this generates a rule that looks like this, for example:



 then singleStatus: SingleParticipantStatus.singleStatus.setAnswer
("statusOnly");;



This generates an error b/c it doesn't know how to resolve
SingleParticipantStatus.singleStatus.setAnswer, which is where the error
below is coming from.



So I changed the rule table to simply say:



setAnswer("$param");



Which generates:



  then

singleStatus: SingleParticipantStatus.setAnswer
("statusOnly");;



Which causes the non-static method error since setAnswer is an instance
method.



Can anyone tell me what I'm doing wrong?



Thanks.


 --

*From:* Hehl, Thomas
*Sent:* Monday, April 30, 2007 8:42 AM
*To:* 'rules-users@lists.jboss.org'
*Subject:* Newbie: using a spreadsheet



I've been following the ExamplePricePolicy example and am attempting to
build my own rules using a spreadsheet.



In my spreadsheet rules, I have the following:



ACTION

singleStatus: SingleParticipantStatus

singleStatus.setAnswer("$param");



This throws:



org.drools.rule.InvalidRulePackage: Rule Compilation error
SingleParticipantStatus.singleStatus cannot be resolved

Rule Compilation error SingleParticipantStatus.singleStatus cannot be
resolved

Rule Compilation error SingleParticipantStatus.singleStatus cannot be
resolved

Rule Compilation error SingleParticipantStatus.singleStatus cannot be
resolved

Rule Compilation error SingleParticipantStatus.singleStatus cannot be
resolved



When I googled on this error, most of the occurrences appeared to be
related to an import issue, but if I change the third line to:



setAnswer("$param");



It blows up because it knows that setAnswer is not a static method, which
tends to tell me that it found my class.



I think I've parroted the example exactly and so I'm confused as to where
to go with this issue.



Thanks!

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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Asserting new Facts in RHS...

2007-04-19 Thread Steven Williams

rule "Assert new Target Records"
  when
$one   : RKEM_TARGET ( EQPNO == "1") &&
$three : RKEM_TARGET ( EQPNO == "3")

  then
  // Assert the missing Equipment number record
  RKEM_TARGET $two = new RKEM_TARGET();
  $two.setEQPNO("2");  // Set attribute
  assert( $two );  <-- This does NOT work...
end

Then "then" section is just normal java with a few methods and objects
provided for you.

cheers
Steve

On 4/20/07, jdepaul <[EMAIL PROTECTED]> wrote:



I'm trying to assert a new Fact based on a condition, but I dont know how
to
assert a new Fact with a specific attribute in it.  I'm trying this - why
doesn't this syntax work:

rule "Assert new Target Records"
when
  $one   : RKEM_TARGET ( EQPNO == "1") &&
  $three : RKEM_TARGET ( EQPNO == "3")

then
// Assert the missing Equipment number record
$two : new RKEM_TARGET();
$two.setEQPNO("2");  // Set attribute
assert( $two );  <-- This does NOT work...
end

How do you assert a new Fact with a specific value in the attribute(s)?

THanks,
James


--
View this message in context:
http://www.nabble.com/Asserting-new-Facts-in-RHS...-tf3609763.html#a10086922
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fetching Facts from WM...

2007-04-09 Thread Steven Williams

Two ways you could do it:

List list = workingMemory.getObjects(Target.class);

or use a query:

drl:
query "target objects"
   Target()
end

code:
QueryResults results = workingMemory.getQueryResults( "target objects" );

cheers
Steve




On 4/10/07, jdepaul <[EMAIL PROTECTED]> wrote:



Suppose my client code initially asserts two Facts into WorkingMemory
instance:  one Source object and one TargetOne object.  As the rules get
applied, some of the rules may assert additional Target facts into WM.
How
can I retrieve all of the Target facts (however many were created) from
the
WorkingMemory after fireAllRules() method was called (regardless of how
many
Target objects were created as a result)?!

I will not know the concrete type of the target object types that were
asserted into WM instance, as they can be as many as 7 class sub-types
(TargetOne, TargetTwo, TargetThree), though they will all share a common
super-class (com.mypackage.Target).  Can someone show an example on how to
fetch the resulting Target objects after fireAllRules() is called and
filter
out the Target objects?

Thanks in advance -
James

--
View this message in context:
http://www.nabble.com/Fetching-Facts-from-WM...-tf3550451.html#a9912199
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Help : drools implementing

2007-04-05 Thread Steven Williams

J2EE does not allow File I/O so it may be that your app server does not
allow it by default and you need to give your application permission to do
it. This would generally be done in a policy file (in WebSphere it is
was.policy).

Steve

On 4/5/07, vista2007 <[EMAIL PROTECTED]> wrote:



I want to call rules from session bean. I implement this by calling a
utility
callss from the Session bean method.
That Utility class load the rule file as

"final Reader source = new
InputStreamReader(BaseRuleImpl.class.getResourceAsStream(rulefile));"

this gives the result as expected. But it throws an exception in the
server
as follows,(Server log)

java.lang.Throwable
at
com.sun.enterprise.loader.EJBClassLoader$SentinelInputStream.(
EJBClassLoader.java:1123)
at

com.sun.enterprise.loader.EJBClassLoader$InternalJarURLConnection.getInputStream
(EJBClassLoader.java:1216)
at java.net.URL.openStream(URL.java:1009)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java
:1161)
at
com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(
EJBClassLoader.java:782)
at java.lang.Class.getResourceAsStream(Class.java:2030)
at org.drools.semantics.java.RuleBuilder.(Unknown Source)
at org.drools.compiler.PackageBuilder.addRule(Unknown Source)
at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown
Source)
at
com.argosoftware.rules.impl.BaseRuleImpl.readRule(BaseRuleImpl.java:29)
at com.argosoftware.rules.impl.RuleImpl.fireRule(RuleImpl.java:54)
at
com.argosoftware.rules.ejb.session.LogicHandlerBean.ruleHandler(
LogicHandlerBean.java:42)

I think this is because of the IO operation.
Can anybody kindly suggest a solution for this.?

--
View this message in context:
http://www.nabble.com/Help-%3A-drools-implementing-tf3530032.html#a9851208
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] RE: Rules with Lookup Tables...

2007-03-08 Thread Steven Williams

Hi James,

The from keyword doesn't assert the list returned from
lookupDAO.getLookupValues - it asserts each value. So I think you want:

rule ...
when
  // getting the codes from the table
 $shCode : String() from lookupDAO.getLookupValues("MILT.CUSTNO" )

  // matching the objects if the code
  $gateIN : RKEM_Move( CUSTOMER_REFERENCE_NUMBER matches "^HX.*",
 ACTIVITY_LOCATION matches "^US.*",
 SH_CODE == $shCode )
then
 // do something
end

cheers
Steve

On 3/9/07, jdepaul <[EMAIL PROTECTED]> wrote:



Let me clarify my intentions:  the lookupDAO.getLookupValues(..) returns
an
ArrayList of String values.  I need to make sure that SH_CODES attribute
(String) of the RKEM_MOVE object  exists in that list of Strings.  Having
trouble with this syntax:

when
// Get a list of Strings in ArrayList form from the DB table
$lookupList : List() from lookupDAO.getLookupValues( "MILT.CUSTNO"
)

// Now do the comparison...
RKEM_Move (CUSTOMER_REFERENCE_NUMBER matches "^HX.*",
ACTIVITY_LOCATION matches "^US.*",
$lookupList contains SH_CODE) //
<-- if SH_CODE exists in the
$lookupList from DAO...
then...
   System.out.println("Found a Match Rule - about to inovke
Service...");

end


Please help -

James


Edson Tirelli-3 wrote:
>
>   I'm not sure I understood what you are trying to do

--
View this message in context:
http://www.nabble.com/Rules-with-Lookup-Tables...-tf3329159.html#a9374192
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Help - speaker needed

2007-03-06 Thread Steven Williams

Hi all,

I need to organise a speaker for a seminar in Melbourne (Australia) around
Business Rules. We are specifically interested in hearing about projects
that have implemented using rules engines (as opposed to hearing about rules
engine internals or theory).

So if you have used rules engines (it doesn't have to be Drools/JBoss Rules)
on a project and will be in Melbourne in the next few months and would be
interested in speaking, please let me know as soon as possible.

thanks a lot
Steve

--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Correlation of events

2007-02-28 Thread Steven Williams

I think you may want to use a global here:

global ErrorMetaData errorMetadata;

rule "new error"
   when
   $error : Error (state == NEW_ERROR)
   then
   (search workingmemory if this error was already registered)
   if (found)
   {
   errorMetadata.setLastTimestamp(currentTimestamp)
   retract($error);
   }
end


On 2/28/07, Framewala, Ashfaq Y <[EMAIL PROTECTED]> wrote:


 Hi,

I am working on a system where I need to correlate few error conditions
happening in the network infrastructure. I have gone through the
documentation for Jboss rules engine (Drools) and I am planning to use it
for the correlation purpose.

Can anyone let me know a way in which I can get an object from
workingmemory in the "then" part of the rule? For e.g., I need the
following

rule "new error"
when
$error : Error (state == NEW_ERROR)
then
(search workingmemory if this error was already
registered)
if (found)
{

$errFromWorkingMemory.setLastTimestamp(currentTimestamp)
retract($error);
}
End

Thanks,
Ashfaq




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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [newbie] Using rules to enforce constraints?

2007-02-22 Thread Steven Williams

Hi Scott,

You could do the second rule many different ways. One that springs to mind
is to assert a Transaction object at the start of a transaction and use
that, ie.:

when
c: Customer (status == "suspended")
Transaction(transactionType == TransactionType.NEW_ORDER, customer == c)
then
...

Something along those lines - basically just think about what information
you have at the instigation of the transaction that would allow you to
determine the type of the transaction and the customer and assert them. If
you are only asserting one customer into the WM then you could do away with
needing a customer property on the Transaction object as you could assume
it.

cheers
Steve

On 2/23/07, Scott Finnie <[EMAIL PROTECTED]> wrote:


Doh!

rule 2 should of course read

"A suspended customer may /not/ place any orders"

Sorry.

Scott Finnie wrote:
> Hi,
>
> Apologies if this has been covered somewhere, couldn't find it in the
> archives.
>
> I'm wondering about ability / sensibility of above.  For example, say I
> want to model the following rules:
>
> 1. A customer must be suspended if they default on a payment
> 2. A suspended customer may place any orders
>
> Now the first one I can readily map to the when/then format of
> production rules.  But I can't see how to elegantly represent the second
> one - at least not in a transactionally clean manner.  I could write:
>
> when
> c: Customer (status == "suspended")
> o: Order ( customer == c)
> then
> o.reject() #etc.
>
> But that's not really what I want to achieve.  Rather, I'd like the
> check enforced before the order was created, not after.
>
> Or maybe I'm just thinking wrong?  Main influence is RDBMS, where I'd
> write a trigger that would stop the transaction completing if violated.
>
> Hope that makes sense, and thanks in advance.
>
>  - Scoot.
>
> ___
> 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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] conditional insert of 'exist' or 'not' keywords in decision table s

2007-02-20 Thread Steven Williams

Hi Vlad,

I can certainly look at adding some extra config options to the listeners to
allow an end row/column to be specified. I'm not sure the other things would
be useful to many people (correct me if I'm wrong).

If you do go down the preprocessing option you could use JXL instead of POI
as you will already have a dependency on it for the drools decision table
stuff. I'm not sure why we changed from POI to JXL but I have found it very
easy to use.

cheers
Steve

On 2/21/07, Olenin, Vladimir (MOH) <[EMAIL PROTECTED]> wrote:


 Hi, Steve.



That might help, though will require one 'external' run over the
spreadsheet (ie, open Excel through POI and read some column with rule
template names) or a separate config file which matches rules with
appropriate templates. Regarding the ExternalSheetListener constructor, is
there a way to set the number of records to read? From what I see (the API
call), the l1 will process the same data as l2 does (when the compiler will
get to row '30') and the data for the second template might not be very
applicable for the first template. Basically, the thing is starting from row
30 the data merged with template 1 might generate invalid rules which is not
desirable. Any way to avoid it?



The main reason such functionality is required in the first place (in our
project at least) is that for some use cases the same data can mean slightly
different things and should result in slightly different rules. The number
of such 'groups' is quite large to split the 'rule data' into separate
spreadsheets and the differences between the data interpretation are quite
significant for coming up with some 'generic' data format (which could suit
all rule 'groups'). There is definitely a bunch of workarounds that can be
done, but most of them would require Excel spreadsheet preprocessing.



Within the existing API (from the example you attached) Excel
preprocessing might be the easiest thing to do. Unless there is some more
low level API which allows to insert 'interceptor' which would monitor each
record that is being read by compiler and create new listener if appropriate
entry is found in the particular column (eg, one column in the spreadsheet
might have template name entry which remains the same for all records below
unless changed to a new value)….. Smth along those lines J.





Thanks, Steve.



Vlad


 ------

*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Steven Williams
*Sent:* 19 February 2007 18:54
*To:* Rules Users List
*Subject:* Re: [rules-users] conditional insert of 'exist' or 'not'
keywords in decision table s



Hi Vlad,

There is a very basic wiki page on it 
(http://wiki.jboss.org/wiki/Wiki.jsp?page=DecisionTableTemplates
).

In terms of the functionality you mention you have your data having
knowledge of the rule templates whereas the current implementation is such
that the data has no knowledge of the templates. You can apply multiple rule
templates to the same data however (as in
ExternalSpreadsheetCompilerIntegrationTest):

final ExternalSpreadsheetCompiler converter = new
ExternalSpreadsheetCompiler();
final List listeners = new ArrayList();
ExternalSheetListener l1 = new ExternalSheetListener(10, 3,
"/templates/test_pricing1.drl");
listeners.add(l1);
ExternalSheetListener l2 = new ExternalSheetListener(30, 3,
"/templates/test_pricing2.drl");
listeners.add(l2);
converter.compile("/data/ExamplePolicyPricing.xls", InputType.XLS,
listeners);

This example assumes two sets of data in the one sheet, however they could
both have been applied to the same set (ie. the second listener could also
point to row 10, column 3). Would that accomplish what you need?

Steve


 On 2/20/07, *Olenin, Vladimir (MOH)* <[EMAIL PROTECTED] >
wrote:

Thanks, Steve. That really seems to do the trick. Are there any wiki pages
on this new functionality? Or for now one should refer to the source code &
unit tests?



I also wonder what other functionality the new templating engine has? Is
it possible to define different 'types' of rules in the same 'rule' template
and refer to these types from 'Excel' data fields (eg, have one column per
rule where you can refer 'rule template XXX' from drl file; this value can
override some default value for example). If not, how such situations can be
handled? (ie, when one needs several type of rules driven by the same data?)



Thanks,



Vlad
 --

*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Steven Williams
*Sent:* 17 February 2007 04:25
*To:* Rules Users List
*Subject:* Re: [rules-users] conditional insert of 'exist' or 'not'
keywords in decision table s



Hi Vlad,

With the new decision table ha

Re: [rules-users] conditional insert of 'exist' or 'not' keywords in decision table s

2007-02-19 Thread Steven Williams

Hi Vlad,

There is a very basic wiki page on it
(http://wiki.jboss.org/wiki/Wiki.jsp?page=DecisionTableTemplates
).

In terms of the functionality you mention you have your data having
knowledge of the rule templates whereas the current implementation is such
that the data has no knowledge of the templates. You can apply multiple rule
templates to the same data however (as in
ExternalSpreadsheetCompilerIntegrationTest):

   final ExternalSpreadsheetCompiler converter = new
ExternalSpreadsheetCompiler();
   final List listeners = new ArrayList();
   ExternalSheetListener l1 = new ExternalSheetListener(10, 3,
"/templates/test_pricing1.drl");
   listeners.add(l1);
   ExternalSheetListener l2 = new ExternalSheetListener(30, 3,
"/templates/test_pricing2.drl");
   listeners.add(l2);
   converter.compile("/data/ExamplePolicyPricing.xls", InputType.XLS,
listeners);

This example assumes two sets of data in the one sheet, however they could
both have been applied to the same set (ie. the second listener could also
point to row 10, column 3). Would that accomplish what you need?

Steve



On 2/20/07, Olenin, Vladimir (MOH) <[EMAIL PROTECTED] > wrote:


 Thanks, Steve. That really seems to do the trick. Are there any wiki
pages on this new functionality? Or for now one should refer to the source
code & unit tests?



I also wonder what other functionality the new templating engine has? Is
it possible to define different 'types' of rules in the same 'rule' template
and refer to these types from 'Excel' data fields (eg, have one column per
rule where you can refer 'rule template XXX' from drl file; this value can
override some default value for example). If not, how such situations can be
handled? (ie, when one needs several type of rules driven by the same data?)



Thanks,



Vlad
 ------

*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Steven Williams
*Sent:* 17 February 2007 04:25
*To:* Rules Users List
*Subject:* Re: [rules-users] conditional insert of 'exist' or 'not'
keywords in decision table s



Hi Vlad,

With the new decision table handling you could use the following template
to do it:

Given a table as follows:

exists, 21, 25

, comprehensive

not, 64, 100

exists, comprehensive

the following template does what you want:

template header
driver[]
policy[]

package This_is_a_ruleset;
#generated from Decision Table
import example.model.Driver;
import example.model.Policy ;

template "Driver policy"
driver
policy

rule "driver policy $row.rowNumber$"
when
$driver0$
Driver(age >= $driver1$, age <= $driver2$)
$policy0$
Policy(type = "$policy1$")
then
//do smth
end
end template

the code to call it was:
public void testColumnKeywords() {
final ExternalSpreadsheetCompiler converter = new
ExternalSpreadsheetCompiler();
final String drl = converter.compile( "/data/TestWorkbook.xls",
"/templates/test_keywords.drl",
  InputType.XLS, 1, 1 ); // DT
starts at Row 1, Column 1
System.out.println(drl);
}

cheers
Steve

On 2/17/07, *Olenin, Vladimir (MOH)* < [EMAIL PROTECTED]>
wrote:

Hi,



I wonder if it's possible to pass some Column keywords as parameters from
template values, eg:



Condition

Condition

$1 Driver

$1 Policy

age >= $2, age <= $3

type

exists, 21, 25

, comprehensive

not, 64, 100

exists, comprehensive



I'd expect the above table would generate two rules like:



Rule 1

When

exists Driver (age >= 21, age <= 25)

Policy(type == "comprehensive")

Then

// do smth

End





Rule 2

When

not Driver (age >= 64, age <= 100)

exists Policy (type == "comprehensive")

then

// do smth

End







The above example is just a mock up derived from one of the examples in
the documentation to demonstrate the point (meaning, the rules themselves
might not make sense from business point of view or can be implemented
differently for this particular case).



So, any way to achieve this? Whether in current version (3.0.x) or the
upcoming release (3.2)



Thanks,



Vlad


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




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference

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





--
Steven Williams


Re: [rules-users] Handling ArrayList objects in rule conditions

2007-02-19 Thread Steven Williams

Hi,

To check the length of a Box object use:

when
$box : Box(length == 10)
then
...

There are two ways to iterate over your list depending the version you are
using. Assuming BoxList has a property boxes returning a collection. In
3.0.5 you can use:

when
BoxList($b : boxes)
then
for(Iterator it = $b.iterator();it.hasNext();) {
assert( it.next());
}
end

On trunk you can use the from keyword to combine the iteration and the rule

when
$list : BoxList()
$box : Box(length == 10) from $list.getBoxes()
then
...

cheers
Steve

On 2/19/07, Diwakar <[EMAIL PROTECTED]> wrote:



I am a beginner.
I have an ArrayList object - Say BoxList Object  containing 10 Box objects
.
I need to check if the length of the bos is 10cm on each box object.


How do I write this as rule condition.
Is there any way to write the rule for iterating the BoxList to check the
length of each box

Can you please help?

--
View this message in context:
http://www.nabble.com/Handling-ArrayList-objects-in-rule-conditions-tf3251245.html#a9037969
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.NoSuchMethodError:org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[

2007-02-19 Thread Steven Williams

you also need stringtemplate-2.3b6.jar

Steve

On 2/19/07, Nagabhushanam B <[EMAIL PROTECTED]> wrote:


hi
I am facing a problem while deployed it in websphere community edition.
My application is working fine when it is running in tomcat using jBoss
Rules... but the same thing if I deployed in Webspehere then its throwing
exception. i thought its because of antlr jar version mismatch , then i
replaced new version on antlr-2.7.6 & antlr-3.0ea8... still its giving the
following exception...

CharScannar : Parse ClassNotFoundException :
org.antlr.stringtemplate.language.ChunkTocken


Can any of you solve my problem.

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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Convert logic to DRL rules

2007-02-18 Thread Steven Williams

Hi Bill,

To implement your rules in 3.0.5 you would need to implement a rule for
each combination of age and zipCode.

$a : Person(age > 35 zipCode == 23546)
then
$a.setStatus("KT");

$a : Person(age < 25, zipCode == 23546 )
then
$a.setStatus("KT");

$a : Person(age > 35, zipCode == 68590)
then
$a.setStatus("KT");

etc..

Steve

On 2/19/07, Bill Zhang <[EMAIL PROTECTED]> wrote:


So Alex, if I only want to use the old syntax that is in production,
there is no way to implement my seemingly simple logic conditioning?

Thanks for your help.

On 2/18/07, Alexander Varakin <[EMAIL PROTECTED]> wrote:
> As far as I know this syntax is new and is available in SVN only, you
> will have to wait till 3.1 is released or take source from SVN and build
it.
>
> Bill Zhang wrote:
> > Hi Steven,
> >
> > Thank you very much for your help. Really appreciate.
> >
> > I still got the same error, Unexpected token '|'. I did not see "|" in
> > the document, only saw "||", which is supposed to be used with
> > columns.
> >
> > Ye
> >
> > On 2/18/07, Steven Williams <[EMAIL PROTECTED]> wrote:
> >> Hi Bill,
> >>
> >> I think it should be:
> >>
> >> $a : Person(age > 35 | < 25, zipCode == 23546 | == 68590)
> >>
> >> Edson, Mark or Michael can probably confirm or correct the above
syntax.
> >>
> >> Make sure you are running of the latest trunk.
> >>
> >> cheers
> >> Steve
> >>
> >>
> >> On 2/18/07, Bill Zhang <[EMAIL PROTECTED]> wrote:
> >> >
> >> > I tried:
> >> >
> >> > $a : Person(age > 35 || age < 25, zipCode == 23546 || == 68590)
> >> >
> >> > Errors:
> >> > org.drools.rule.InvalidRulePackage: unknown:39:30
> >> Unexpected token '||'
> >> > unknown:39:40 mismatched token:
> >> [EMAIL PROTECTED],1040:1041='<=',<47>,39:40];
> >> > expecting type '('
> >> > unknown:39:92 mismatched token:
> >> [EMAIL PROTECTED],1092:1092='<',<46>,39:92];
> >> > expecting type '('
> >> >
> >> > I also tried
> >> >
> >> > $a : Person(age > 35 | age < 25, zipCode == 23546 | == 68590)
> >> >
> >> > Pretty much the same error.
> >> >
> >> > Based on the document, "||" is only valid for columns...
> >> >
> >> >
> >> > On 2/17/07, Bill Zhang <[EMAIL PROTECTED]> wrote:
> >> > > Thank you Steve. But I got syntax error using the following.
> >> > >
> >> > > On 2/17/07, Steven Williams <[EMAIL PROTECTED]>
wrote:
> >> > > > In trunk I think you can use connective constraints:
> >> > > >
> >> > > > $a : Person(age > 35 | < 25, zipCode == 23546 | == 68590)
> >> > > > then
> >> > > > $a.setStatus("KT");
> >> > > >
> >> > > >
> >> > > >
> >> > > >
> >> > > > On 2/18/07, Bill Zhang < [EMAIL PROTECTED]> wrote:
> >> > > > >
> >> > > > > Hello,
> >> > > > >
> >> > > > > I am a new Drools user trying to convert the following simple
> >> logic
> >> into
> >> > > > DRL:
> >> > > > >
> >> > > > > IF (Person.Age > 35 OR Person.Age < 25) AND (Person.ZipCode =
> >> 23546
> >> or
> >> > > > > Person.ZipCode = 68590)
> >> > > > > THEN
> >> > > > > Person.Status = "KT";
> >> > > > >
> >> > > > > I found that it is not easy to convert the above logic into
> >> ONE DRL
> >> rule.
> >> > > > >
> >> > > > > I tried something like this
> >> > > > >
> >> > > > > when
> >> > > > > $a: Person(age>35) or Person (age<25)
> >> > > > > $b: Person(Zipcode==23456) or Person (ZipCode == 68590)
> >> > > > > $c: $a and $b
> >> > > > > Then
> >> > > > > $c.setStatus("KT")
> >> > > > >
> >> > > > > But looks like I can not use
> >> > > > > $c: $a and $b
> >> > > > &

Re: [rules-users] Convert logic to DRL rules

2007-02-18 Thread Steven Williams

Hi Bill,

I think it should be:

$a : Person(age > 35 | < 25, zipCode == 23546 | == 68590)

Edson, Mark or Michael can probably confirm or correct the above syntax.

Make sure you are running of the latest trunk.

cheers
Steve

On 2/18/07, Bill Zhang <[EMAIL PROTECTED]> wrote:


I tried:

$a : Person(age > 35 || age < 25, zipCode == 23546 || == 68590)

Errors:
org.drools.rule.InvalidRulePackage: unknown:39:30 Unexpected token '||'
unknown:39:40 mismatched token: [EMAIL PROTECTED],1040:1041='<=',<47>,39:40];
expecting type '('
unknown:39:92 mismatched token: [EMAIL PROTECTED],1092:1092='<',<46>,39:92];
expecting type '('

I also tried

$a : Person(age > 35 | age < 25, zipCode == 23546 | == 68590)

Pretty much the same error.

Based on the document, "||" is only valid for columns...


On 2/17/07, Bill Zhang <[EMAIL PROTECTED]> wrote:
> Thank you Steve. But I got syntax error using the following.
>
> On 2/17/07, Steven Williams <[EMAIL PROTECTED]> wrote:
> > In trunk I think you can use connective constraints:
> >
> > $a : Person(age > 35 | < 25, zipCode == 23546 | == 68590)
> > then
> > $a.setStatus("KT");
> >
> >
> >
> >
> > On 2/18/07, Bill Zhang <[EMAIL PROTECTED]> wrote:
> > >
> > > Hello,
> > >
> > > I am a new Drools user trying to convert the following simple logic
into
> > DRL:
> > >
> > > IF (Person.Age > 35 OR Person.Age < 25) AND (Person.ZipCode = 23546
or
> > > Person.ZipCode = 68590)
> > > THEN
> > > Person.Status = "KT";
> > >
> > > I found that it is not easy to convert the above logic into ONE DRL
rule.
> > >
> > > I tried something like this
> > >
> > > when
> > > $a: Person(age>35) or Person (age<25)
> > > $b: Person(Zipcode==23456) or Person (ZipCode == 68590)
> > > $c: $a and $b
> > > Then
> > > $c.setStatus("KT")
> > >
> > > But looks like I can not use
> > > $c: $a and $b
> > > becaue in Drools, you can only bind variable to column, not to other
> > varaibles.
> > >
> > > Please advise how to do this. I would imagine this should be quite
> > > simple, maybe I missed something quite obvious.
> > >
> > > I know that I can write custom Java method to do this, but if I do
> > > that, I suppose I lose the power of RETEOO pattern matching (pattern
> > resuing,
> > > etc.). So I prefer not to do that.
> > >
> > > I also understand I can break the above logic into 4 rules and that
> > > would be quite easy, but our business user is not used to think in
> > > that way. Also, we have more complex logic than the above. So what I
> > > want is to see if there is a way to convert this
> > > kind of logic in ONE DRL rule.
> > >
> > > Thanks in advance.
> > >
> > > Bill
> > > ___
> > > rules-users mailing list
> > > rules-users@lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> >
> >
> >
> > --
> > Steven Williams
> >
> > Supervising Consultant
> >
> > Object Consulting
> > Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
> > [EMAIL PROTECTED]
> > www.objectconsulting.com.au
> >
> > consulting | development | training | support
> > our experience makes the difference
> > ___
> > 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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Convert logic to DRL rules

2007-02-17 Thread Steven Williams

In trunk I think you can use connective constraints:

$a : Person(age > 35 | < 25, zipCode == 23546 | == 68590)
then
$a.setStatus("KT");



On 2/18/07, Bill Zhang <[EMAIL PROTECTED]> wrote:


Hello,

I am a new Drools user trying to convert the following simple logic into
DRL:

IF (Person.Age > 35 OR Person.Age < 25) AND (Person.ZipCode = 23546 or
Person.ZipCode = 68590)
THEN
Person.Status = "KT";

I found that it is not easy to convert the above logic into ONE DRL rule.

I tried something like this

when
$a: Person(age>35) or Person (age<25)
$b: Person(Zipcode==23456) or Person (ZipCode == 68590)
$c: $a and $b
Then
$c.setStatus("KT")

But looks like I can not use
$c: $a and $b
becaue in Drools, you can only bind variable to column, not to other
varaibles.

Please advise how to do this. I would imagine this should be quite
simple, maybe I missed something quite obvious.

I know that I can write custom Java method to do this, but if I do
that, I suppose I lose the power of RETEOO pattern matching (pattern
resuing,
etc.). So I prefer not to do that.

I also understand I can break the above logic into 4 rules and that
would be quite easy, but our business user is not used to think in
that way. Also, we have more complex logic than the above. So what I
want is to see if there is a way to convert this
kind of logic in ONE DRL rule.

Thanks in advance.

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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] conditional insert of 'exist' or 'not' keywords in decision table s

2007-02-17 Thread Steven Williams

Hi Vlad,

With the new decision table handling you could use the following template to
do it:

Given a table as follows:

 exists, 21, 25

, comprehensive

not, 64, 100

exists, comprehensive

the following template does what you want:

template header
driver[]
policy[]

package This_is_a_ruleset;
#generated from Decision Table
import example.model.Driver;
import example.model.Policy;

template "Driver policy"
driver
policy

rule "driver policy $row.rowNumber$"
   when
   $driver0$
   Driver(age >= $driver1$, age <= $driver2$)
   $policy0$
   Policy(type = "$policy1$")
then
   //do smth
end
end template
the code to call it was:
   public void testColumnKeywords() {
   final ExternalSpreadsheetCompiler converter = new
ExternalSpreadsheetCompiler();
   final String drl = converter.compile( "/data/TestWorkbook.xls",
"/templates/test_keywords.drl",
 InputType.XLS, 1, 1 ); // DT
starts at Row 1, Column 1
   System.out.println(drl);
   }

cheers
Steve

On 2/17/07, Olenin, Vladimir (MOH) <[EMAIL PROTECTED]> wrote:


 Hi,



I wonder if it's possible to pass some Column keywords as parameters from
template values, eg:



Condition

Condition

$1 Driver

$1 Policy

age >= $2, age <= $3

type

exists, 21, 25

, comprehensive

not, 64, 100

exists, comprehensive



I'd expect the above table would generate two rules like:



Rule 1

When

exists Driver (age >= 21, age <= 25)

Policy(type == "comprehensive")

Then

// do smth

End





Rule 2

When

not Driver (age >= 64, age <= 100)

exists Policy (type == "comprehensive")

then

// do smth

End







The above example is just a mock up derived from one of the examples in
the documentation to demonstrate the point (meaning, the rules themselves
might not make sense from business point of view or can be implemented
differently for this particular case).



So, any way to achieve this? Whether in current version (3.0.x) or the
upcoming release (3.2)



Thanks,



Vlad**

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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to generate rules from decision tables whereLHS has no field constraints

2007-02-15 Thread Steven Williams

Hi Martin,

The decision tables on trunk do what you want and should be available in the
3.1 release (I think). The new code separates the rule template from the
data and is more flexible than the current version. There are some
integration tests that demonstrate how to use it (have a look at
ExternalSpreadsheetCompilerIntegrationTest).

For your example you would use the following template:

template header
cheese
smell

package "com.cheese";

template "calculateSmell"
smell
rule "calculateSmell $row.rowNumber$"
 when
   cheese:Cheese()
 then
   cheese.setSmell("$smell$");
end
end template

I will put up some further doco on the wiki tonight.

cheers
Steve


On 2/15/07, Martin Weidner <[EMAIL PROTECTED]> wrote:


Hi Michael,

Thanks for  your reply.

Leaving a cell empty results in the condition not being added to the rule
at all. Which is fine, cause then you're more flexible in grouping rules
with different conditions together in one decision table
I actually found a way yesterday, which seems to me more like a
workaround. But it works:

| 1 | RuleTable calculateSmell  |
| 2 |CONDITION| ACTION  |
| 3 | | cheese  |
| 4 | cheese:Cheese() | setSmell("$param"); |
| 5 | for every cheese| set smell to stinky |
| 6 | somevalue   | stinky  |

By declaring the variable not in the row right underneath below the
CONDITION cell, but in the row where you normally declare the conditions (
i.e. second row underneath the condition row
AND putting in some random value in the cell, that holds the parameter
value, you can generate the desired rule:

#From row number: 6
rule "calculateSmell_6"
when
cheese:Cheese()
then
cheese.setSmell("stinky");;
end

Leaving out the parameter value results in the when line being blank, so
you gotta fill in something.
I can live with that, but it seems to me more like a workaround, so I
would be kinda curious whether there is (or will be) an "official" way of
achieving this
Best regards,
Martin

Van: Michael Neale [mailto:[EMAIL PROTECTED]
Verzonden: donderdag 15 februari 2007 01:05
Aan: Rules Users List
Onderwerp: Re: [rules-users] How to generate rules from decision tables
whereLHS has no field constraints

you should be able to do that - just leave the constraint cells empty, or
put some comment in them.
On 2/14/07, Martin Weidner < [EMAIL PROTECTED]> wrote:
Hello,
Maybe I have overlooked something, but I couldn't find a way to generate a
simple rule from an excel decision table, where the left hand side contains
no field constraints?
i.e.
rule "do we have cheese"
WHEN
cheese: Cheese()
THEN
RHS
End
Is there a way to achieve this?
Thanks in advance,
Martin
_
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Focus before assertion - for pattern matching

2007-02-14 Thread Steven Williams

I am pretty sure that all rules in all agenda groups run pattern matching
and only those in the current agenda-group execute (at least that is the
default behaviour). You can see this by using the audit logging feature.

cheers
Steve

On 2/15/07, Michael Neale <[EMAIL PROTECTED]> wrote:


not quite sure what you are asking, but I think the answer is yes, or it
*should* be yes and there is a current limitation.

On 2/14/07, Nirmal.R < [EMAIL PROTECTED]> wrote:
>
>
> Hi,
> Can i set the focus to a particular agenda group where in  the engine
> tries
> to match the asserted object only to those set of rules
>
> Thank you
> Nirmal
> --
> View this message in context:
> 
http://www.nabble.com/Focus-before-assertion---for-pattern-matching-tf3227311.html#a8965077
> Sent from the drools - user mailing list archive at Nabble.com.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Help Needed

2007-02-12 Thread Steven Williams

Hi Shilpa,

You can pass your DAOs (or any other object) into the working memory as
globals and then use them in the consequence of your rules.

cheers
Steve

On 2/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:


 Hi,



I am using Drools 3.0 in our business logic. I need help in
the below situation





I will take the records from the database on daily basis and
each record is fact in the rule engine



I will check the fact against some constant value; if it
satisfies the condition then I need to update one field in the database.



I am using Ibatis as DAO framework.



How I can connect to database in *".drl"* file?



Please help me.



Thanks & Regards

Shilpa



The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com

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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] calls to 'Helper' classes in LHS - are they allowed?

2007-02-12 Thread Steven Williams

I believe there is a caveat on functions and helper methods called from the
LHS that they need to be constant over time (or at least over the life of
the working memory) which then allows matches to be computed as per normal.

Steve

On 2/13/07, Michael Suzio <[EMAIL PROTECTED]> wrote:


The JBoss guys can correct me if I'm wrong, but although I think that
works, what you've just done is eliminate any chance to precompute matches
and trim down the checks that need to happen to find a rule match.  Since
the engine can't know that Helper.transform("value") returns a constant
value, it has to re-run that every time and it has to reject for matches to
the rule constraint every time.

I'm sure this would really sink performance, in other words.  You can
easily see the effect -- write the rule this way and time it, and then write
it with the return value of Helper.transform being inlined, and I'm sure
there's a big difference.  It's the same as any other eval(...) situation in
Drools; possible, but not good for performance.

On 2/12/07, Olenin, Vladimir (MOH) <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I was wondering if calls to a Helper class are allowed in LHS of the
> rule?
> Eg:
>
> Rule myRule
> When
> MyObject(objField == Helper.transform("value"))
> Then
>// smth
> End
>
>
> Thanks,
>
> Vlad
> ___
> 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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Parse bug in predicate constraints?

2007-02-08 Thread Steven Williams

Justine,

I would not suggest you allow a user to write rules in DRL. Consider
creating a DSL or a decision table that they could use.

regards
Steve

On 2/9/07, Justine Hlista <[EMAIL PROTECTED]> wrote:


Yay!! I was just looking into moving on to the trunk. Unfortunately we
have a code freeze tomorrow, so it might have to wait a few days.

Yes, apparently I made a typo when I typed in the example (trying to
simplify it, argh!). And while I said it was sensitive to whitespace, the
whitespace I actually meant was a line break. Here is the actual rule, which
will compile without a line break in the predicate. However, if I insert a
line break at the &&,  it throws:

rule "snapshot"
no-loop true
when
snap : Scalper120Values(id:uniqueId,
 shares:sharesFilled,
 buy:buyShares,
 sell:sellShares ->((shares.intValue() < (1/780) * ( buy.intValue()
+ sell.intValue()))&&((buy.intValue() + sell.intValue()) > 50)));
then
System.out.println("blah");
end


On 2/8/07, Edson Tirelli <[EMAIL PROTECTED]> wrote:
>
>
>Justine,
>
>It shouldn't be space sensitive. Where are you inserting the space
> that is giving you the error? I see your line bellow is missing a ')' in
> the end, but maybe it was a mistake when you wrote the e-mail... so,
> could you please clarify?
>
>In trunk the syntax was simplified to almost what you asked for. In
> trunk you can write:
>
>

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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.NoSuchMethodError

2007-02-07 Thread Steven Williams

Hi FBrum,

You will find the org.eclipse.jdt.core_3.2.0.v_642.jar in your
eclipse\plugins directory.

cheers
Steve

On 2/7/07, Francisco Brum <[EMAIL PROTECTED]> wrote:


 Hello everybody!



I'm having the same problem that you had, but when I run the project from
the JBoss Server and try do run the code with the JBoss rules, I get the
error:



java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

at
org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(
EclipseJavaCompiler.java:237)

at
org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(
Compiler.java:415)

at org.eclipse.jdt.internal.compiler.Compiler.compile(
Compiler.java:352)

at
org.apache.commons.jci.compilers.EclipseJavaCompiler.compile(
EclipseJavaCompiler.java:268)

at org.drools.compiler.PackageBuilder.compileAll(Unknown
Source)

at org.drools.compiler.PackageBuilder.addPackage(Unknown
Source)

at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown
Source)



I've downloaded the ecj.jar, which haves the
org\eclipse\jdt\internal\compiler\CompilationResult.class

with the getProblems() method, to the \lib folder of the server!

But it seems that this ecj.jar haves some conflict, because there are
times that it works and others it doesn't.



So I have tried do look for the org.eclipse.jdt.core_3.2.0.v_642.jar

In my org.drools.ide_3.0.5, but didn't found it. Don't know where to!!



What should I do?



Thanks in advanced for your attention

FBrum.



History of a similar problem solved in this mailing list:

shilpa.raghavendra
Sun, 28 Jan 2007 23:38:14 -0800

Thank you very much Steve its working fine.



-Original Message-

From: [EMAIL PROTECTED]

[mailto:[EMAIL <%5BEMAIL> PROTECTED] On Behalf Of Steven

Williams

Sent: Monday, January 29, 2007 10:20 AM

To: Rules Users List

Subject: Re: [rules-users] java.lang.NoSuchMethodError





Sorry Shilpa - I was looking at 3.0.5. What I said still holds true though -

make sure the v642 jar is at the top of your runtime classpath.



On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>

wrote:







  I am using org.drools.ide_3.0.4 as eclipse plug-in it's having

org.eclipse.jdt.core_3.2.0.v_642.jar







Still I have to use higher version







Regards



Shilpa





__

Francisco Brum - [EMAIL PROTECTED] <[EMAIL PROTECTED]>
*Link Consulting* - http://www.link.pt/

Tel.: 213 100 031
Av. Duque D'�vila, 23 4� Esq.
1000-138 Lisboa



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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Adding DROOLS/JBoss Rules to classpath

2007-02-06 Thread Steven Williams

In addition to that Kris I have noticed that I can't attach source to any of
the drools jars in eclipse - it seems to treat these jars differently. Do
you know how we can attach the source?

thanks
Steve

On 2/7/07, Kris Verlaenen <[EMAIL PROTECTED]> wrote:


 Currently, a JBoss Rules project is just a Java project with two
additional characteristics:
 * The JBoss Rules classpath container is added to the classpath of the
project
 * A JBoss Rules builder automatically checks all rules for possible
errors

In the current version of the IDE (3.0.5) you can only convert existing
projects to JBoss rules projects by manually altering the .project and
.classpath files as described in the documentation.  The latest version in
trunk already contains a shortcut where you can right-click the .project
file and select the "Convert to JBoss Rules Project" action.  I will see
whether it is possible to add the JBoss Rules classpath container to the
list of libraries that can be added.

Kris


- Original Message -
*From:* Grimshaw, Jeffrey <[EMAIL PROTECTED]>
*To:* Rules Users List 
*Sent:* Monday, February 05, 2007 7:23 PM
*Subject:* [rules-users] Adding DROOLS/JBoss Rules to classpath

Hi all.  I'm having some trouble adding the JBoss Rules custom classpath
container to an existing project in Eclipse.  I can do it by adding the
following line to the project's .classpath file:



Is there another/better way to do this?  I would expect to be able to do
it somewhere in Build Path --> Add Libraries…, but I have had no luck.

Thanks,

-- Jeff Grimshaw

 --

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


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm for more
information.

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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] class loading issue with websphere 6.1

2007-01-30 Thread Steven Williams

Hi Vishal,

It was a while ago but I think the main problems were NullPointerExceptions
on compilation errors. We also wanted to use Java 5 syntax. I recall seeing
something from Michael or Mark suggesting Janino was not as good as Eclipse
so maybe search the list as well.

cheers
Steve

On 1/29/07, Vishal Joshi <[EMAIL PROTECTED]> wrote:



Thanks Steve,

What kind of problem have you seen (or you anticipate) with JANINO?

cheers,
Vishal

Steven Williams-3 wrote:
>
> Hi Vishal,
>
> We found the JANINO compiler to be less than ideal (plus we wanted to
use
> Java 5 syntax which only JDT supports).
>
> I think WebSphere has gone to 6.1.0.5 just recently.
>
> cheers
> Steve
>
> On 1/22/07, Vishal Joshi <[EMAIL PROTECTED]> wrote:
>>
>>
>> Thanks Steve,
>> I tried PARENT_LAST option, but that did not help. I will consider
>> upgrading
>> to 6.1.0.3.
>> in the meanwhile i have the solution to this, by using JANINO instead
of
>> ECLIPSE.
>>
>> cheers,
>> Vishal
>>
>> Steven Williams-3 wrote:
>> >
>> > Hi Vishal,
>> >
>> > We had similar problems which we resolved by upgrading to WebSphere
>> > 6.1.0.3.
>> > This version uses the same 3.2 jars as jboss rules. An alternative
>> > solution
>> > to this is to make sure that you are using the PARENT_LAST
classloading
>> > policy for your application and making sure the required jars are in
>> your
>> > ear (depending on how far along you are in development I would
suggest
>> > making this change anyway as it ensures the application jars are used
>> in
>> > preference to the server's). I'll put something up on the wiki for
>> > troubleshooting with WebSphere.
>> >
>> > cheers
>> > Steve
>> >
>> > On 1/19/07, Vishal Joshi <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> This is resolved now.
>> >> For benefit of others, i added the system variable in websphere
>> console
>> >> drools.compiler=JANINO
>> >> This at runtime uses janino compiler api instead of using eclipse
>> >> compiler,
>> >> which seems to have conflict with the websphere app server's
internal
>> >> eclipse API.
>> >>
>> >>
>> >>
>> >> Vishal Joshi wrote:
>> >> >
>> >> > or alternatively can we configure jboss rules to use janino
compiler
>> >> > instead of eclipse compiler?
>> >> >
>> >> >
>> >> > Vishal Joshi wrote:
>> >> >>
>> >> >> Just to re-iterate
>> >> >> commons-jci-core-1.0-406301.jar has this class CompilationResult
>> (with
>> >> >> different packaging) which does NOT have getProblems() method.
>> >> >> But I have another jar core-3.2.0.666.jar in my application,
which
>> has
>> >> >> org.eclipse.jdt.internal.compiler.CompilationResult class with
>> >> >> getProblems() method as expected.
>> >> >> so this class with the required method is definitely there in the
>> >> >> classpath.
>> >> >>
>> >> >> is there any other jar that is missing? or anything else?
>> >> >>
>> >> >>
>> >> >> Vishal Joshi wrote:
>> >> >>>
>> >> >>> It is working fine with websphere 6.0.2.3 and the same
>> application's
>> >> >>> rule engine module does not work with websphere 6.1.
>> >> >>>
>> >> >>> My application has all these JCI jars bundled:
>> >> >>> commons-jci-core-1.0-406301.jar
>> >> >>> commons-jci-eclipse-3.2.0.666.jar
>> >> >>> commons-jci-janino-2.4.3.jar
>> >> >>>
>> >> >>> anything that is missing?
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> Mark Proctor wrote:
>> >> >>>>
>> >> >>>> Have you included all the JCI jars and the correct versions?
>> >> >>>>
>> >> >>>> Mark
>> >> >>>> Vishal Joshi wrote:
>> >> >>>>> posting it again after successfule subscription.
>> >> >>>>> I have deployed my application on websphere 6.1, which
contains
>> >> Rule
>> >> >&

Re: [rules-users] java.lang.NoSuchMethodError

2007-01-28 Thread Steven Williams

Sorry Shilpa - I was looking at 3.0.5. What I said still holds true though -
make sure the v642 jar is at the top of your runtime classpath.

On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:




  I am using org.drools.ide_3.0.4 as eclipse plug-in it's having
org.eclipse.jdt.core_3.2.0.v_642.jar



Still I have to use higher version



Regards

Shilpa





-Original Message-
*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Steven Williams
*Sent:* Monday, January 29, 2007 9:15 AM
*To:* Rules Users List
*Subject:* Re: [rules-users] java.lang.NoSuchMethodError



Hi Shilpa,

It looks like you do not have org.eclipse.jdt.core_3.2.0.v_671.jar in your
classpath. You should find it in the eclipse/plugins directory - just add it
to your application's classpath.

cheers
Steve

On 1/29/07, * [EMAIL PROTECTED] <[EMAIL PROTECTED] >
wrote:



I am new to Drools. I wanted to put the rules in the project so I am
learning this.



So I have taken code sample from Maven Repository bur I am getting
following error.



To run the Example I Have used eclipse as IDE and the drl file in XML
format.





java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;


  at
org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(*
EclipseJavaCompiler.java:237* )

  at org.eclipse.jdt.internal.compiler.Compiler.compile(*
Compiler.java:454* )

  at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile(*
EclipseJavaCompiler.java:268* )

  at org.drools.compiler.PackageBuilder.compileAll(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown
Source)

  at org.drools.examples.HonestPoliticianExample.main(*
HonestPoliticianExample.java:20* )

java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;


  at
org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(*
EclipseJavaCompiler.java:237* )

  at org.eclipse.jdt.internal.compiler.Compiler.compile(*
Compiler.java:454* )

  at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile(*
EclipseJavaCompiler.java:268* )

  at org.drools.compiler.PackageBuilder.compileAll(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown
Source)

  at org.drools.examples.HonestPoliticianExample.main(*
HonestPoliticianExample.java:20* )

Exception in thread "main"



Please help me fix this.



Thanks in advance



Thanks & Regards

Shilpa


The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com


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




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com

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






--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___

Re: [rules-users] java.lang.NoSuchMethodError

2007-01-28 Thread Steven Williams

Hi Shilpa,

The error occurs when you have an earlier version of the jdt jar higher up
in your classpath than the v_671 jar, so make sure v_671 is up near the top.

cheers
Steve

On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:


 Hi,



I am using org.drools.ide_3.0.4 as eclipse plug-in it's having
the jar what you have mentioned.



Still I am getting that error.



Regards

Shilpa

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com

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






--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] java.lang.NoSuchMethodError

2007-01-28 Thread Steven Williams

Hi Shilpa,

It looks like you do not have org.eclipse.jdt.core_3.2.0.v_671.jar in your
classpath. You should find it in the eclipse/plugins directory - just add it
to your application's classpath.

cheers
Steve

On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:




I am new to Drools. I wanted to put the rules in the project so I am
learning this.



So I have taken code sample from Maven Repository bur I am getting
following error.



To run the Example I Have used eclipse as IDE and the drl file in XML
format.





java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

  at
org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(*
EclipseJavaCompiler.java:237*)

  at org.eclipse.jdt.internal.compiler.Compiler.compile(*Compiler.java
:454*)

  at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile(*
EclipseJavaCompiler.java:268*)

  at org.drools.compiler.PackageBuilder.compileAll(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown
Source)

  at org.drools.examples.HonestPoliticianExample.main(*
HonestPoliticianExample.java:20*)

java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

  at
org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult(*
EclipseJavaCompiler.java:237*)

  at org.eclipse.jdt.internal.compiler.Compiler.compile(*Compiler.java
:454*)

  at org.apache.commons.jci.compilers.EclipseJavaCompiler.compile(*
EclipseJavaCompiler.java:268*)

  at org.drools.compiler.PackageBuilder.compileAll(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)

  at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown
Source)

  at org.drools.examples.HonestPoliticianExample.main(*
HonestPoliticianExample.java:20*)

Exception in thread "main"



Please help me fix this.



Thanks in advance



Thanks & Regards

Shilpa

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com

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






--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] RE: Why not retracting?

2007-01-27 Thread Steven Williams

Hi Mike,

I suggest using the Audit view in eclipse (documented in the help) which
will allow you to see what rules are being added to and removed from the
agenda.

cheers
Steve

On 1/27/07, Anstis, Michael (M.) <[EMAIL PROTECTED]> wrote:


 Thanks Jeff - I guess Rules Engines were common New Years resolution (I'm
about 2 weeks in too) ;-)

I understood that the LHS side was operated upon when Facts were asserted
which, I think, creates the RHS Activation in the Agenda. However I also
thought that if the RHS modified Facts in the Working Memory (by retracting,
asserting or modifying them) the "Two Phase Execution" (Agenda, Section
1.6.5) reassessed which rules needed "firing" (activation?) and hence some
of the "Cost - calculate cost for 'Stamping process' on a process" rules (in
my example below) would be disposed of. Is the activation not being dropped
(perhaps because the "machine == ( m )" condition is still met all be it
that the Price to which it relates as been disposed of?). I thought we
were encouraged to write rules that didn't need to be ran in any particular
order whereas I now find myself having to run some before others?

I'm not ranting at you Jeff, I'm just confused.

Cheers,

Mike

 --
*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Grimshaw, Jeffrey
*Sent:* 26 January 2007 16:34
*To:* Rules Users List
*Subject:* RE: [rules-users] RE: Why not retracting?

 Hi Michael.  I've only been using JBoss Rules for about 2 weeks, so keep
that in mind when reading my reply.

The way I understand it works is that facts are evaluated against the LHS
of all the rules in the ruleset as they are asserted.  That is, when a fact
is added to the WorkingMemory, the engine determines which rules apply to
that fact.  You may expect that evaluation to take place when the rules are
"run".  This may have something to do with the behavior you are seeing.

For more info on what I'm talking about, see section 1.6.4.2 of the user
docs.

http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.5/html/index.html

Cheers,

--Jeff


 --
*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Anstis, Michael (M.)
*Sent:* Friday, January 26, 2007 8:08 AM
*To:* Rules Users List
*Subject:* [rules-users] RE: Why not retracting?

 By way of an update; if the retraction is made within a different Agenda
Group the rules work as expected.

However the problem of the retraction having no obvious affect when
operated within the same Agenda Group remains.

Is this a bug?

   _
   *From:  * Anstis, Michael (M.)
   *Sent:  * 26 January 2007 11:32
   *To:* 'Rules Users List'
   *Subject:   * Why not retracting?

   Hello,

   I have the following rules; one removes "Prices" that do not have
   the required "Economic Level" from working memory, the other calculates a
   "Costs":-

  rule "Cost - remove prices that do not have the required
  'Economic Level'"
  agenda-group "stamping-costs"
  //salience 1
  when
  p : Price ( economicLevel != ( Utilities.makeDate(1,
  1, 2007) ) )
  then
  System.out.println("Retracting "+p.toString());
  retract(p);
  end

  rule "Cost - calculate cost for 'Stamping process' on a
  process"
  agenda-group "stamping-costs"
  //salience 2
  when
  r : ResourceEntry ( m : machine )
  //p : Price ( economicLevel == ( Utilities.makeDate(1,
  1, 2007) ), machine == ( m ) )
  p : Price ( machine == ( m ) )
  then
  Cost cost = new Cost(r, p);
  cost.setCost((float) (r.getUsage() * p.getRate()));
  assert(cost);
  end

   The problem is that the "Cost" rule still works upon ALL "Prices"
   (even those with an incorrect "Economic Level").

   If I change the line in the "Cost" rule to also check the "Economic
   Level" the rules work as expected (i.e. "Costs" are only calculated
   using "Prices" with an "Economic Level" of 01/01/2007).

   I've tried using "salience" levels too (as commented in the above
   Rules) but this doesn't have any effect either.

   What am I doing wrong?

   Cheers,

   Mike


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






--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rules to detect states in an object graph?!?

2007-01-23 Thread Steven Williams

Hi Michael,

To do the opposite approach (where the relationship is navigable from the
parent only) you can use the following:

when
   c : Child ( age > 18 )
   Parent ( children contains c, type == "SMURF" )

Of course this requires either

  - the child object in the children collection to be the same as the
  asserted child object or
  - the equals/hashcode method to be implemented appropriately in Child

cheers
Steve

On 1/24/07, Anstis, Michael (M.) <[EMAIL PROTECTED]> wrote:


 Sorry, me again,

I'm putting together some prototype rules that operate on related objects
in a graph of objects.

I'm adding all objects individually to working memory and then checking
the objects are related in the rule to ensure only valid combinations are
selected; for example:-

//Java code
parent.addChild(child)
wm.assertObject(parent);
wm.assertObject(child);

//Rule
rule "Adult smurfs"
when
c : Child ( age > 18, p : parent )
Parent ( parentId == ( p.parentId ), type == "SMURF" )
then
System.out.println("Smurf " + p.getName() + " is " + c.getAge() +
" years old."
end

rule "Adult clangers"
when
c : Child ( age > 18, p : parent )
Parent ( parentId == ( p.parentId ), type == "CLANGER" )
then
System.out.println("Clanger " + p.getName() + " is " + c.getAge()
+ " years old."
end

This requires that the parent-child relationship is navigable from the
child end of the relationship -- child.getParent().

What other approaches does anyone else use to implement rules that span
related objects?

With kind regards,

Michael Anstis
---
***Next Generation Estimating System*
( Trafford House (Int) 8 718 2239
( Trafford House (Ext) +44 (0)1268 702239
* <***mailto:[EMAIL PROTECTED] <[EMAIL PROTECTED]>>

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






--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] class loading issue with websphere 6.1

2007-01-21 Thread Steven Williams

Hi Vishal,

We found the JANINO compiler to be less than ideal (plus we wanted to use
Java 5 syntax which only JDT supports).

I think WebSphere has gone to 6.1.0.5 just recently.

cheers
Steve

On 1/22/07, Vishal Joshi <[EMAIL PROTECTED]> wrote:



Thanks Steve,
I tried PARENT_LAST option, but that did not help. I will consider
upgrading
to 6.1.0.3.
in the meanwhile i have the solution to this, by using JANINO instead of
ECLIPSE.

cheers,
Vishal

Steven Williams-3 wrote:
>
> Hi Vishal,
>
> We had similar problems which we resolved by upgrading to WebSphere
> 6.1.0.3.
> This version uses the same 3.2 jars as jboss rules. An alternative
> solution
> to this is to make sure that you are using the PARENT_LAST classloading
> policy for your application and making sure the required jars are in
your
> ear (depending on how far along you are in development I would suggest
> making this change anyway as it ensures the application jars are used in
> preference to the server's). I'll put something up on the wiki for
> troubleshooting with WebSphere.
>
> cheers
> Steve
>
> On 1/19/07, Vishal Joshi <[EMAIL PROTECTED]> wrote:
>>
>>
>> This is resolved now.
>> For benefit of others, i added the system variable in websphere console
>> drools.compiler=JANINO
>> This at runtime uses janino compiler api instead of using eclipse
>> compiler,
>> which seems to have conflict with the websphere app server's internal
>> eclipse API.
>>
>>
>>
>> Vishal Joshi wrote:
>> >
>> > or alternatively can we configure jboss rules to use janino compiler
>> > instead of eclipse compiler?
>> >
>> >
>> > Vishal Joshi wrote:
>> >>
>> >> Just to re-iterate
>> >> commons-jci-core-1.0-406301.jar has this class CompilationResult
(with
>> >> different packaging) which does NOT have getProblems() method.
>> >> But I have another jar core-3.2.0.666.jar in my application, which
has
>> >> org.eclipse.jdt.internal.compiler.CompilationResult class with
>> >> getProblems() method as expected.
>> >> so this class with the required method is definitely there in the
>> >> classpath.
>> >>
>> >> is there any other jar that is missing? or anything else?
>> >>
>> >>
>> >> Vishal Joshi wrote:
>> >>>
>> >>> It is working fine with websphere 6.0.2.3 and the same
application's
>> >>> rule engine module does not work with websphere 6.1.
>> >>>
>> >>> My application has all these JCI jars bundled:
>> >>> commons-jci-core-1.0-406301.jar
>> >>> commons-jci-eclipse-3.2.0.666.jar
>> >>> commons-jci-janino-2.4.3.jar
>> >>>
>> >>> anything that is missing?
>> >>>
>> >>>
>> >>>
>> >>> Mark Proctor wrote:
>> >>>>
>> >>>> Have you included all the JCI jars and the correct versions?
>> >>>>
>> >>>> Mark
>> >>>> Vishal Joshi wrote:
>> >>>>> posting it again after successfule subscription.
>> >>>>> I have deployed my application on websphere 6.1, which contains
>> Rule
>> >>>>> engine
>> >>>>> as one of the module using JBoss Rule 3.0.1. When i am trying to
>> >>>>> invoke
>> >>>>> drools api from my class
>> >>>>> 
>> >>>>> final PackageBuilder builder = new PackageBuilder();
>> >>>>> builder.addPackageFromDrl(new StringReader(drl));
>> >>>>> 
>> >>>>>
>> >>>>> it throws this exception:
>> >>>>>
>> >>>>> java.lang.NoSuchMethodError:
>> >>>>> org/eclipse/jdt/internal/compiler/CompilationResult
>> >>>>> .getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
>> >>>>> at
>> >>>>>
org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult
>> (E
>> >>>>> clipseJavaCompiler.java:237)
>> >>>>> at
>> >>>>> org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java
>> :335)
>> >>>>>
>> >>>>> at
>> >>>>> org.apache.commons.jci.compilers.EclipseJavaCompiler.compile
>> (EclipseJ

Re: [rules-users] class loading issue with websphere 6.1

2007-01-19 Thread Steven Williams

Hi Vishal,

We had similar problems which we resolved by upgrading to WebSphere 6.1.0.3.
This version uses the same 3.2 jars as jboss rules. An alternative solution
to this is to make sure that you are using the PARENT_LAST classloading
policy for your application and making sure the required jars are in your
ear (depending on how far along you are in development I would suggest
making this change anyway as it ensures the application jars are used in
preference to the server's). I'll put something up on the wiki for
troubleshooting with WebSphere.

cheers
Steve

On 1/19/07, Vishal Joshi <[EMAIL PROTECTED]> wrote:



This is resolved now.
For benefit of others, i added the system variable in websphere console
drools.compiler=JANINO
This at runtime uses janino compiler api instead of using eclipse
compiler,
which seems to have conflict with the websphere app server's internal
eclipse API.



Vishal Joshi wrote:
>
> or alternatively can we configure jboss rules to use janino compiler
> instead of eclipse compiler?
>
>
> Vishal Joshi wrote:
>>
>> Just to re-iterate
>> commons-jci-core-1.0-406301.jar has this class CompilationResult (with
>> different packaging) which does NOT have getProblems() method.
>> But I have another jar core-3.2.0.666.jar in my application, which has
>> org.eclipse.jdt.internal.compiler.CompilationResult class with
>> getProblems() method as expected.
>> so this class with the required method is definitely there in the
>> classpath.
>>
>> is there any other jar that is missing? or anything else?
>>
>>
>> Vishal Joshi wrote:
>>>
>>> It is working fine with websphere 6.0.2.3 and the same application's
>>> rule engine module does not work with websphere 6.1.
>>>
>>> My application has all these JCI jars bundled:
>>> commons-jci-core-1.0-406301.jar
>>> commons-jci-eclipse-3.2.0.666.jar
>>> commons-jci-janino-2.4.3.jar
>>>
>>> anything that is missing?
>>>
>>>
>>>
>>> Mark Proctor wrote:
>>>>
>>>> Have you included all the JCI jars and the correct versions?
>>>>
>>>> Mark
>>>> Vishal Joshi wrote:
>>>>> posting it again after successfule subscription.
>>>>> I have deployed my application on websphere 6.1, which contains Rule
>>>>> engine
>>>>> as one of the module using JBoss Rule 3.0.1. When i am trying to
>>>>> invoke
>>>>> drools api from my class
>>>>> 
>>>>> final PackageBuilder builder = new PackageBuilder();
>>>>> builder.addPackageFromDrl(new StringReader(drl));
>>>>> 
>>>>>
>>>>> it throws this exception:
>>>>>
>>>>> java.lang.NoSuchMethodError:
>>>>> org/eclipse/jdt/internal/compiler/CompilationResult
>>>>> .getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
>>>>> at
>>>>> org.apache.commons.jci.compilers.EclipseJavaCompiler$2.acceptResult
(E
>>>>> clipseJavaCompiler.java:237)
>>>>> at
>>>>> org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java
:335)
>>>>>
>>>>> at
>>>>> org.apache.commons.jci.compilers.EclipseJavaCompiler.compile
(EclipseJ
>>>>> avaCompiler.java:268)
>>>>> at org.drools.compiler.PackageBuilder.compile(Unknown
Source)
>>>>> at org.drools.compiler.PackageBuilder.compileRule(Unknown
>>>>> Source)
>>>>> at org.drools.compiler.PackageBuilder.addRule(Unknown
Source)
>>>>> at org.drools.compiler.PackageBuilder.addPackage(Unknown
>>>>> Source)
>>>>> at
>>>>> org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown
>>>>> Source)
>>>>>
>>>>>
>>>>> I have checked that class
>>>>> org.eclipse.jdt.internal.compiler.CompilationResult is available
with
>>>>> my
>>>>> application war in core-3.2.0.666.jar (which is part of drools
>>>>> distributable) and it has getProblems() method also.
>>>>>
>>>>> any help will be greatly appreciated.
>>>>>
>>>>
>>>> ___
>>>> rules-users mailing list
>>>> rules-users@lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>>
>>>>
>>>
>>>
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/class-loading-issue-with-websphere-6.1-tf3027390.html#a8430930
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





--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: Fw: [rules-users] rules questions...

2007-01-07 Thread Steven Williams

Joel,

Could you attach the drl file? I will see what I get in my environment.

cheers
Steve

On 1/8/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:


i tried that...
this is the error

28703 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
- org.drools.rule.InvalidRulePackage: Rule Compilation error Redefinition
of formal parameter "arrayList" Exception:1 errors while compiling unit
"com/prtc/struts/rules/Rule_pos_baja_feature_menu_0.java"

Joel G. Rivera-Gonzalez
PRT

"The first 90% of a project takes 90% of the time, the last 10% takes the
other 90% of the time" - Murphy's Law

- Original Message 
From: Steven Williams <[EMAIL PROTECTED]>
To: Joel G. Rivera-González <[EMAIL PROTECTED]>
Cc: drools 
Sent: Sunday, January 7, 2007 8:50:06 PM
Subject: Re: Fw: [rules-users] rules questions...

try

global java.util.ArrayList arrayList;

or

global java.util.List arrayList;

On 1/8/07, Joel G. Rivera-González < [EMAIL PROTECTED]> wrote:
>
> setting an ArrayList on a global value like this 
workingMemory.setGlobal("arrayList",
> menuArray); on the java code and like this on the rule global ArrayList
> arrayList;
>
> cause the following error:
> 23304 [main] FATAL
> com.prtc.struts.util.ConstructServiceAssuranceTreeMenu  - Exception in
> ShowIspServiceAssuranceAction.execute -->
> org.drools.rule.InvalidRulePackage: Rule Compilation error Redefinition
> of formal parameter "arrayList" Exception:1 errors while compiling unit
> "com/prtc/struts/rules/Rule_pos_baja_feature_menu_0.java"
>
>
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
> - Original Message 
> From: Steven Williams < [EMAIL PROTECTED]>
> To: Joel G. Rivera-González <[EMAIL PROTECTED]>
> Cc: drools 
> Sent: Sunday, January 7, 2007 6:00:41 PM
> Subject: Re: Fw: [rules-users] rules questions...
>
> Hi Joel,
>
> The whole point of globals is that you don't need to assert them you
> just set them from the calling code, ie:
>
> workingMemory.setGlobal("myList", arrayList);
>
> You can then use myList in your consequence.
>
> There is no way to use an asserted object in a consequence without
> binding it to a variable in one of the conditions.
>
> cheers
> Steve
>
>
> On 1/8/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:
> >
> > ok..after playing a while with this global thing...i found out that
> > global variables cant be asserted...
> >
> > any other idea of how to use an asserted arrayList on the consequence
> > without writing it on the conditions?
> >
> > Joel G. Rivera-Gonzalez
> > PRT
> >
> > "The first 90% of a project takes 90% of the time, the last 10% takes
> > the other 90% of the time" - Murphy's Law
> >
> > - Original Message 
> > From: Joel G. Rivera-González < [EMAIL PROTECTED]>
> > To: drools < rules-users@lists.jboss.org>
> > Sent: Sunday, January 7, 2007 10:48:50 AM
> > Subject: Re: Fw: [rules-users] rules questions...
> >
> > thanks for your input...this is exactly what i was looking for !
> >
> > :)
> >
> > Joel G. Rivera-Gonzalez
> > PRT
> >
> > "The first 90% of a project takes 90% of the time, the last 10% takes
> > the other 90% of the time" - Murphy's Law
> >
> > - Original Message 
> > From: Steven Williams < [EMAIL PROTECTED]>
> > To: Joel G. Rivera-González < [EMAIL PROTECTED]>
> > Cc: rules-users@lists.jboss.org
> > Sent: Sunday, January 7, 2007 3:53:34 AM
> > Subject: Re: Fw: [rules-users] rules questions...
> >
> > Hi Joel,
> >
> > I think you should rather use a global for the ArrayList:
> >
> > global java.util.List myList
> >
> > rule "cancel_menu"
> >   when
> > MegaTransferObject(other_EffectiveOrderTypeDsl != null,
> > other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE)
> > not MegaTransferObject(orders_FkOrderStatusId != null,
> > orders_FkOrderStatusId ==
> > Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
> >   then
> > myList.add(new String[]{
> > Constants.SERVICE_ASSURANCE_TREE_MENU_DSL ,
> > Constants.SERVICE_ASSURANCE_MENU_CANCEL});
> > end
> >
> > btw - you don't need to put "and" at the end of each constraint.
> >
> > cheers
> > Steve
> >
> > On 1/7/07, Joel G. Rivera-González <[EMAIL PROT

Re: Fw: [rules-users] rules questions...

2007-01-07 Thread Steven Williams

try

global java.util.ArrayList arrayList;

or

global java.util.List arrayList;

On 1/8/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:


setting an ArrayList on a global value like this 
workingMemory.setGlobal("arrayList",
menuArray); on the java code and like this on the rule global ArrayList
arrayList;

cause the following error:
23304 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
- Exception in ShowIspServiceAssuranceAction.execute -->
org.drools.rule.InvalidRulePackage: Rule Compilation error Redefinition of
formal parameter "arrayList" Exception:1 errors while compiling unit
"com/prtc/struts/rules/Rule_pos_baja_feature_menu_0.java"



Joel G. Rivera-Gonzalez
PRT

"The first 90% of a project takes 90% of the time, the last 10% takes the
other 90% of the time" - Murphy's Law

- Original Message 
From: Steven Williams <[EMAIL PROTECTED]>
To: Joel G. Rivera-González <[EMAIL PROTECTED]>
Cc: drools 
Sent: Sunday, January 7, 2007 6:00:41 PM
Subject: Re: Fw: [rules-users] rules questions...

Hi Joel,

The whole point of globals is that you don't need to assert them you just
set them from the calling code, ie:

workingMemory.setGlobal("myList", arrayList);

You can then use myList in your consequence.

There is no way to use an asserted object in a consequence without binding
it to a variable in one of the conditions.

cheers
Steve


On 1/8/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:
>
> ok..after playing a while with this global thing...i found out that
> global variables cant be asserted...
>
> any other idea of how to use an asserted arrayList on the consequence
> without writing it on the conditions?
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
> - Original Message 
> From: Joel G. Rivera-González < [EMAIL PROTECTED]>
> To: drools < rules-users@lists.jboss.org>
> Sent: Sunday, January 7, 2007 10:48:50 AM
> Subject: Re: Fw: [rules-users] rules questions...
>
> thanks for your input...this is exactly what i was looking for !
>
> :)
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
> - Original Message 
> From: Steven Williams < [EMAIL PROTECTED]>
> To: Joel G. Rivera-González < [EMAIL PROTECTED]>
> Cc: rules-users@lists.jboss.org
> Sent: Sunday, January 7, 2007 3:53:34 AM
> Subject: Re: Fw: [rules-users] rules questions...
>
> Hi Joel,
>
> I think you should rather use a global for the ArrayList:
>
> global java.util.List myList
>
> rule "cancel_menu"
>   when
> MegaTransferObject(other_EffectiveOrderTypeDsl != null,
> other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE)
> not MegaTransferObject(orders_FkOrderStatusId != null,
> orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
>
>   then
> myList.add(new String[]{
> Constants.SERVICE_ASSURANCE_TREE_MENU_DSL ,
> Constants.SERVICE_ASSURANCE_MENU_CANCEL});
> end
>
> btw - you don't need to put "and" at the end of each constraint.
>
> cheers
> Steve
>
> On 1/7/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:
> >
> >  this is a one of my rules...
> > rule "cancel_menu"
> > when
> > arrayList : ArrayList()
> > MegaTransferObject(other_EffectiveOrderTypeDsl != null,
> > other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE) and
> > not MegaTransferObject(orders_FkOrderStatusId != null,
> > orders_FkOrderStatusId ==
> > Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS )
> > then
> > arrayList.add(new String[]{
> > Constants.SERVICE_ASSURANCE_TREE_MENU_DSL ,
> > Constants.SERVICE_ASSURANCE_MENU_CANCEL});
> > end
> >
> > i do an assert of an empty arrayList...
> > when i use this  arrayList : ArrayList() on the when the rule fire an
> > error...why?
> > will the ArrayList be the same on all the rules (i think it will but
> > want to make sure)
> >
> > Joel G. Rivera-Gonzalez
> > PRT
> >
> > "The first 90% of a project takes 90% of the time, the last 10% takes
> > the other 90% of the time" - Murphy's Law
> >
> > - Original Message 
> > From: Kumaran S < [EMAIL PROTECTED]>
> > To: Joel G. Rivera-González <[EMAIL PROTECTED]>
> > Sent: Friday, January 5, 2007 5:42:01 PM
> &g

Re: Fw: [rules-users] rules questions...

2007-01-07 Thread Steven Williams

Hi Joel,

The whole point of globals is that you don't need to assert them you just
set them from the calling code, ie:

workingMemory.setGlobal("myList", arrayList);

You can then use myList in your consequence.

There is no way to use an asserted object in a consequence without binding
it to a variable in one of the conditions.

cheers
Steve


On 1/8/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:


ok..after playing a while with this global thing...i found out that global
variables cant be asserted...

any other idea of how to use an asserted arrayList on the consequence
without writing it on the conditions?

Joel G. Rivera-Gonzalez
PRT

"The first 90% of a project takes 90% of the time, the last 10% takes the
other 90% of the time" - Murphy's Law

- Original Message 
From: Joel G. Rivera-González <[EMAIL PROTECTED]>
To: drools 
Sent: Sunday, January 7, 2007 10:48:50 AM
Subject: Re: Fw: [rules-users] rules questions...

thanks for your input...this is exactly what i was looking for !

:)

Joel G. Rivera-Gonzalez
PRT

"The first 90% of a project takes 90% of the time, the last 10% takes the
other 90% of the time" - Murphy's Law

- Original Message 
From: Steven Williams <[EMAIL PROTECTED]>
To: Joel G. Rivera-González <[EMAIL PROTECTED]>
Cc: rules-users@lists.jboss.org
Sent: Sunday, January 7, 2007 3:53:34 AM
Subject: Re: Fw: [rules-users] rules questions...

Hi Joel,

I think you should rather use a global for the ArrayList:

global java.util.List myList

rule "cancel_menu"
  when
MegaTransferObject(other_EffectiveOrderTypeDsl != null,
other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE)
not MegaTransferObject(orders_FkOrderStatusId != null,
orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)

  then
myList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end

btw - you don't need to put "and" at the end of each constraint.

cheers
Steve

On 1/7/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:
>
>  this is a one of my rules...
> rule "cancel_menu"
> when
> arrayList : ArrayList()
> MegaTransferObject(other_EffectiveOrderTypeDsl != null,
> other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE) and
> not MegaTransferObject(orders_FkOrderStatusId != null,
> orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
> then
> arrayList.add(new String[]{
> Constants.SERVICE_ASSURANCE_TREE_MENU_DSL ,
> Constants.SERVICE_ASSURANCE_MENU_CANCEL});
> end
>
> i do an assert of an empty arrayList...
> when i use this  arrayList : ArrayList() on the when the rule fire an
> error...why?
> will the ArrayList be the same on all the rules (i think it will but
> want to make sure)
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
> - Original Message 
> From: Kumaran S < [EMAIL PROTECTED]>
> To: Joel G. Rivera-González <[EMAIL PROTECTED]>
> Sent: Friday, January 5, 2007 5:42:01 PM
> Subject: Re: [rules-users] rules questions...
>
> getResourceAsStream(ruleDrl) expects to find a drl file based on the
> location represented by " ruleDrl". It should be noted that the location
> should be accessible from the CLASSPATH.  You could get a null pointer
> exception, if the location is not accessible from your CLASSPATH.
>
>  On 1/5/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:
>
> > Trying to figure out the new rule system...
> > but it doesnt work...
> >
> > This is my rule:
> >
> > package com.prtc.struts.rules
> >
> > import com.prtc.db.MegaTransferObject
> > import java.util.ArrayList
> > import com.prtc.struts.Constants
> >
> > rule "cancel_menu"
> > when
> > megaTO : MegaexistMegaTransferObject()
> > megaTO(other_EffectiveOrderTypeDsl != null) and
> > megaTO(other_EffectiveOrderTypeDsl ==
> > Constants.NEW_OPEN_ORDER_TYPE ) and
> > megaTO(orders_FkOrderStatusId != null) and
> > megaTO(orders_FkOrderStatusId ==
> > Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
> >
> > then
> > System.out.println("Hello");
> > end
> >
> > part of my code:
> > InputStreamReader ir = new InputStreamReader(
> > RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl));
> > //the null pointer is from this line.
> > builder.addPackageFromDrl(ir);
> >
> > this is the 

Re: Fw: [rules-users] rules questions...

2007-01-07 Thread Steven Williams

Hi Joel,

I think you should rather use a global for the ArrayList:

global java.util.List myList

rule "cancel_menu"
 when
   MegaTransferObject(other_EffectiveOrderTypeDsl != null,
other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE)
   not MegaTransferObject(orders_FkOrderStatusId != null,
orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
 then
   myList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end

btw - you don't need to put "and" at the end of each constraint.

cheers
Steve

On 1/7/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:


this is a one of my rules...
rule "cancel_menu"
when
arrayList : ArrayList()
MegaTransferObject(other_EffectiveOrderTypeDsl != null,
other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE) and
not MegaTransferObject(orders_FkOrderStatusId != null,
orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
arrayList.add(new String[]{
Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end

i do an assert of an empty arrayList...
when i use this  arrayList : ArrayList() on the when the rule fire an
error...why?
will the ArrayList be the same on all the rules (i think it will but want
to make sure)

Joel G. Rivera-Gonzalez
PRT

"The first 90% of a project takes 90% of the time, the last 10% takes the
other 90% of the time" - Murphy's Law

- Original Message 
From: Kumaran S <[EMAIL PROTECTED]>
To: Joel G. Rivera-González <[EMAIL PROTECTED]>
Sent: Friday, January 5, 2007 5:42:01 PM
Subject: Re: [rules-users] rules questions...

getResourceAsStream(ruleDrl) expects to find a drl file based on the
location represented by "ruleDrl". It should be noted that the location
should be accessible from the CLASSPATH.  You could get a null pointer
exception, if the location is not accessible from your CLASSPATH.

On 1/5/07, Joel G. Rivera-González <[EMAIL PROTECTED]> wrote:

> Trying to figure out the new rule system...
> but it doesnt work...
>
> This is my rule:
>
> package com.prtc.struts.rules
>
> import com.prtc.db.MegaTransferObject
> import java.util.ArrayList
> import com.prtc.struts.Constants
>
> rule "cancel_menu"
> when
> megaTO : MegaexistMegaTransferObject()
> megaTO(other_EffectiveOrderTypeDsl != null) and
> megaTO(other_EffectiveOrderTypeDsl ==
> Constants.NEW_OPEN_ORDER_TYPE ) and
> megaTO(orders_FkOrderStatusId != null) and
> megaTO(orders_FkOrderStatusId ==
> Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
>
> then
> System.out.println("Hello");
> end
>
> part of my code:
> InputStreamReader ir = new InputStreamReader(
> RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl));
> //the null pointer is from this line.
> builder.addPackageFromDrl(ir);
>
> this is the result:
> 7661 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler  -
> compiling com.prtc.struts.rules.Rule_cancel_menu_0
> 7942 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler  -
> compile com.prtc.struts.rules.Rule_cancel_menu_0
> 8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler  -
> compiled com.prtc.struts.rules.Rule_cancel_menu_0
> 8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
> - compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
> 8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler  -
> compile com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
> 8092 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler  -
> compiled com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
>
> 8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
> - Exception in ShowIspServiceAssuranceAction.execute -->
> java.lang.NullPointerException
> 8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu  -
> java.lang.NullPointerException
> at com.prtc.struts.util.ConstructServiceAssuranceTreeMenu.construct(
> ConstructServiceAssuranceTreeMenu.java:74)
> at com.prtc.lc.rules.managers.RuleTester.test1(RuleTester.java:299)
> at com.prtc.lc.rules.managers.RuleTester.main(RuleTester.java:54)
>
>
>
>
>
>
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>