Re: [rules-users] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Michael Anstis
BTW, if you need a hand setting up your environment just ask.

It should be quite straight forward and there is a helpful README.md file
that explains the necessary steps.

On 11 November 2011 17:10, Michael Anstis  wrote:

> Hi Heinz,
>
> I've stayed purposefully quiet on the dialect attribute, but you force my
> hand ;)
>
> I agree with Wolfgang that users are *likely* to set the attribute for the
> whole Ruleset however it is a rule-level attribute at the DRL level and
> hence should be supported as the same in other authoring metaphors; besides
> you can guarantee if we implement it at the decision table level they'll be
> users asking for it to be made available at the rule level to mirror DRL's
> capabilities.
>
> Furthermore, I am starting some new features that will allow "DRL
> snippets" to be used in the web-based decision table that'll bring us
> closed to being able to provide round-tripping between Excel and Guvnor for
> authoring decision tables (i.e. import from Excel into the web-based one
> and export from there to Excel). The web-based decision table has provided
> a row-level dialect attribute since (AFAIK) it's inception and Excel based
> decision tables must therefore support the same if we are to convert
> between the two.
>
> Therefore, if you do add the "dialect" attribute could you do so at the
> row level to ensure compatibility with the web-based equivalent.
>
> With kind regards,
>
> Mike
>
>
> On 11 November 2011 16:57, Heinz Drews  wrote:
>
>> I currently only use the sources which are part of the distribution
>> but I will pull them from git.
>> Just looking for the information how to setup a development environment.
>>
>> Because I can get also only one row with "Functions" working I will dig
>> deeper,
>> Also looking into the inclusion of "dialect"
>>
>>
>>
>> 2011/11/11 Michael Anstis :
>> > It would be best to create a JIRA to record and track the issue.
>> >
>> > Are you planning on providing a git pull request for the fix?
>> >
>> > On 11 November 2011 13:12, Heinz Drews  wrote:
>> >>
>> >> Many thanks.
>> >>
>> >> I will check the SpreadsheetCompiler to add a trim before checking.
>> >>
>> >> Should I open a jira?
>> >>
>> >>
>> >> 2011/11/11 Michael Anstis :
>> >> > You have a space after the keyword "Functions ".
>> >> >
>> >> > Removing this solves the problem.
>> >> >
>> >> > 2011/11/11 Heinz Drews 
>> >> >>
>> >> >> I have reduced the original XLS, but the problem still exists.
>> >> >>
>> >> >>
>> >> >> 2011/11/11 Michael Anstis :
>> >> >> > Something must be wrong.
>> >> >> >
>> >> >> > Providing your spreadsheet would be helpful.
>> >> >> >
>> >> >> > On 11 November 2011 10:11, hdrews  wrote:
>> >> >> >>
>> >> >> >> I have a decision table with functions but they are not
>> contained in
>> >> >> >> the
>> >> >> >> generated DRL.
>> >> >> >>
>> >> >> >> What have I to do to fix this?
>> >> >> >>
>> >> >> >> -- Heinz
>> >> >> >>
>> >> >> >> --
>> >> >> >> View this message in context:
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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
>> >> >>
>> >> >
>> >> >
>> >> > ___
>> >> > rules-users mailing list
>> >> > rules-users@lists.jboss.org
>> >> > https://lists.jboss.org/mailman/listinfo/rules-users
>> >> >
>> >> >
>> >> ___
>> >> rules-users mailing list
>> >> rules-users@lists.jboss.org
>> >> https://lists.jboss.org/mailman/listinfo/rules-users
>> >
>> >
>> > ___
>> > rules-users mailing list
>> > rules-users@lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/rules-users
>> >
>> >
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Michael Anstis
Hi Heinz,

I've stayed purposefully quiet on the dialect attribute, but you force my
hand ;)

I agree with Wolfgang that users are *likely* to set the attribute for the
whole Ruleset however it is a rule-level attribute at the DRL level and
hence should be supported as the same in other authoring metaphors; besides
you can guarantee if we implement it at the decision table level they'll be
users asking for it to be made available at the rule level to mirror DRL's
capabilities.

Furthermore, I am starting some new features that will allow "DRL snippets"
to be used in the web-based decision table that'll bring us closed to being
able to provide round-tripping between Excel and Guvnor for authoring
decision tables (i.e. import from Excel into the web-based one and export
from there to Excel). The web-based decision table has provided a row-level
dialect attribute since (AFAIK) it's inception and Excel based decision
tables must therefore support the same if we are to convert between the two.

Therefore, if you do add the "dialect" attribute could you do so at the row
level to ensure compatibility with the web-based equivalent.

With kind regards,

Mike

On 11 November 2011 16:57, Heinz Drews  wrote:

> I currently only use the sources which are part of the distribution
> but I will pull them from git.
> Just looking for the information how to setup a development environment.
>
> Because I can get also only one row with "Functions" working I will dig
> deeper,
> Also looking into the inclusion of "dialect"
>
>
>
> 2011/11/11 Michael Anstis :
> > It would be best to create a JIRA to record and track the issue.
> >
> > Are you planning on providing a git pull request for the fix?
> >
> > On 11 November 2011 13:12, Heinz Drews  wrote:
> >>
> >> Many thanks.
> >>
> >> I will check the SpreadsheetCompiler to add a trim before checking.
> >>
> >> Should I open a jira?
> >>
> >>
> >> 2011/11/11 Michael Anstis :
> >> > You have a space after the keyword "Functions ".
> >> >
> >> > Removing this solves the problem.
> >> >
> >> > 2011/11/11 Heinz Drews 
> >> >>
> >> >> I have reduced the original XLS, but the problem still exists.
> >> >>
> >> >>
> >> >> 2011/11/11 Michael Anstis :
> >> >> > Something must be wrong.
> >> >> >
> >> >> > Providing your spreadsheet would be helpful.
> >> >> >
> >> >> > On 11 November 2011 10:11, hdrews  wrote:
> >> >> >>
> >> >> >> I have a decision table with functions but they are not contained
> in
> >> >> >> the
> >> >> >> generated DRL.
> >> >> >>
> >> >> >> What have I to do to fix this?
> >> >> >>
> >> >> >> -- Heinz
> >> >> >>
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >>
> >> >> >>
> >> >> >>
> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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
> >> >>
> >> >
> >> >
> >> > ___
> >> > rules-users mailing list
> >> > rules-users@lists.jboss.org
> >> > https://lists.jboss.org/mailman/listinfo/rules-users
> >> >
> >> >
> >> ___
> >> rules-users mailing list
> >> rules-users@lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Heinz Drews
I currently only use the sources which are part of the distribution
but I will pull them from git.
Just looking for the information how to setup a development environment.

Because I can get also only one row with "Functions" working I will dig deeper,
Also looking into the inclusion of "dialect"



2011/11/11 Michael Anstis :
> It would be best to create a JIRA to record and track the issue.
>
> Are you planning on providing a git pull request for the fix?
>
> On 11 November 2011 13:12, Heinz Drews  wrote:
>>
>> Many thanks.
>>
>> I will check the SpreadsheetCompiler to add a trim before checking.
>>
>> Should I open a jira?
>>
>>
>> 2011/11/11 Michael Anstis :
>> > You have a space after the keyword "Functions ".
>> >
>> > Removing this solves the problem.
>> >
>> > 2011/11/11 Heinz Drews 
>> >>
>> >> I have reduced the original XLS, but the problem still exists.
>> >>
>> >>
>> >> 2011/11/11 Michael Anstis :
>> >> > Something must be wrong.
>> >> >
>> >> > Providing your spreadsheet would be helpful.
>> >> >
>> >> > On 11 November 2011 10:11, hdrews  wrote:
>> >> >>
>> >> >> I have a decision table with functions but they are not contained in
>> >> >> the
>> >> >> generated DRL.
>> >> >>
>> >> >> What have I to do to fix this?
>> >> >>
>> >> >> -- Heinz
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >> >>
>> >> >> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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
>> >>
>> >
>> >
>> > ___
>> > 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] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Michael Anstis
It would be best to create a JIRA to record and track the issue.

Are you planning on providing a git pull request for the fix?

On 11 November 2011 13:12, Heinz Drews  wrote:

> Many thanks.
>
> I will check the SpreadsheetCompiler to add a trim before checking.
>
> Should I open a jira?
>
>
> 2011/11/11 Michael Anstis :
> > You have a space after the keyword "Functions ".
> >
> > Removing this solves the problem.
> >
> > 2011/11/11 Heinz Drews 
> >>
> >> I have reduced the original XLS, but the problem still exists.
> >>
> >>
> >> 2011/11/11 Michael Anstis :
> >> > Something must be wrong.
> >> >
> >> > Providing your spreadsheet would be helpful.
> >> >
> >> > On 11 November 2011 10:11, hdrews  wrote:
> >> >>
> >> >> I have a decision table with functions but they are not contained in
> >> >> the
> >> >> generated DRL.
> >> >>
> >> >> What have I to do to fix this?
> >> >>
> >> >> -- Heinz
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >> >>
> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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
> >>
> >
> >
> > ___
> > 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] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Heinz Drews
Many thanks.

I will check the SpreadsheetCompiler to add a trim before checking.

Should I open a jira?


2011/11/11 Michael Anstis :
> You have a space after the keyword "Functions ".
>
> Removing this solves the problem.
>
> 2011/11/11 Heinz Drews 
>>
>> I have reduced the original XLS, but the problem still exists.
>>
>>
>> 2011/11/11 Michael Anstis :
>> > Something must be wrong.
>> >
>> > Providing your spreadsheet would be helpful.
>> >
>> > On 11 November 2011 10:11, hdrews  wrote:
>> >>
>> >> I have a decision table with functions but they are not contained in
>> >> the
>> >> generated DRL.
>> >>
>> >> What have I to do to fix this?
>> >>
>> >> -- Heinz
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> >> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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
>>
>
>
> ___
> 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] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Michael Anstis
You have a space after the keyword "Functions ".

Removing this solves the problem.

2011/11/11 Heinz Drews 

> I have reduced the original XLS, but the problem still exists.
>
>
> 2011/11/11 Michael Anstis :
> > Something must be wrong.
> >
> > Providing your spreadsheet would be helpful.
> >
> > On 11 November 2011 10:11, hdrews  wrote:
> >>
> >> I have a decision table with functions but they are not contained in the
> >> generated DRL.
> >>
> >> What have I to do to fix this?
> >>
> >> -- Heinz
> >>
> >> --
> >> View this message in context:
> >>
> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Heinz Drews
I have reduced the original XLS, but the problem still exists.


2011/11/11 Michael Anstis :
> Something must be wrong.
>
> Providing your spreadsheet would be helpful.
>
> On 11 November 2011 10:11, hdrews  wrote:
>>
>> I have a decision table with functions but they are not contained in the
>> generated DRL.
>>
>> What have I to do to fix this?
>>
>> -- Heinz
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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
>
>


TestFunction.xls
Description: MS-Excel spreadsheet
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread Michael Anstis
Something must be wrong.

Providing your spreadsheet would be helpful.

On 11 November 2011 10:11, hdrews  wrote:

> I have a decision table with functions but they are not contained in the
> generated DRL.
>
> What have I to do to fix this?
>
> -- Heinz
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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] Functions not generated from decision tables with Drools 5.2

2011-11-11 Thread hdrews
I have a decision table with functions but they are not contained in the
generated DRL.

What have I to do to fix this?

-- Heinz  

--
View this message in context: 
http://drools.46999.n3.nabble.com/Functions-not-generated-from-decision-tables-with-Drools-5-2-tp3499285p3499285.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-17 Thread ru
Thank you very much for the help.
Sincerely,
   Ru

--
View this message in context: 
http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3261553.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-17 Thread Wolfgang Laun
I don't think it is new - it's a form of what I reported in
JBRULES-3117
-W

On 17 August 2011 10:32, ru  wrote:

> Maybe this should be reported as a new bug to Drools team?
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3260980.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-17 Thread ru
Maybe this should be reported as a new bug to Drools team?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3260980.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-16 Thread Wolfgang Laun
I just found that this is apparently a variant of
JBRULES-3117
-W


On 16 August 2011 20:49, Wolfgang Laun  wrote:

> Indeed. It seems that, from 5.2.0 on, when there is a DRL file containing a
> function with a signature that contains a parameter that is an array of some
> simple type foo (int, double,...) and a scalar parameter of the same type
> and another function with a similar signature, an inappropriate syntax error
> is flagged:
> [  : unable to resolve type while building function ]
>
> E.g.
> function nextPoint( int[] a, int n ){ }
> function prevpoint( int[] a, int n ){ }
>
> @ru: Splitting the DRL might be a workaround, but this might not be easy as
> this is generated code.
>
> -W
>
>
>
>
> On 16 August 2011 17:10, ru  wrote:
>
>> Situation definitely treaky - I am working as author on DroolsTab plugin
>> to
>> Protege (http://protegewiki.stanford.edu/wiki/DroolsTab). In this project
>> drl file is generated programmatically and sent through pipe to
>> PackageBuilder. I did some experiments as you suggested. Results:
>>
>> 1. Only one function in package does not produce error messages
>> 2. Two similar functions produce only one error message "In package
>> TestExecutor error: [ prevPoint : unable to resolve type while building
>> function
>>  ]
>>  function name: prevPoint" and allways on last function in spite of their
>> order.
>>
>> Here is corresponding drl file:
>>
>> package TestExecutor
>>
>> import ru.oogis.pins.*
>> import ru.oogis.dro.*
>> import ru.igis.omtab.*
>> import java.util.*
>> import ru.oogis.util.DroClock
>> import com.bbn.openmap.proj.coords.LatLonPoint
>> import edu.stanford.smi.protege.model.Cls
>> import edu.stanford.smi.protege.model.Slot
>> import edu.stanford.smi.protege.model.Project
>> import edu.stanford.smi.protege.model.Instance
>> import edu.stanford.smi.protege.model.KnowledgeBase
>> import edu.stanford.smi.protege.server.RemoteProjectManager
>> import java.io.*
>> import com.bbn.openmap.omGraphics.OMGraphicList
>> import groovy.lang.Binding
>> import groovy.lang.GroovyShell
>> import java.awt.Component
>> import com.bbn.openmap.layer.location.LocationLayer
>> import com.bbn.openmap.layer.location.LocationHandler
>> import clojuretab.ClojureTab
>> import com.bbn.openmap.MapBean
>> import com.bbn.openmap.proj.GreatCircle
>> import com.bbn.openmap.layer.e00.E00Layer
>> import com.bbn.openmap.omGraphics.OMPoly
>> import com.bbn.openmap.proj.ProjMath
>>
>> function ArrayList nextPoint( int N, int t1, int sec, double[] a, double v
>> )
>> { int Nxt = N+1;
>> int Nxt2 = Nxt * 2;
>> if(Nxt2 >= a.length-1)
>>return null;
>> int N2 = N * 2;
>> double p1 = a[N2];
>> double l1 = a[N2+1];
>> double p2 = a[Nxt2];
>> double l2 = a[Nxt2+1];
>> double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
>> int dt = sec - t1;
>> double ds = dt * v;
>> if(ds > D){
>>int t2 = (int) (t1 + D / v);
>>return nextPoint(Nxt, t2, sec, a, v);
>> } else {
>> double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
>>double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
>> ArrayList al = new ArrayList();
>>al.add(N);
>>al.add(t1);
>>al.add(new double[]{sb[2], sb[3]});
>>al.add(az);
>>return al;
>> } }
>>
>> function ArrayList prevPoint( int N, int t1, int sec, double[] a, double v
>> )
>> { int Npv = N-1;
>> int Npv2 = Npv * 2;
>> if(Npv2 < 0)
>> return null;
>> int N2 = N * 2;
>> double p1 = a[N2];
>> double l1 = a[N2+1];
>> double p2 = a[Npv2];
>> double l2 = a[Npv2+1];
>> double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
>> int dt = sec - t1;
>> double ds = dt * v;
>> if(ds > D){
>>int t2 = (int) (t1 + D / v);
>> return prevPoint(Npv, t2, sec, a, v);
>> } else {
>>double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
>>double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
>> ArrayList al = new ArrayList();
>>al.add(N);
>>al.add(t1);
>>al.add(new double[]{sb[2], sb[3]});
>>al.add(az);
>>return al;
>> } }
>>
>> In 5.1.1 all have been compiling well and working great :) :(
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3258930.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-16 Thread Wolfgang Laun
Indeed. It seems that, from 5.2.0 on, when there is a DRL file containing a
function with a signature that contains a parameter that is an array of some
simple type foo (int, double,...) and a scalar parameter of the same type
and another function with a similar signature, an inappropriate syntax error
is flagged:
[  : unable to resolve type while building function ]

E.g.
function nextPoint( int[] a, int n ){ }
function prevpoint( int[] a, int n ){ }

@ru: Splitting the DRL might be a workaround, but this might not be easy as
this is generated code.

-W



On 16 August 2011 17:10, ru  wrote:

> Situation definitely treaky - I am working as author on DroolsTab plugin to
> Protege (http://protegewiki.stanford.edu/wiki/DroolsTab). In this project
> drl file is generated programmatically and sent through pipe to
> PackageBuilder. I did some experiments as you suggested. Results:
>
> 1. Only one function in package does not produce error messages
> 2. Two similar functions produce only one error message "In package
> TestExecutor error: [ prevPoint : unable to resolve type while building
> function
>  ]
>  function name: prevPoint" and allways on last function in spite of their
> order.
>
> Here is corresponding drl file:
>
> package TestExecutor
>
> import ru.oogis.pins.*
> import ru.oogis.dro.*
> import ru.igis.omtab.*
> import java.util.*
> import ru.oogis.util.DroClock
> import com.bbn.openmap.proj.coords.LatLonPoint
> import edu.stanford.smi.protege.model.Cls
> import edu.stanford.smi.protege.model.Slot
> import edu.stanford.smi.protege.model.Project
> import edu.stanford.smi.protege.model.Instance
> import edu.stanford.smi.protege.model.KnowledgeBase
> import edu.stanford.smi.protege.server.RemoteProjectManager
> import java.io.*
> import com.bbn.openmap.omGraphics.OMGraphicList
> import groovy.lang.Binding
> import groovy.lang.GroovyShell
> import java.awt.Component
> import com.bbn.openmap.layer.location.LocationLayer
> import com.bbn.openmap.layer.location.LocationHandler
> import clojuretab.ClojureTab
> import com.bbn.openmap.MapBean
> import com.bbn.openmap.proj.GreatCircle
> import com.bbn.openmap.layer.e00.E00Layer
> import com.bbn.openmap.omGraphics.OMPoly
> import com.bbn.openmap.proj.ProjMath
>
> function ArrayList nextPoint( int N, int t1, int sec, double[] a, double v
> )
> { int Nxt = N+1;
> int Nxt2 = Nxt * 2;
> if(Nxt2 >= a.length-1)
>return null;
> int N2 = N * 2;
> double p1 = a[N2];
> double l1 = a[N2+1];
> double p2 = a[Nxt2];
> double l2 = a[Nxt2+1];
> double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
> int dt = sec - t1;
> double ds = dt * v;
> if(ds > D){
>int t2 = (int) (t1 + D / v);
>return nextPoint(Nxt, t2, sec, a, v);
> } else {
> double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
>double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
> ArrayList al = new ArrayList();
>al.add(N);
>al.add(t1);
>al.add(new double[]{sb[2], sb[3]});
>al.add(az);
>return al;
> } }
>
> function ArrayList prevPoint( int N, int t1, int sec, double[] a, double v
> )
> { int Npv = N-1;
> int Npv2 = Npv * 2;
> if(Npv2 < 0)
> return null;
> int N2 = N * 2;
> double p1 = a[N2];
> double l1 = a[N2+1];
> double p2 = a[Npv2];
> double l2 = a[Npv2+1];
> double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
> int dt = sec - t1;
> double ds = dt * v;
> if(ds > D){
>int t2 = (int) (t1 + D / v);
> return prevPoint(Npv, t2, sec, a, v);
> } else {
>double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
>double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
> ArrayList al = new ArrayList();
>al.add(N);
>al.add(t1);
>al.add(new double[]{sb[2], sb[3]});
>al.add(az);
>return al;
> } }
>
> In 5.1.1 all have been compiling well and working great :) :(
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3258930.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-16 Thread ru
Situation definitely treaky - I am working as author on DroolsTab plugin to
Protege (http://protegewiki.stanford.edu/wiki/DroolsTab). In this project
drl file is generated programmatically and sent through pipe to
PackageBuilder. I did some experiments as you suggested. Results:

1. Only one function in package does not produce error messages
2. Two similar functions produce only one error message "In package
TestExecutor error: [ prevPoint : unable to resolve type while building
function
 ]
 function name: prevPoint" and allways on last function in spite of their
order.

Here is corresponding drl file:

package TestExecutor

import ru.oogis.pins.*
import ru.oogis.dro.*
import ru.igis.omtab.*
import java.util.*
import ru.oogis.util.DroClock
import com.bbn.openmap.proj.coords.LatLonPoint
import edu.stanford.smi.protege.model.Cls
import edu.stanford.smi.protege.model.Slot
import edu.stanford.smi.protege.model.Project
import edu.stanford.smi.protege.model.Instance
import edu.stanford.smi.protege.model.KnowledgeBase
import edu.stanford.smi.protege.server.RemoteProjectManager
import java.io.*
import com.bbn.openmap.omGraphics.OMGraphicList
import groovy.lang.Binding
import groovy.lang.GroovyShell
import java.awt.Component
import com.bbn.openmap.layer.location.LocationLayer
import com.bbn.openmap.layer.location.LocationHandler
import clojuretab.ClojureTab
import com.bbn.openmap.MapBean
import com.bbn.openmap.proj.GreatCircle
import com.bbn.openmap.layer.e00.E00Layer
import com.bbn.openmap.omGraphics.OMPoly
import com.bbn.openmap.proj.ProjMath

function ArrayList nextPoint( int N, int t1, int sec, double[] a, double v )
{ int Nxt = N+1;
int Nxt2 = Nxt * 2;
if(Nxt2 >= a.length-1)
return null;
int N2 = N * 2;
double p1 = a[N2];
double l1 = a[N2+1];
double p2 = a[Nxt2];
double l2 = a[Nxt2+1];
double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
int dt = sec - t1;
double ds = dt * v;
if(ds > D){
int t2 = (int) (t1 + D / v);
return nextPoint(Nxt, t2, sec, a, v);
} else {
double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
ArrayList al = new ArrayList();
al.add(N);
al.add(t1);
al.add(new double[]{sb[2], sb[3]});
al.add(az);
return al;
} }

function ArrayList prevPoint( int N, int t1, int sec, double[] a, double v )
{ int Npv = N-1;
int Npv2 = Npv * 2;
if(Npv2 < 0)
return null;
int N2 = N * 2;
double p1 = a[N2];
double l1 = a[N2+1];
double p2 = a[Npv2];
double l2 = a[Npv2+1];
double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
int dt = sec - t1;
double ds = dt * v;
if(ds > D){
int t2 = (int) (t1 + D / v);
return prevPoint(Npv, t2, sec, a, v);
} else {
double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
ArrayList al = new ArrayList();
al.add(N);
al.add(t1);
al.add(new double[]{sb[2], sb[3]});
al.add(az);
return al;
} }

In 5.1.1 all have been compiling well and working great :) :(

--
View this message in context: 
http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3258930.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-15 Thread Wolfgang Laun
I thought you might have - it's bound to be some freaky situation you must
have run into. I suggest that you experiment a little.

Does this error happen when you have nothing but a function with this
signature on a .drl file?

Does it also occur with some other simple type, or with a class?

Do you have any particular setup for the builder?

-W



On 15 August 2011 15:10, ru  wrote:

> Alas, I have the same problem with this code:
>
> function ArrayList nextPoint( int N, int t1, int sec, double[] a, double v
> )
> { int Nxt = N+1;
> int Nxt2 = Nxt * 2;
> if(Nxt2 >= a.length-1)
>return null;
> int N2 = N * 2;
> double p1 = a[N2];
> double l1 = a[N2+1];
> double p2 = a[Nxt2];
> double l2 = a[Nxt2+1];
> double D = 1.0; // GreatCircle.sphericalDistance(p1, l1, p2, l2);
> int dt = sec - t1;
> double ds = dt * v;
> if(ds > D){
>int t2 = (int) (t1 + D / v);
>return nextPoint(Nxt, t2, sec, a, v);
> } else {
>double az = 1.0; //GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
>double[] sb = new double[1]; //GreatCircle.sphericalBetween(p1, l1, ds,
> az, 1);
>ArrayList al = new ArrayList();
>al.add(N);
>al.add(t1);
>al.add(new double[]{sb[2], sb[3]});
>al.add(az);
>return al;
> } }
>
> Only when I remove brackets after "double" in the parameter list like this
> "function ArrayList nextPoint( int N, int t1, int sec, double a, double v
> )", the error message "unable to resolve type while building function"
> disappear. I have downloaded  Drools distribution from this link
>
> http://download.jboss.org/drools/release/5.2.0.Final/drools-distribution-5.2.0.Final.zip
> .
> Same situation I have with 5.3.0 distribution.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3255704.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-15 Thread ru
Alas, I have the same problem with this code:

function ArrayList nextPoint( int N, int t1, int sec, double[] a, double v )
{ int Nxt = N+1;
int Nxt2 = Nxt * 2;
if(Nxt2 >= a.length-1)
return null;
int N2 = N * 2;
double p1 = a[N2];
double l1 = a[N2+1];
double p2 = a[Nxt2];
double l2 = a[Nxt2+1];
double D = 1.0; // GreatCircle.sphericalDistance(p1, l1, p2, l2);
int dt = sec - t1;
double ds = dt * v;
if(ds > D){
int t2 = (int) (t1 + D / v);
return nextPoint(Nxt, t2, sec, a, v);
} else {
double az = 1.0; //GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
double[] sb = new double[1]; //GreatCircle.sphericalBetween(p1, l1, ds,
az, 1);
ArrayList al = new ArrayList();
al.add(N);
al.add(t1);
al.add(new double[]{sb[2], sb[3]});
al.add(az);
return al;
} }

Only when I remove brackets after "double" in the parameter list like this
"function ArrayList nextPoint( int N, int t1, int sec, double a, double v
)", the error message "unable to resolve type while building function"
disappear. I have downloaded  Drools distribution from this link
http://download.jboss.org/drools/release/5.2.0.Final/drools-distribution-5.2.0.Final.zip.
Same situation I have with 5.3.0 distribution.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3255704.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-15 Thread Wolfgang Laun
Thanks for the code. After replacing the GreatCircle.x calls with some
expression, the function compiles on 5.1.1, 5.2.0 and the current HEAD
developing towards 5.3.0.

Note that the error messages as you have posted them do not incriminate
"double" as the faulty type name (as the compiler does when you use e.g.
double2 instead).

-W

On 15 August 2011 09:51, ru  wrote:

> function ArrayList nextPoint( int N, int t1, int sec, double[] a, double v
> )
> { int Nxt = N+1;
> int Nxt2 = Nxt * 2;
> if(Nxt2 >= a.length-1)
>return null;
> int N2 = N * 2;
> double p1 = a[N2];
> double l1 = a[N2+1];
> double p2 = a[Nxt2];
> double l2 = a[Nxt2+1];
> double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
> int dt = sec - t1;
> double ds = dt * v;
> if(ds > D){
>int t2 = (int) (t1 + D / v);
>return nextPoint(Nxt, t2, sec, a, v);
> } else {
>double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
>double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
>ArrayList al = new ArrayList();
>al.add(N);
>al.add(t1);
>al.add(new double[]{sb[2], sb[3]});
>al.add(az);
>return al;
> } }
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3255191.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-15 Thread ru
function ArrayList nextPoint( int N, int t1, int sec, double[] a, double v )
{ int Nxt = N+1;
int Nxt2 = Nxt * 2;
if(Nxt2 >= a.length-1)
return null;
int N2 = N * 2;
double p1 = a[N2];
double l1 = a[N2+1];
double p2 = a[Nxt2];
double l2 = a[Nxt2+1];
double D = GreatCircle.sphericalDistance(p1, l1, p2, l2);
int dt = sec - t1;
double ds = dt * v;
if(ds > D){
int t2 = (int) (t1 + D / v);
return nextPoint(Nxt, t2, sec, a, v);
} else {
double az = GreatCircle.sphericalAzimuth(p1, l1, p2, l2);
double[] sb = GreatCircle.sphericalBetween(p1, l1, ds, az, 1);
ArrayList al = new ArrayList();
al.add(N);
al.add(t1);
al.add(new double[]{sb[2], sb[3]});
al.add(az);
return al;
} }


--
View this message in context: 
http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3255191.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-13 Thread Wolfgang Laun
How about giving a complete example?
-W

On 13 August 2011 12:11, ru  wrote:

> Hello drools users and team,
>
> My functions with array parameters (double[]) cease to compile in 5.2.0.
> Error message is:
>
> In package ActionExecutor error: [ prevPoint : unable to resolve type while
> building function
>  ]
>  function name: prevPoint
> In package ActionExecutor error: [ nextPoint : unable to resolve type while
> building function
>  ]
>  function name: nextPoint
>
> When I remove the parameter double[] this message disapears and functions
> compilation is OK.
> Thanks in advance for any help or suggestions.
>
> Sincerely,
>  Ru
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3251260.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] Functions with array parameters (double[]) cease to compile in 5.2.0

2011-08-13 Thread ru
Hello drools users and team,

My functions with array parameters (double[]) cease to compile in 5.2.0.
Error message is:

In package ActionExecutor error: [ prevPoint : unable to resolve type while
building function
 ]
 function name: prevPoint
In package ActionExecutor error: [ nextPoint : unable to resolve type while
building function
 ]
 function name: nextPoint

When I remove the parameter double[] this message disapears and functions
compilation is OK.
Thanks in advance for any help or suggestions.

Sincerely,
  Ru

--
View this message in context: 
http://drools.46999.n3.nabble.com/Functions-with-array-parameters-double-cease-to-compile-in-5-2-0-tp3251260p3251260.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] functions inside fact type declaration?

2010-08-09 Thread Edson Tirelli
Hehe, ok, you convinced me Greg! ;)

https://jira.jboss.org/browse/JBRULES-2652

Edson

2010/8/9 Greg Barton 

> +1 on the full constructor.
>
> GreG
>
> On Aug 9, 2010, at 3:58 PM, Edson Tirelli  wrote:
>
> I thought about adding that, but I feel like we would just be
> reimplementing java, in this case. So, if you need anything else other than
> simple java beans, you should implement it as a java class.
>
> Regarding the constructor, I might still add a constructor that
> receives all fields as parameters, just to reduce verbosity when using the
> java dialect, but if you are using mvel dialect, you can use "with":
>
> rule ...
> when ...
> then
> with( person = new Person() ) {
>  name = "Bob",
>  age = 35
> }
> insert( person );
> end
>
> Edson
>
> 2010/8/9 Tina Vießmann < 
> tviessm...@stud.hs-bremen.de>
>
>> Hi,
>>
>> is it possible to define a function/constructor inside a fact type
>> declaration? If yes, how can it be done?
>>
>> Thank you :)
>> Tina
>> ___
>> 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] functions inside fact type declaration?

2010-08-09 Thread Greg Barton
+1 on the full constructor.

GreG

On Aug 9, 2010, at 3:58 PM, Edson Tirelli  wrote:

I thought about adding that, but I feel like we would just be 
reimplementing java, in this case. So, if you need anything else other than 
simple java beans, you should implement it as a java class.

Regarding the constructor, I might still add a constructor that receives 
all fields as parameters, just to reduce verbosity when using the java dialect, 
but if you are using mvel dialect, you can use "with":

rule ...
when ...
then
with( person = new Person() ) {
 name = "Bob",
 age = 35
}
insert( person );
end
  
Edson

2010/8/9 Tina Vießmann 
Hi,

is it possible to define a function/constructor inside a fact type
declaration? If yes, how can it be done?

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



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



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


Re: [rules-users] functions inside fact type declaration?

2010-08-09 Thread Edson Tirelli
I thought about adding that, but I feel like we would just be
reimplementing java, in this case. So, if you need anything else other than
simple java beans, you should implement it as a java class.

Regarding the constructor, I might still add a constructor that receives
all fields as parameters, just to reduce verbosity when using the java
dialect, but if you are using mvel dialect, you can use "with":

rule ...
when ...
then
with( person = new Person() ) {
 name = "Bob",
 age = 35
}
insert( person );
end

Edson

2010/8/9 Tina Vießmann 

> Hi,
>
> is it possible to define a function/constructor inside a fact type
> declaration? If yes, how can it be done?
>
> Thank you :)
> Tina
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] functions inside fact type declaration?

2010-08-09 Thread Tina Vießmann
Hi,

is it possible to define a function/constructor inside a fact type 
declaration? If yes, how can it be done?

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


[rules-users] Functions invocation from condition in drools expert

2009-10-07 Thread Sameer Pokarna
Hi,

 

I am trying to find an example where the 'when' part of the rule uses
functions, I intend to include some checks on complex data structure in my
considiotn. Can anyone point me to any drools/other example to illustrate
how functions can be used in condition? All examples that I found have
functions used in the actions part.

 

Thanks in advance,

Regards,

Sameer

 

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


Re: [rules-users] functions

2009-06-18 Thread Edson Tirelli
The only requirement in this case is that when you create the
KnowledgeBuilder and starting adding the resources to it (DRL, flows, dsls,
etc), a given resource can only reference an asset that was previously
loaded. So, you must make sure the DRL with your functions is the first
resource to be added. Other than this, everything else should work just
fine.

[]s
Edson



2009/6/18 Chris Richmond 

>  Yes….for the most part, a non developer wouln’t be able to write the
> rules anyway….you need someone with domain knowledge of the objects being
> injected, so I don’t see a non developer writing rules.I was trying to
> take the approach that if, from the application code perspective, I only
> worrry about injecting objects I wish to reason on, and not try to think of
> new functions, new stats/bookkeeping classe I might need..if I can
> demonstrate doing that all within the rule, it seems to show it’s
> flexibility more than having to modify your codebase(beyond simple
> session/api calls) to analyze those objects you are injecting.
>
>
>
> One think to keep in mind is that I am utilizing mainly Fusion…since I am
> dealing with sensor type data simply being fed into the system
> contintuously, so It’s very fluid as to the types of calculations/rules I
> might have to implement compared perhaps with a standard business object
> type of data.   I want to become a guru and munging, creating, and using all
> sorts of constructs within Fusion for being able to accomplish almost any
> rule withought having to do anything besides simply injecting my sensor data
> ojbects into the memory stream…in my mind, that will lead me to the greatest
> flexibility and demostration of the power of being able to add the rules
> engine onto an already fully functioning and robust application that was
> written without planning for rules automation.
>
>
>
> I should mention I do not use the eclipse plugin or eclipse at all for my
> rules testing/development, so I don’t have any issues with eclipse plugin
> not breaking.
>
>
>
> So….assuming I **did** want to put a simple function in my .drl
> file….*where* do I have to put it?  My oringal question about how to make a
> simple function declaration is still a mystery to me.
>
>
>
> Thanks
>
>
>
> Chris
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 2:25 PM
>
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>I understand. Although functions in DRL files where conceived to be very
> simple things to reside with the rules. So, although you can have a DRL file
> with all your functions and, as long as this file is the first you load into
> your knowledge builder, use the functions on other files, we did not
> implement any king of specific multifile import... meaning that the eclipse
> plugin, for instance, will raise errors when accessing functions from one
> file into another... but your application will run fine...
>
>Regarding recompiling the application, I think you just said that
> meaning recompiling the java file with the functions right? since the java
> file can be anywhere, including your domain model jar or even in a jar by
> himself... in any case, be it a function or a java static method, it is code
> and you will need a developer to do it, right?
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Edson,
>
>
>
> Thanks…and I am considering that option as well…but the nice thing about
> the functions in the drl file is the system remains much more fluid..in
> other words, if I can focus on doing what I want to do all within the DRL
> file, it proves the flexibility of the system more to me than having to
> have  developer recompile the application itself with new classes.  Does
> that make sense?   Also, I would just like to know that I can actually make
> functions work for future reference.
>
>
>
> Thanks,
>
>
>
> Chris
>
>
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 1:15 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>If you are creating a function library, why don't you create it as
> static methods in a java class? easier to develop, to unit test and you can
> use "import function" in the DRL to import all of them.
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Ok…I am trying to build a

RE: [rules-users] functions

2009-06-18 Thread Chris Richmond
Yes..for the most part, a non developer wouln't be able to write the rules
anyway..you need someone with domain knowledge of the objects being
injected, so I don't see a non developer writing rules.I was trying to
take the approach that if, from the application code perspective, I only
worrry about injecting objects I wish to reason on, and not try to think of
new functions, new stats/bookkeeping classe I might need..if I can
demonstrate doing that all within the rule, it seems to show it's
flexibility more than having to modify your codebase(beyond simple
session/api calls) to analyze those objects you are injecting.  

 

One think to keep in mind is that I am utilizing mainly Fusion.since I am
dealing with sensor type data simply being fed into the system
contintuously, so It's very fluid as to the types of calculations/rules I
might have to implement compared perhaps with a standard business object
type of data.   I want to become a guru and munging, creating, and using all
sorts of constructs within Fusion for being able to accomplish almost any
rule withought having to do anything besides simply injecting my sensor data
ojbects into the memory stream.in my mind, that will lead me to the greatest
flexibility and demostration of the power of being able to add the rules
engine onto an already fully functioning and robust application that was
written without planning for rules automation.  

 

I should mention I do not use the eclipse plugin or eclipse at all for my
rules testing/development, so I don't have any issues with eclipse plugin
not breaking. 

 

So..assuming I *did* want to put a simple function in my .drl file..*where*
do I have to put it?  My oringal question about how to make a simple
function declaration is still a mystery to me.  

 

Thanks

 

Chris

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, June 18, 2009 2:25 PM
To: Rules Users List
Subject: Re: [rules-users] functions

 


   Chris,

   I understand. Although functions in DRL files where conceived to be very
simple things to reside with the rules. So, although you can have a DRL file
with all your functions and, as long as this file is the first you load into
your knowledge builder, use the functions on other files, we did not
implement any king of specific multifile import... meaning that the eclipse
plugin, for instance, will raise errors when accessing functions from one
file into another... but your application will run fine...

   Regarding recompiling the application, I think you just said that meaning
recompiling the java file with the functions right? since the java file can
be anywhere, including your domain model jar or even in a jar by himself...
in any case, be it a function or a java static method, it is code and you
will need a developer to do it, right?

   []s
   Edson

2009/6/18 Chris Richmond 

Edson,

 

Thanks.and I am considering that option as well.but the nice thing about the
functions in the drl file is the system remains much more fluid..in other
words, if I can focus on doing what I want to do all within the DRL file, it
proves the flexibility of the system more to me than having to have
developer recompile the application itself with new classes.  Does that make
sense?   Also, I would just like to know that I can actually make functions
work for future reference.

 

Thanks,

 

Chris

 

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, June 18, 2009 1:15 PM
To: Rules Users List
Subject: Re: [rules-users] functions

 


   Chris,

   If you are creating a function library, why don't you create it as static
methods in a java class? easier to develop, to unit test and you can use
"import function" in the DRL to import all of them.

   []s
   Edson

2009/6/18 Chris Richmond 

Ok.I am trying to build a function library in my .drl file and I added this
one test function

 

function String outputString(String sData){

return sData;

}

 

And no matter where I place this in my .drl file, I get an exception one way
or the other with compiling when I try instaniate and fire my rules.  The
.drl file works exactly as expected if I remove this function declaration,
and when I *do* try to add it, I do not actually call it anywhere.but get
those errors.  

 

So my question is, where exactly do I need to place function declarations..

 

 

Thanks,


Chris

 

 


___
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




-- 
 Edso

Re: [rules-users] functions

2009-06-18 Thread Edson Tirelli
   Chris,

   I understand. Although functions in DRL files where conceived to be very
simple things to reside with the rules. So, although you can have a DRL file
with all your functions and, as long as this file is the first you load into
your knowledge builder, use the functions on other files, we did not
implement any king of specific multifile import... meaning that the eclipse
plugin, for instance, will raise errors when accessing functions from one
file into another... but your application will run fine...

   Regarding recompiling the application, I think you just said that meaning
recompiling the java file with the functions right? since the java file can
be anywhere, including your domain model jar or even in a jar by himself...
in any case, be it a function or a java static method, it is code and you
will need a developer to do it, right?

   []s
   Edson

2009/6/18 Chris Richmond 

>  Edson,
>
>
>
> Thanks…and I am considering that option as well…but the nice thing about
> the functions in the drl file is the system remains much more fluid..in
> other words, if I can focus on doing what I want to do all within the DRL
> file, it proves the flexibility of the system more to me than having to
> have  developer recompile the application itself with new classes.  Does
> that make sense?   Also, I would just like to know that I can actually make
> functions work for future reference.
>
>
>
> Thanks,
>
>
>
> Chris
>
>
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 1:15 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>If you are creating a function library, why don't you create it as
> static methods in a java class? easier to develop, to unit test and you can
> use "import function" in the DRL to import all of them.
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Ok…I am trying to build a function library in my .drl file and I added this
> one test function
>
>
>
> function String outputString(String sData){
>
> return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> declaration, and when I **do** try to add it, I do not actually call it
> anywhere…but get those errors.
>
>
>
> So my question is, where exactly do I need to place function declarations..
>
>
>
>
>
> Thanks,
>
>
> Chris
>
>
>
>
>
>
> ___
> 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


Re: [rules-users] functions

2009-06-18 Thread Andrew Waterman
That's a great idea Edson. I just found Mark's posting on this from 2006:

http://markmail.org/message/pbs73eainajilmjm

Very helpful.

best wishes,

Andrew

2009/6/18 Chris Richmond 

>  Edson,
>
>
>
> Thanks…and I am considering that option as well…but the nice thing about
> the functions in the drl file is the system remains much more fluid..in
> other words, if I can focus on doing what I want to do all within the DRL
> file, it proves the flexibility of the system more to me than having to
> have  developer recompile the application itself with new classes.  Does
> that make sense?   Also, I would just like to know that I can actually make
> functions work for future reference.
>
>
>
> Thanks,
>
>
>
> Chris
>
>
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 1:15 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>If you are creating a function library, why don't you create it as
> static methods in a java class? easier to develop, to unit test and you can
> use "import function" in the DRL to import all of them.
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Ok…I am trying to build a function library in my .drl file and I added this
> one test function
>
>
>
> function String outputString(String sData){
>
> return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> declaration, and when I **do** try to add it, I do not actually call it
> anywhere…but get those errors.
>
>
>
> So my question is, where exactly do I need to place function declarations..
>
>
>
>
>
> Thanks,
>
>
> Chris
>
>
>
>
>
>
> ___
> 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
>
>


-- 
+1 510 342 5693

PO Box 7775 #8750
San Francisco, California   94120-7775

"Warning:  following standard input indefinitely is ineffective"
- /bin/tail error message

"Against logic there is no armor like ignorance."
 - Laurence J. Pete
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] functions

2009-06-18 Thread Chris Richmond
Edson,

 

Thanks.and I am considering that option as well.but the nice thing about the
functions in the drl file is the system remains much more fluid..in other
words, if I can focus on doing what I want to do all within the DRL file, it
proves the flexibility of the system more to me than having to have
developer recompile the application itself with new classes.  Does that make
sense?   Also, I would just like to know that I can actually make functions
work for future reference.

 

Thanks,

 

Chris

 

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, June 18, 2009 1:15 PM
To: Rules Users List
Subject: Re: [rules-users] functions

 


   Chris,

   If you are creating a function library, why don't you create it as static
methods in a java class? easier to develop, to unit test and you can use
"import function" in the DRL to import all of them.

   []s
   Edson

2009/6/18 Chris Richmond 

Ok.I am trying to build a function library in my .drl file and I added this
one test function

 

function String outputString(String sData){

return sData;

}

 

And no matter where I place this in my .drl file, I get an exception one way
or the other with compiling when I try instaniate and fire my rules.  The
.drl file works exactly as expected if I remove this function declaration,
and when I *do* try to add it, I do not actually call it anywhere.but get
those errors.  

 

So my question is, where exactly do I need to place function declarations..

 

 

Thanks,


Chris

 

 


___
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


Re: [rules-users] functions

2009-06-18 Thread Edson Tirelli
   Chris,

   If you are creating a function library, why don't you create it as static
methods in a java class? easier to develop, to unit test and you can use
"import function" in the DRL to import all of them.

   []s
   Edson

2009/6/18 Chris Richmond 

>  Ok…I am trying to build a function library in my .drl file and I added
> this one test function
>
>
>
> function String outputString(String sData){
>
> return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> declaration, and when I **do** try to add it, I do not actually call it
> anywhere…but get those errors.
>
>
>
> So my question is, where exactly do I need to place function declarations..
>
>
>
>
>
> Thanks,
>
>
> Chris
>
>
>
>
>
> ___
> 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


[rules-users] functions

2009-06-18 Thread Chris Richmond
Ok.I am trying to build a function library in my .drl file and I added this
one test function

 

function String outputString(String sData){

return sData;

}

 

And no matter where I place this in my .drl file, I get an exception one way
or the other with compiling when I try instaniate and fire my rules.  The
.drl file works exactly as expected if I remove this function declaration,
and when I *do* try to add it, I do not actually call it anywhere.but get
those errors.  

 

So my question is, where exactly do I need to place function declarations..

 

 

Thanks,


Chris

 

 

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


[rules-users] functions .drl file

2009-06-18 Thread Chris Richmond
Is it possible to create a .drl file of nothing but functions then import
those into another .drl file to make it easy to maintain one file of API
style functions and then beable to call them from any additional .drl files?

 

Thanks,


Chris

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


Re: [rules-users] functions over the rule template of a Condition in a Decision Table

2008-09-21 Thread Edson Tirelli
   Place it inside an eval(). Use the regular "$" syntax for paramenters.

   []s
   Edson

2008/9/19 javier <[EMAIL PROTECTED]>

> Hello,
>
>
>
> It is posible to write a function over the rule template of a CONDITION in
> a Decision Table?
>
>
>
> I mean instead of write the rule template:
>
>driver.priorClaims
>
> write the rule template:
>
>   driver.priorClaims("lastWeek")
>
>
>
>
>
>
>
> thanks
>
>
>
> javi.
>
> ___
> 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


[rules-users] functions over the rule template of a Condition in a Decision Table

2008-09-19 Thread javier
Hello,



It is posible to write a function over the rule template of a CONDITION in a
Decision Table?



I mean instead of write the rule template:

   driver.priorClaims

write the rule template:

  driver.priorClaims("lastWeek")







thanks



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


Re: [rules-users] Functions in Dynamic Salience?

2008-01-14 Thread Mark Proctor

James Carman wrote:
Can I use a function to calculate my dynamic salience 
(http://blog.athico.com/2007/05/dynamic-salience-expressions.html)? 

you should be able to, give it a try and log a JIRA if it can't.



___
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] Functions in Dynamic Salience?

2008-01-14 Thread James Carman
Can I use a function to calculate my dynamic salience (
http://blog.athico.com/2007/05/dynamic-salience-expressions.html)?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users