Re: [rules-users] How to use global variables

2013-03-19 Thread Wolfgang Laun
You realize that each Integer is a unique, immutable object. Java softens the consequence by auto(un)boxing so that you can use Integer objects just like int variables. But Java isn't aware of some Integer being stored as a DRL global. Therefore, you'll have to call the KnowledgeRuntime method

Re: [rules-users] lua

2013-03-19 Thread jigna
Hi, Tried writing in following ways but it gives compilation error. I actually need to check if two( or more) errorpatterndata - patterns are existing over particular window time. What is the correct way to write the same? rule Fault when exists( ErrorPatternData

Re: [rules-users] lua

2013-03-19 Thread Wolfgang Laun
Your statement that... On 19/03/2013, jigna jigna.chha...@igate.com wrote: When I write in folloiwng way it doesnot give compilation error, however time window is individually applied to each one of this. which doesnot satisfy the requirement which is to ensure that both these( or more no of)

[rules-users] Temporal operator related business rule using Drools Guvnor

2013-03-19 Thread mahesh_kharat
I have written simple business rule through DRL which states that if second event comes after 1 min when the first event has come. This works fine. I want to achieve same thing using Drools Guvnor. But I am not able to see options for selecting temporal operators in drools guvnor. Has anyone

Re: [rules-users] Temporal operator related business rule using Drools Guvnor

2013-03-19 Thread Michael Anstis
Make sure you Fact type has been marked as an event. If you are using a Declarative Model you can add the annotation to the type in Guvnor. If you are using a POJO model you will still need to annotate it as an event in Guvnor using a Declarative Model that extends your POJO. This is covered in

Re: [rules-users] Temporal operator related business rule using Drools Guvnor

2013-03-19 Thread Michael Anstis
IIRC you will need to annotate the type using a Declarative Model in Guvnor and not using the package header (which is in reality exploiting a hack to include arbitrary DRL). Guvnor 6.0 does not have this limitation and marking a Type as an event either via the guided Declarative Model editor or

[rules-users] API for reading and writing rules

2013-03-19 Thread kurrent93
HI all Is there any samples or documentation for reading and writing of rules? The user case is we are trying to build a custom Rule Editor, and thus would like to write and read rules to/from our beans. Thanks -- View this message in context:

[rules-users] Rule activation when using from

2013-03-19 Thread wumb
Hi, is there a way to make drools re-evaluate the LHS of a rule when using from? What I try to achieve is, that following rule is evaluated for every call of fireAllRules() : global java.util.Calendar cal rule test when java.util.Calendar() from cal then System.out.println(here we

Re: [rules-users] Rule activation when using from

2013-03-19 Thread Wolfgang Laun
Since there's no way to achieve what you'd like to do: why don't you simply retract and reinsert the Calendar fact? -W On 19/03/2013, wumb w...@gameduell.de wrote: Hi, is there a way to make drools re-evaluate the LHS of a rule when using from? What I try to achieve is, that following rule

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread Michael Anstis
Rules are DRL that is a String. Where and how you choose to store the String is up to you. Please try to explain what you want to achieve a little more. On 19 March 2013 12:49, kurrent93 kurren...@gmail.com wrote: HI all Is there any samples or documentation for reading and writing of

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread Davide Sottara
As a RETE network is being created, DRL Rules are parsed into an internal descriptor structure (a high level AST) and then compiled into a RETE. There are APIs to create rules at the descriptor level: this can then be dumped back into DRL. To work at the DRL level directly, it's common to use

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread kurrent93
We will be storing the rules in guvnor - and will read/write to guvnor using the REST api. We would like to be able to read the rules into our domain model, without having to write a complex parser. In order to make a custom rule editor we need to be able to populate the UI with rule settings

Re: [rules-users] Rule activation when using from

2013-03-19 Thread wumb
Because it's not a fact, it's a global. What i basically want to do is to have one rule being fired exactly once for every call of fireAllRules(). The rule will operate on a global, that is why i asked the question this way. What would be the best/simplest way to fulfill that requirement? I

Re: [rules-users] Rule activation when using from

2013-03-19 Thread tari-manga
Given the type of object you have in the global (a Calendar) I suspect actually you may want to try writing the rules with the timers[1] attributes? Normally that approach solved for me when timer was involved and in this case the rule will be evaluated when the session clock changes, without

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread kurrent93
HI David Yes we are also looking into rule templates. We have come up with - what we believe - is a very natural, intuitive and visually appealing way to author rules. And it is tailored for our specific domain. One significant aspect of our work is that we are present drools authoring to end

Re: [rules-users] Rule activation when using from

2013-03-19 Thread Wolfgang Laun
If there's no change in the WM, no rule will fire (except for fancy things like rules with a timer). This is so because that't the whole point of a production system. It'll have to be a fact, inserted or modified. -W On 19/03/2013, wumb w...@gameduell.de wrote: Because it's not a fact, it's a

Re: [rules-users] How can I select planning-entities in the accumulate source-pattern based on a list of planning-variables?

2013-03-19 Thread Marco Malziotti
Try to move 'from' in 'from accumulate'. Pay attention to and in 'from accumulate'. $match : PeopleMatch() $match: Number( intValue 0 ) from accumulate( $people : List() from $match.people and

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread Stephen Masters
Depending on your model, it may be better to create a DSL as an intermediate language. That way you have a simplified language, which you control, to parse in and out, which could be tuned to your own domain model. Steve On 19 Mar 2013, at 14:36, kurrent93 kurren...@gmail.com wrote: HI

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread kurrent93
thanks Stephen My knowledge of DSLs is very limited. But isnt the problem still parsing in the DRL into the DSL? I dont really understand how a DSL helps - but that is probably due to my lack of knowledge here. On Tue, Mar 19, 2013 at 4:41 PM, Stephen Masters [via Drools]

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread Stephen Masters
If you are going to generate DRL, you need to parse your model into a much more general language and parse that language back into your model. The APIs don't save you from doing this, they just mean that you interact with an API to generate the code, and get some validation, rather than just

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread kurrent93
Thanks Steve Yes that sounds like a way forward. I'll do some research on creating a dsl. Any pointers are appreciated. Cheers On Tue, Mar 19, 2013 at 5:20 PM, Stephen Masters [via Drools] ml-node+s46999n4022887...@n3.nabble.com wrote: If you are going to generate DRL, you need to parse

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread Stephen Masters
Obviously I don't know what your rules and model look like, but it's worth considering. The DSL templates are designed to be parsed relatively easily, with a single clause per line, so although they are not always that readable (if they're generating a lot of DRL code), they do the job of

Re: [rules-users] API for reading and writing rules

2013-03-19 Thread kurrent93
thanks Steve, that would be greatly appreciated! I've just been reading up about Antlr and DSLs - all new territory. Here is a sample rule that we would be likely to generator. 1.|rule close old trades2.|dialect mvel3.|when4.|t : Tick( ) over window:length (1)5.|closeMe :

[rules-users] org.xmlpull.v1.XmlPullParserException [Planner 5.5.0.Final]

2013-03-19 Thread André Fróes
I'm receiving this exception when trying to run a model from web browser. I'm able to run it when I simulate in a class the data, but when I try it in my browser, i get this exception. I have no clue of why's that happening. (pom.xml is at the end of the email) - SEVERE: Error

Re: [rules-users] validation error on Template

2013-03-19 Thread IPatel
Hi I am having the same problems. When i click on the Load Template Data button nothing happens. Please let me know if you were able to solve the issue. -- View this message in context: http://drools.46999.n3.nabble.com/validation-error-on-Template-tp4022828p4022893.html Sent from the Drools:

Re: [rules-users] org.xmlpull.v1.XmlPullParserException [Planner 5.5.0.Final]

2013-03-19 Thread Geoffrey De Smet
planner uses xstream xstream uses xmlpull. Check if the xml pull jar is in your classpath (looks like the xstream jar is in your classpath). You can find it in the planner's zip's binaries folder. Op 19-03-13 20:17, Andr Fres schreef:

Re: [rules-users] validation error on Template

2013-03-19 Thread Michael Anstis
What version of Guvnor are you using? sent on the move On 19 Mar 2013 19:27, IPatel ishita.pa...@usbank.com wrote: Hi I am having the same problems. When i click on the Load Template Data button nothing happens. Please let me know if you were able to solve the issue. -- View this

Re: [rules-users] validation error on Template

2013-03-19 Thread kurrent93
I'm using 5.5 On Mar 19, 2013 8:54 PM, manstis [via Drools] ml-node+s46999n4022895...@n3.nabble.com wrote: What version of Guvnor are you using? sent on the move On 19 Mar 2013 19:27, IPatel [hidden email]http://user/SendEmail.jtp?type=nodenode=4022895i=0 wrote: Hi I am having the same

Re: [rules-users] validation error on Template

2013-03-19 Thread IPatel
i am using 5.5 as well -- View this message in context: http://drools.46999.n3.nabble.com/validation-error-on-Template-tp4022828p4022897.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list

Re: [rules-users] validation error on Template

2013-03-19 Thread Michael Anstis
Ok. Thanks. I'll take a look tomorrow. sent on the move On 19 Mar 2013 20:03, IPatel ishita.pa...@usbank.com wrote: i am using 5.5 as well -- View this message in context: http://drools.46999.n3.nabble.com/validation-error-on-Template-tp4022828p4022897.html Sent from the Drools: User

Re: [rules-users] org.xmlpull.v1.XmlPullParserException [Planner 5.5.0.Final]

2013-03-19 Thread André Fróes
Thanks Geoffrey, I took a look there and noticed that there isn't that xmlpull, I added it and now I'll try again, clean and build in progress and restarted the gf. Thanks for the tip, I'll post the result. 2013/3/19 Geoffrey De Smet ge0ffrey.s...@gmail.com planner uses xstream xstream uses

Re: [rules-users] validation error on Template

2013-03-19 Thread Michael Anstis
Hello, I tried with the latest 5.5.x branch code and could not replicate the issue you both report. These are the steps I followed:- 1) Create a new Rule Template 2) Add a Fact Type 3) Add a Field constraint, with the value defined as a Template Key. 4) Change Template Key name 5) Click OK 6)

Re: [rules-users] validation error on Template

2013-03-19 Thread kurrent93
Well I just tried again, but now I am unable to reproduce the error. Must have been a momentary glitch in the matrix. I will try a few more times to reproduce it. On Tue, Mar 19, 2013 at 10:10 PM, manstis [via Drools] ml-node+s46999n4022901...@n3.nabble.com wrote: Hello, I tried with the

[rules-users] Selective TSP?

2013-03-19 Thread rengana
Hi, i'm evaluating Drools Planner as a solver for a normal OP problem but i can't find any example of drools usage on problems with partial set as a feasible solution, all drools examples and use cases seems to always try to plan every object even if that makes the solution unfeasible. I was

Re: [rules-users] How to import drl files to Guvnor

2013-03-19 Thread abhinay_agarwal
Drools provide us with a drools-jbpm integration plugin, in which there is an option of guvnor repository. you can provide the link to your guvnor repository. Once that is done, you can right click on your DRL file - Guvnor - Add - Select the package and you are good to go :) -- View this

[rules-users] Can an Object inside a map be used in guvnor

2013-03-19 Thread abhinay_agarwal
For example, I have a HasMap MapString, Integer map = new HashMapString,Integer(); map.put(amount,12); My DRL is as follows : when $h : HashMap(this[amount]!=null) then //something or when $h : HashMap(this[amount] 10) then //something i just want the object