I just found that this is apparently a variant of JBRULES-3117<https://issues.jboss.org/browse/JBRULES-3117> -W
On 16 August 2011 20:49, Wolfgang Laun <wolfgang.l...@gmail.com> 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: > [ <functionname> : 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 <soro...@oogis.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