Re: [rules-users] Guvnor - support for custom file extensions

2012-05-14 Thread anchi
Nobody?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensions-tp3970683p3985342.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


Re: [rules-users] Guvnor - support for custom file extensions

2012-05-14 Thread Michael Anstis
Ordinarily you'll also need to look at contenthandler.properties and
creating your own ContentHandler implementation.

These define a class that can handle your additional type (serializing to
and de-serializing from whatever internal storage representation you want).

asseteditors.xml should also have an entry, if you plan on exposing an
editor for your asset type.

This should give you some more direction... but there might still be
something I've missed.

But, since you're only wanting to add a new file extension for BPMN2
processes you might not need the above

There might be other (jBPM, BPMN2 Designer specific) requirements, but the
above (and what you already know) are generic for most asset types.

With kind regards,

Mike

On 14 May 2012 08:51, anchi  wrote:

> Nobody?
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensions-tp3970683p3985342.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] Does Guvnor support calendar definitions

2012-05-14 Thread Michael Anstis
In a BRL guided rule (or Rule Template) click on the "Options" section at
the bottom of the editor and choose the "Calendars" attribute.

On 10 May 2012 16:11, FlyingEagle wrote:

> Hi,
>
> I have a rule, which only may be fired at night.
> So I have defined in the drl the following:
>
> rule "MyRule"
>calendars "night-hours" // defines daily interval from 0am to 6am
>when
>...
>then
>...
> end
>
> How can I define this in Guvnor?
>
> Thx
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Does-Guvnor-support-calendar-definitions-tp3977363.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] Error with Helloworld Drools projet

2012-05-14 Thread paco

Hello everybody,

I want to create my first drools projet with eclipse and I've got this
following error.

org.drools.RuntimeDroolsException: Unable to load dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
.
..
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in
the classpath

.
... 7 more

Please cant somebody tell me what's wrong with my program.
I've used an eclipse Eclipse Java EE IDE for Web Developers; and drools
4.0.7
Thanks


--
View this message in context: 
http://drools.46999.n3.nabble.com/Error-with-Helloworld-Drools-projet-tp3985433.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


Re: [rules-users] Error with Helloworld Drools projet

2012-05-14 Thread Wolfgang Laun
Since you are starting anew with Drools: why don't you use Drools
5.3.0 or 5.4.0?

-W


On 14/05/2012, paco  wrote:
>
> Hello everybody,
>
> I want to create my first drools projet with eclipse and I've got this
> following error.
>
> org.drools.RuntimeDroolsException: Unable to load dialect
> 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
>   .
> ..
> Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in
> the classpath
> 
> .
>   ... 7 more
>
> Please cant somebody tell me what's wrong with my program.
> I've used an eclipse Eclipse Java EE IDE for Web Developers; and drools
> 4.0.7
> Thanks
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Error-with-Helloworld-Drools-projet-tp3985433.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] Guvnor - support for custom file extensions

2012-05-14 Thread anchi
Thank you very much, I'll take a look at this!

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensions-tp3970683p3985455.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


Re: [rules-users] Error with Helloworld Drools projet

2012-05-14 Thread paco
Hello Laune! Because I'm following all istrution presented in the "JBoss
Drools Businness Rules"  book.
Is it due bye a version of the Drools?
Can you tell me can I find Drools 5.3.0 or 5.4.0?

Thanks
 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Error-with-Helloworld-Drools-projet-tp3985433p3985466.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


Re: [rules-users] Error with Helloworld Drools projet

2012-05-14 Thread Michael Anstis
Wolfgang suggests using 5.3 or 5.4 as both bring many, many new features
and improvements over 4.0.7.

You are also more likely to get help with a newer version (as most people
will say "have you tried with 5.3+) if you post problems relating to 4.0.x.

The problem you state is caused by not having
org.eclipse.jdt.core_3.6.2.v_A76_R36x.jar (or something named similarly,
depending on the version of Eclipse you are using, on your classpath).
AFAIK this is included with later (i.e. >5.2 onwards) versions of Drools.

If you Google for Drools you will easily encounter the Drools Home page and
links to download.

With kind regards,

Mike

On 14 May 2012 11:03, paco  wrote:

> Hello Laune! Because I'm following all istrution presented in the "JBoss
> Drools Businness Rules"  book.
> Is it due bye a version of the Drools?
> Can you tell me can I find Drools 5.3.0 or 5.4.0?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Error-with-Helloworld-Drools-projet-tp3985433p3985466.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] Guvnor REST API and XLS decision tables

2012-05-14 Thread anchi
Hi!

I'm wondering how does Guvnor REST api handle Excel decision tables? I'm
using 5.3.1.Final version.

It seems that when I use url for binary e.g.
/http://{guvnor_url}/rest/packages/package_name/assets/excel_table_name/binary/
, I get a source (.xls) file.
And when I use source url e.g.
/http://{guvnor_url}/rest/packages/package_name/assets/excel_table_name/source/
, I get a binary file.
Is this some bug or is it really expected to work this way?


Also, when I try to build binary file (which I get using source url:) )
using knowledge builder I'm getting exceptions, I have tried it in two ways:

1. kbuilder.add(urlResource, ResourceType.DTABLE);

Exception in thread "main"
org.drools.template.parser.DecisionTableParseException: An error occurred
opening the workbook. It is possible that the encoding of the document did
not match the encoding of the reader.
at
org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:90)
at
org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:89)
at
org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:68)
at
org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:38)
at
org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:21)
at
org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:18)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:613)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Caused by: jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.(CompoundFile.java:116)
at jxl.read.biff.File.(File.java:127)
at jxl.Workbook.getWorkbook(Workbook.java:268)
at
org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
... 8 more


2. kbuilder.add(urlResource, ResourceType.DRL);

java.lang.IndexOutOfBoundsException: Index: 693, Size: 693
at java.util.ArrayList.get(ArrayList.java:352)
at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:103)
at org.drools.lang.ParserHelper.reportError(ParserHelper.java:386)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:182)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Exception in thread "main" java.lang.RuntimeException:
org.drools.compiler.DroolsParserException: Unexpected exception raised while
parsing. This is a bug. Please contact the Development team :
Index: 693, Size: 693
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Caused by: org.drools.compiler.DroolsParserException: Unexpected exception
raised while parsing. This is a bug. Please contact the Development team :
Index: 693, Size: 693
at org.drools.compiler.DrlParser.compile(DrlParser.java:242)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
... 2 more


--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-API-and-XLS-decision-tables-tp3985574.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


Re: [rules-users] Error with Helloworld Drools projet

2012-05-14 Thread paco
Your contribution is very helphul.
I'm going to install  Drools 5.3.0.
I hope it will work well. 

Thanks very much

--
View this message in context: 
http://drools.46999.n3.nabble.com/Error-with-Helloworld-Drools-projet-tp3985433p3985595.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] The drools.packagebuilder.conf directory

2012-05-14 Thread Carolina Pellecchia
Hi all

I am novice on GUVNOR/DROOLS, but I  defined some Drools Evaluator
functions and to make the function available to the rules engine I inserted
drools.packagebuilder.conf  into user home directory. Is there different
directory to do this?



Thank you in advance,

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


Re: [rules-users] The drools.packagebuilder.conf directory

2012-05-14 Thread Michael Anstis
Guvnor doesn't support use of custom Drools Evaluators at this time.

However, if you mean to more simply use with Drools Expert then
thismight
be of assistance.

With kind regards,

Mike

On 14 May 2012 15:50, Carolina Pellecchia wrote:

> Hi all
>
> I am novice on GUVNOR/DROOLS, but I  defined some Drools Evaluator
> functions and to make the function available to the rules engine I inserted
> drools.packagebuilder.conf  into user home directory. Is there different
> directory to do this?
>
>
>
> Thank you in advance,
>
> Carolina Pellecchia
>
> ___
> 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] The drools.packagebuilder.conf directory

2012-05-14 Thread Matteo Cusmai
Hi Micheal,
we are going to extend drools with spatio evaluators, so we need to use
them.
Are you sure that we cannot use custom evaluator by using DRL or DSL in
GUVNOR?

And if yes, do you foresee to add support for custom evaluator in GUVNOR?

Thanks a lot,
Matteo.

On Mon, May 14, 2012 at 5:02 PM, Michael Anstis wrote:

> Guvnor doesn't support use of custom Drools Evaluators at this time.
>
> However, if you mean to more simply use with Drools Expert then 
> thismight be of 
> assistance.
>
> With kind regards,
>
> Mike
>
> On 14 May 2012 15:50, Carolina Pellecchia 
> wrote:
>
>> Hi all
>>
>> I am novice on GUVNOR/DROOLS, but I  defined some Drools Evaluator
>> functions and to make the function available to the rules engine I inserted
>> drools.packagebuilder.conf  into user home directory. Is there different
>> directory to do this?
>>
>>
>>
>> Thank you in advance,
>>
>> Carolina Pellecchia
>>
>> ___
>> 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] The drools.packagebuilder.conf directory

2012-05-14 Thread Michael Anstis
Hmmm, to be honest, I don't know :/

I fear although you can add the evaluator in DRL (or DSL), e.g. "when
MyFact( aField myUberEvaluator[bField] )" it will fail to compile in
Guvnor, as we don't do anything explicit around custom evaluators (i.e.
look for a drools.packagebuilder.conf file etc). HOWEVER we don't do
anything explicitly to prevent their use either. So if the file is on a
classpath that is scanned by Drools Expert (that Guvnor uses to build the
binary package) it COULD work out of the box.

A great opportunity for some community feedback :)

With kind regards,

Mike

On 14 May 2012 16:22, Matteo Cusmai  wrote:

> Hi Micheal,
> we are going to extend drools with spatio evaluators, so we need to use
> them.
> Are you sure that we cannot use custom evaluator by using DRL or DSL in
> GUVNOR?
>
> And if yes, do you foresee to add support for custom evaluator in GUVNOR?
>
> Thanks a lot,
> Matteo.
>
>
> On Mon, May 14, 2012 at 5:02 PM, Michael Anstis 
> wrote:
>
>> Guvnor doesn't support use of custom Drools Evaluators at this time.
>>
>> However, if you mean to more simply use with Drools Expert then 
>> thismight be of 
>> assistance.
>>
>> With kind regards,
>>
>> Mike
>>
>> On 14 May 2012 15:50, Carolina Pellecchia 
>> wrote:
>>
>>> Hi all
>>>
>>> I am novice on GUVNOR/DROOLS, but I  defined some Drools Evaluator
>>> functions and to make the function available to the rules engine I inserted
>>> drools.packagebuilder.conf  into user home directory. Is there
>>> different directory to do this?
>>>
>>>
>>>
>>> Thank you in advance,
>>>
>>> Carolina Pellecchia
>>>
>>> ___
>>> rules-users mailing list
>>> rules-users@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools 5.4.0.Final and jBPM 5.3.0.Final are being released

2012-05-14 Thread Sean Su
The maven repository link is still pointing to CR1 instead of final.

Do we have final jars on Maven yet? If not, anyone knows when?

thanks

Sean

On Wed, May 9, 2012 at 3:04 AM, Toni Rikkola  wrote:

> Only blocker bugs can stop the release process.
> It is now too late to cherry pick bug fixes or documentation for the Final
> releases.
>
> Toni Rikkola
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
"But beware of the Dark Side. Anger, fear, aggression - the Dark Side of
the Force are they." -Yoda
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Score curruption exception in drools-planner-5.4.0.CR1

2012-05-14 Thread Christopher Dolan
I may be way off track, but I saw score corruption like yours in two cases:

1) broken .equals()/.hashCode() method.
I had a couple of model classes that accidentally looked at mutable data in 
their .equals() and .hashCode() methods. When these were applied as the cause 
of the constraint, the revert action then failed to find the constraint because 
the removed instance wasn't .equals() to the inserted instance. I solved this 
by reverting to Object.equals() and Object.hashCode().

2) broken variable assignment in aggregate predicates 
(https://issues.jboss.org/browse/JBRULES-3482)
This is fixed in 5.4.0.Final.
If your rules use collect() or accumulate() with a complicated first argument 
to either, then Drools becomes confused about which variable to assign the 
value to. In most cases, this results in a ClassCastException. But in some 
cases where the facts happened to be the same class, you ended up with the 
wrong fact assigned as the cause of the constraint.

Chris

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Nurlan
Sent: Friday, May 11, 2012 5:06 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Score curruption exception in drools-planner-5.4.0.CR1

Hi guys!
I have some exception and I don't know why?
My rule *someRuleId* has weight *1*
2012-05-12 03:47:08,224 [main] DEBUG Step index (570), time spend
(115566), score (0hard/0soft), initialized planning entity
(SomePlanningEntity [id=21, …]).
2012-05-12 03:47:08,465 [main] DEBUG Step index (571), time spend
(115807), score (0hard/0soft), initialized planning entity
(SomePlanningEntity [id=20, …]).
java.lang.IllegalStateException: Score corruption: the workingScore
(-4hard/0soft) is not the uncorruptedScore (0hard/0soft):
  The workingMemory has 4 ConstraintOccurrence(s) in excess:
someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=2482309, …],
SomePlanningEntity [id=54, …]]=1
someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=2482309, …],
SomePlanningEntity [id=57, …]]=1
someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=57, …],
SomePlanningEntity [id=2482309, …]]=1
someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=54, …],
SomePlanningEntity [id=2482309, …]]=1
  Check the score rules who created those ConstraintOccurrences. Verify that
each ConstraintOccurrence's causes and weight is correct.
at
org.drools.planner.core.score.director.AbstractScoreDirector.assertWorkingScore(AbstractScoreDirector.java:101)
at
org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider.doMove(DefaultGreedyDecider.java:111)
at
org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider.decideNextStep(DefaultGreedyDecider.java:78)
at
org.drools.planner.core.constructionheuristic.greedyFit.DefaultGreedyFitSolverPhase.solve(DefaultGreedyFitSolverPhase.java:63)
at
org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:183)
at
org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:151)
…
…


--
View this message in context: 
http://drools.46999.n3.nabble.com/Score-curruption-exception-in-drools-planner-5-4-0-CR1-tp3981199.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] 5.4.0.Final Eclipse plug-in exception

2012-05-14 Thread Sean Su
The generated dslr from "new drools source" can't be opened inside Eclipse
3.7 due to the following exception. It works fine in the previous version:

java.lang.ArrayIndexOutOfBoundsException: 1
at
org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea(StyledTextRenderer.java:230)

at org.eclipse.swt.custom.StyledText.handleResize(StyledText.java:6148)
at
org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5641)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
at org.eclipse.swt.widgets.Control.WM_SIZE(Control.java:5173)
at org.eclipse.swt.widgets.Scrollable.WM_SIZE(Scrollable.java:291)
at org.eclipse.swt.widgets.Composite.WM_SIZE(Composite.java:1662)
at org.eclipse.swt.widgets.Canvas.WM_SIZE(Canvas.java:454)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4603)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2526)
at
org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
at
org.eclipse.swt.widgets.Control.WM_WINDOWPOSCHANGED(Control.java:5408)
at org.eclipse.swt.widgets.Canvas.WM_WINDOWPOSCHANGED(Canvas.java:460)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4616)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
at org.eclipse.swt.internal.win32.OS.SetWindowPos(Native Method)
at org.eclipse.swt.widgets.Widget.SetWindowPos(Widget.java:1457)
at org.eclipse.swt.widgets.Control.forceResize(Control.java:1121)
at
org.eclipse.swt.widgets.ScrollBar.getThumbTrackBounds(ScrollBar.java:464)
at
org.eclipse.jface.text.source.SourceViewer$RulerLayout.computeScrollArrowHeights(SourceViewer.java:224)

at
org.eclipse.jface.text.source.SourceViewer$RulerLayout.getVerticalScrollArrowHeights(SourceViewer.java:204)

at
org.eclipse.jface.text.source.SourceViewer$RulerLayout.layout(SourceViewer.java:159)

at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1263)
at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1249)
at org.eclipse.swt.widgets.Composite.layout(Composite.java:664)
at org.eclipse.swt.widgets.Composite.layout(Composite.java:622)
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(AbstractRuleEditor.java:84)

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(DSLRuleEditor2.java:64)

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.PartPane.setVisible(PartPane.java:313)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)

at
org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)

at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)

at
org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:4

[rules-users] Using "collect" repeatedly over sub-groups of a fact

2012-05-14 Thread Mike Goldner
I have a single rule that includes a "collect" pattern to pass a collection
to the RHS.  However, what I now need to do fire this rule for multiple
collections based on groupings defined by attributes on the fact.

Here is an example:

Fact(a = 1, b = 1, c = 1)
Fact(a = 1, b = 1, c = 2)
Fact(a = 2, b = 1, c = 3)
Fact(a = 2, b = 2, c = 4)
Fact(a = 2, b = 2, c = 5)

I would like to create sub-groups based on the attributes 'a' and 'b'.  My
rule should fire three times for the facts listed above, providing the
corresponding collection of Fact.

The only solution that I can think of is to build a HashSet and add each
Fact to the HashSet using the attributes as keys.  I suppose it would have
to be a nested set since I can't define a multi-valued key class within a
rule.  I could then handle this HashSet in a RHS block.  However, I realize
that I'm completely subverting the whole rule languageŠ

Any suggestions?

Thanks,

Mike


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


[rules-users] Drools 5.4.0.Final released

2012-05-14 Thread Mark Proctor

http://blog.athico.com/2012/05/drools-540final-released.html
link contents pasted below---

We are happy to announce the release of Drools (Expert, Fusion, Planner, 
Guvnor) *5.4.0.Final*. jBPM 5.3.0 announcement will follow shortly and 
the link will be added when it does.


Documentation, Release Notes and Downloads are detailed below:

 * Download the zips from the bottom of the drools download page
   .
 o To try out the examples, just unzip one and run a
   runExamples.sh/.bat script.
 o See the JBoss Maven repository for a list of all released
   artifacts
   
.
 + It will be synced to Maven Central
   
   automatically in a couple of hours.
 * *Read the new and noteworthy changes here.
   
*

Try it out and give us some feed-back (user list 
, issue tracker 
).


Some new online videos, make sure you change youtube setting to 720:

*Build Pong in 13 Minutes*
http://www.youtube.com/watch?v=Omj4PR3v-nI

*Build a Graphical Adventure in 20 Minutes:*
http://www.youtube.com/watch?v=4CvjKqUOEzM 



*Guided Decision Tables*
http://vimeo.com/35472874

*Importing Excel Decision Tables*
http://vimeo.com/37033081http://vimeo.com/37033081 

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


Re: [rules-users] Using "collect" repeatedly over sub-groups of a fact

2012-05-14 Thread Wolfgang Laun
You have to establish one representative of each subgroup that is markedly
distinct from all of its siblings in the same subgroup. This triggers a
single firing for a unique a/b combination. Then you can collect all those
that match the representative. With attribute c being what it is in your
example:

Fact( $a: a, $b: b, $c: c )
not Fact( c < $c )
$list: List() from collect ( Fact( a == $a, b == $b ) )

-W

On 14 May 2012 21:05, Mike Goldner  wrote:

> I have a single rule that includes a "collect" pattern to pass a
> collection to the RHS.  However, what I now need to do fire this rule for
> multiple collections based on groupings defined by attributes on the fact.
>
> Here is an example:
>
> Fact(a = 1, b = 1, c = 1)
> Fact(a = 1, b = 1, c = 2)
> Fact(a = 2, b = 1, c = 3)
> Fact(a = 2, b = 2, c = 4)
> Fact(a = 2, b = 2, c = 5)
>
> I would like to create sub-groups based on the attributes 'a' and 'b'.  My
> rule should fire three times for the facts listed above, providing the
> corresponding collection of Fact.
>
> The only solution that I can think of is to build a HashSet and add each
> Fact to the HashSet using the attributes as keys.  I suppose it would have
> to be a nested set since I can't define a multi-valued key class within a
> rule.  I could then handle this HashSet in a RHS block.  However, I realize
> that I'm completely subverting the whole rule language…
>
> Any suggestions?
>
> Thanks,
>
> Mike
>
> ___
> 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] Guvnor REST API and XLS decision tables

2012-05-14 Thread Jervis Liu

On 2012/5/14 19:38, anchi wrote:

Hi!

I'm wondering how does Guvnor REST api handle Excel decision tables? I'm
using 5.3.1.Final version.

It seems that when I use url for binary e.g.
/http://{guvnor_url}/rest/packages/package_name/assets/excel_table_name/binary/
, I get a source (.xls) file.
And when I use source url e.g.
/http://{guvnor_url}/rest/packages/package_name/assets/excel_table_name/source/
, I get a binary file.
Is this some bug or is it really expected to work this way?

Hi, below is from the documentation:

/packages/{packageName}/assets/{assetName}/source 	GET 	plain/text 
none 	Returns the content of rule asset {assetName} contained in package 
{packageName}. If this is a binary asset, returns the binary data as a 
byte array. If the asset {assetName} does not exist, status 404 is 
returned.




Essentially this means /packages/{packageName}/assets/{assetName}/source 
and /packages/{packageName}/assets/{assetName}/binary both return the 
same content, which is a binary stream of the xls file in your case. The 
only difference between 
/packages/{packageName}/assets/{assetName}/source and 
/packages/{packageName}/assets/{assetName}/binary is that 
/packages/{packageName}/assets/{assetName}/binary has the returned file 
extension set, but /packages/{packageName}/assets/{assetName}/source 
does not.





Also, when I try to build binary file (which I get using source url:) )
using knowledge builder I'm getting exceptions, I have tried it in two ways:
To verify if the file returned from REST is corrupted or not, you can 
open it with Excel. If it works, then its sth else wrong with your 
KBuilder client.


Cheers,
Jervis


1. kbuilder.add(urlResource, ResourceType.DTABLE);

Exception in thread "main"
org.drools.template.parser.DecisionTableParseException: An error occurred
opening the workbook. It is possible that the encoding of the document did
not match the encoding of the reader.
at
org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:90)
at
org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:89)
at
org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:68)
at
org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:38)
at
org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:21)
at
org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:18)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:613)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Caused by: jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.(CompoundFile.java:116)
at jxl.read.biff.File.(File.java:127)
at jxl.Workbook.getWorkbook(Workbook.java:268)
at
org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
... 8 more


2. kbuilder.add(urlResource, ResourceType.DRL);

java.lang.IndexOutOfBoundsException: Index: 693, Size: 693
at java.util.ArrayList.get(ArrayList.java:352)
at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:103)
at org.drools.lang.ParserHelper.reportError(ParserHelper.java:386)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:182)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Exception in thread "main" java.lang.RuntimeException:
org.drools.compiler.DroolsParserException: Unexpected exception raised while
parsing. This is a bug. Please contact the Development team :
Index: 693, Size: 693
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Caused by: org.drools.compiler.DroolsParserException: Unexpected exception
raised while parsing. This is a bug. Please contact the Development team :
Index: 693, Size: 693
at org.drools.compiler.DrlParser.compile(DrlParser.java:242)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
..

Re: [rules-users] Different Thread Handling between fireAllRules() and fireUntilHalt()

2012-05-14 Thread totempole
The issue occurs only when fireUntilHalt() is launched in Drools-Spring
integration, like this,




**



When I invoke the same method in Java below, the issue doesn't show up.
Could it be a bug in Drools-Spring integration?
@Async
public void fireRulesUtilHalt() 
{
try {
getKsession().fireUntilHalt();  
} catch ( ConsequenceException e ) {
throw e;
}
}


--
View this message in context: 
http://drools.46999.n3.nabble.com/Different-Thread-Handling-between-fireAllRules-and-fireUntilHalt-tp3985748p3987310.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


Re: [rules-users] Score curruption exception in drools-planner-5.4.0.CR1

2012-05-14 Thread Nurlan Rakhimzhanov
On 15 May 2012 00:30, Christopher Dolan  wrote:

> I may be way off track, but I saw score corruption like yours in two cases:
>
> 1) broken .equals()/.hashCode() method.
> I had a couple of model classes that accidentally looked at mutable data
> in their .equals() and .hashCode() methods. When these were applied as the
> cause of the constraint, the revert action then failed to find the
> constraint because the removed instance wasn't .equals() to the inserted
> instance. I solved this by reverting to Object.equals() and
> Object.hashCode().
>

I don't think that problem with .equals() or .hashCode() methods, because
I'm using apache EqualsBuilder and apache HashCodeBuilder,
this is 1st, and 2nd my each planning entity has al least unique id.


> 2) broken variable assignment in aggregate predicates (
> https://issues.jboss.org/browse/JBRULES-3482)
> This is fixed in 5.4.0.Final.
> If your rules use collect() or accumulate() with a complicated first
> argument to either, then Drools becomes confused about which variable to
> assign the value to. In most cases, this results in a ClassCastException.
> But in some cases where the facts happened to be the same class, you ended
> up with the wrong fact assigned as the cause of the constraint.

yes, I'm using accumulate(), but not in this
rule(wxGroupChildClassesInSamePeriodWithDiffLessons) and I've switched to
5.4.Final version, same problem


> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of Nurlan
> Sent: Friday, May 11, 2012 5:06 PM
> To: rules-users@lists.jboss.org
> Subject: [rules-users] Score curruption exception in
> drools-planner-5.4.0.CR1
>
> Hi guys!
> I have some exception and I don't know why?
> My rule *someRuleId* has weight *1*
> 2012-05-12 03:47:08,224 [main] DEBUG Step index (570), time spend
> (115566), score (0hard/0soft), initialized planning entity
> (SomePlanningEntity [id=21, …]).
> 2012-05-12 03:47:08,465 [main] DEBUG Step index (571), time spend
> (115807), score (0hard/0soft), initialized planning entity
> (SomePlanningEntity [id=20, …]).
> java.lang.IllegalStateException: Score corruption: the workingScore
> (-4hard/0soft) is not the uncorruptedScore (0hard/0soft):
>  The workingMemory has 4 ConstraintOccurrence(s) in excess:
>someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=2482309, …],
> SomePlanningEntity [id=54, …]]=1
>someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=2482309, …],
> SomePlanningEntity [id=57, …]]=1
>someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=57, …],
> SomePlanningEntity [id=2482309, …]]=1
>someRuleId/NEGATIVE_HARD:[SomePlanningEntity [id=54, …],
> SomePlanningEntity [id=2482309, …]]=1
>  Check the score rules who created those ConstraintOccurrences. Verify that
> each ConstraintOccurrence's causes and weight is correct.
>at
>
> org.drools.planner.core.score.director.AbstractScoreDirector.assertWorkingScore(AbstractScoreDirector.java:101)
>at
>
> org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider.doMove(DefaultGreedyDecider.java:111)
>at
>
> org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider.decideNextStep(DefaultGreedyDecider.java:78)
>at
>
> org.drools.planner.core.constructionheuristic.greedyFit.DefaultGreedyFitSolverPhase.solve(DefaultGreedyFitSolverPhase.java:63)
>at
>
> org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:183)
>at
> org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:151)
>…
>…
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Score-curruption-exception-in-drools-planner-5-4-0-CR1-tp3981199.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
>



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


[rules-users] Unable to share model between different packages in Guvnor 5.0.0

2012-05-14 Thread devan.vanree...@gmail.com
Hi there,


Please assist.
I promote 2 POJO model jars and a declarative model to the global area in
Guvnor.
I then create a upload a new POJO model jar and declarative model but select
not to "create new" but to import the models from global area, however there
is nothing in the drop down of available assets to import from global area.

Please confirm what I might be doing wrong.

Thanks
Devan

--
View this message in context: 
http://drools.46999.n3.nabble.com/Unable-to-share-model-between-different-packages-in-Guvnor-5-0-0-tp3987530.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