Re: [rules-users] Call of a function in the definition of a rule template
The Drools Expert user-guide gives details (for calling from the RHS). 2012/2/13 freelance developpement > thanks for your help > > Michael Anstis >can you give me an example of calling a function in fragment drl? >the link does not contain enough detail > > thanks in advance > 2012/2/13 Michael Anstis > >> DSL's don't support Template keys though... >> https://issues.jboss.org/browse/GUVNOR-1799 >> >> But, if you don't need that, then +1 - DSLs can hide the function call. >> >> >> 2012/2/13 Esteban Aliverti >> >>> If you are dealing with non-technical people, maybe you could also use a >>> DSL sentence to "hide" the function call. >>> >>> Best Regards, >>> >>> >>> >>> Esteban Aliverti >>> - Developer @ http://www.plugtree.com >>> - Blog @ http://ilesteban.wordpress.com >>> >>> >>> >>> 2012/2/13 Michael Anstis >>> Your best bet would be to use a free-form DRL fragment in the Template UI and call the function as you would using DRL. Alternatively, feel free to look at https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :) 2012/2/13 freelance developpement > No it's not a method defined in a java class, but it is a function > defined in Guvnor using the "Create new function". > > I want to call this function when I am trying to define a rule > template. > > 2012/2/13 Wolfgang Laun > >> 2012/2/13 freelance developpement >> >>> I have not understood your answer, what I meant was ,for example i >>> had a program function >>> >> >> Do you mean a public static method in some Java Class? >> >> You should be able to define an "import function", even in Guvnor. >> >> -W >> >> "utiliser une fonction dans une rule" n'est pas "appeler une fonction >> pour d´efiner une rule" >> >> >> >> >> >>> that returns me the max and I want to make it available to one who will >>> create the business rule .It goes like that when access to the >>> creation of a new rule template and not technical (he knows not to >>> programming) it will use this function already defined in the " >>> create new Function". >>> >>> please do you know how to make this call? >>> >>> thanks in advance >>> >>> >>> 2012/2/13 Wolfgang Laun >>> It is not so easy to create rules programmatically (if that's what you mean). You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule API in the "Drools Introduction and General User Guide"), but this is a rather inconvenient way of accumulating strings to create a package. I'd rather create a String and feed the DRL compiler with it, but YMMV. -W 2012/2/13 freelance developpement < developpement.freela...@gmail.com> > Hi every one, > > I defined a function in Guvnor and I want to call it to define a > rule template. But I do not know how. > > Have you any ideas? > Thank you in advance > > ___ > 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 >> >> > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-user
Re: [rules-users] Call of a function in the definition of a rule template
thanks for your help Michael Anstis can you give me an example of calling a function in fragment drl? the link does not contain enough detail thanks in advance 2012/2/13 Michael Anstis > DSL's don't support Template keys though... > https://issues.jboss.org/browse/GUVNOR-1799 > > But, if you don't need that, then +1 - DSLs can hide the function call. > > > 2012/2/13 Esteban Aliverti > >> If you are dealing with non-technical people, maybe you could also use a >> DSL sentence to "hide" the function call. >> >> Best Regards, >> >> >> >> Esteban Aliverti >> - Developer @ http://www.plugtree.com >> - Blog @ http://ilesteban.wordpress.com >> >> >> >> 2012/2/13 Michael Anstis >> >>> Your best bet would be to use a free-form DRL fragment in the Template >>> UI and call the function as you would using DRL. >>> >>> Alternatively, feel free to look at >>> https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :) >>> >>> >>> 2012/2/13 freelance developpement >>> No it's not a method defined in a java class, but it is a function defined in Guvnor using the "Create new function". I want to call this function when I am trying to define a rule template. 2012/2/13 Wolfgang Laun > 2012/2/13 freelance developpement > >> I have not understood your answer, what I meant was ,for example i >> had a program function >> > > Do you mean a public static method in some Java Class? > > You should be able to define an "import function", even in Guvnor. > > -W > > "utiliser une fonction dans une rule" n'est pas "appeler une fonction > pour d´efiner une rule" > > > > > >> that returns me the max and I want to make it available to one who will >> create the business rule .It goes like that when access to the >> creation of a new rule template and not technical (he knows not to >> programming) it will use this function already defined in the "create new >> Function". >> >> please do you know how to make this call? >> >> thanks in advance >> >> >> 2012/2/13 Wolfgang Laun >> >>> It is not so easy to create rules programmatically (if that's what >>> you mean). >>> >>> You could use the experimental (unstable) "fluent" API (see 2.2.2.6. >>> Rule >>> API in the "Drools Introduction and General User Guide"), but this is a >>> rather inconvenient way of accumulating strings to create a package. I'd >>> rather create a String and feed the DRL compiler with it, but YMMV. >>> >>> -W >>> >>> >>> >>> 2012/2/13 freelance developpement >> > >>> Hi every one, I defined a function in Guvnor and I want to call it to define a rule template. But I do not know how. Have you any ideas? Thank you in advance ___ 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 > > ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Call of a function in the definition of a rule template
DSL's don't support Template keys though... https://issues.jboss.org/browse/GUVNOR-1799 But, if you don't need that, then +1 - DSLs can hide the function call. 2012/2/13 Esteban Aliverti > If you are dealing with non-technical people, maybe you could also use a > DSL sentence to "hide" the function call. > > Best Regards, > > > > Esteban Aliverti > - Developer @ http://www.plugtree.com > - Blog @ http://ilesteban.wordpress.com > > > > 2012/2/13 Michael Anstis > >> Your best bet would be to use a free-form DRL fragment in the Template UI >> and call the function as you would using DRL. >> >> Alternatively, feel free to look at >> https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :) >> >> >> 2012/2/13 freelance developpement >> >>> No it's not a method defined in a java class, but it is a function >>> defined in Guvnor using the "Create new function". >>> >>> I want to call this function when I am trying to define a rule >>> template. >>> >>> 2012/2/13 Wolfgang Laun >>> 2012/2/13 freelance developpement > I have not understood your answer, what I meant was ,for example i > had a program function > Do you mean a public static method in some Java Class? You should be able to define an "import function", even in Guvnor. -W "utiliser une fonction dans une rule" n'est pas "appeler une fonction pour d´efiner une rule" > that returns me the max and I want to make it available to one who will > create the business rule .It goes like that when access to the > creation of a new rule template and not technical (he knows not to > programming) it will use this function already defined in the "create new > Function". > > please do you know how to make this call? > > thanks in advance > > > 2012/2/13 Wolfgang Laun > >> It is not so easy to create rules programmatically (if that's what >> you mean). >> >> You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule >> API in the "Drools Introduction and General User Guide"), but this is a >> rather inconvenient way of accumulating strings to create a package. I'd >> rather create a String and feed the DRL compiler with it, but YMMV. >> >> -W >> >> >> >> 2012/2/13 freelance developpement >> >>> Hi every one, >>> >>> I defined a function in Guvnor and I want to call it to define a >>> rule template. But I do not know how. >>> >>> Have you any ideas? >>> Thank you in advance >>> >>> ___ >>> 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] Call of a function in the definition of a rule template
If you are dealing with non-technical people, maybe you could also use a DSL sentence to "hide" the function call. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2012/2/13 Michael Anstis > Your best bet would be to use a free-form DRL fragment in the Template UI > and call the function as you would using DRL. > > Alternatively, feel free to look at > https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :) > > > 2012/2/13 freelance developpement > >> No it's not a method defined in a java class, but it is a function >> defined in Guvnor using the "Create new function". >> >> I want to call this function when I am trying to define a rule template. >> >> 2012/2/13 Wolfgang Laun >> >>> 2012/2/13 freelance developpement >>> I have not understood your answer, what I meant was ,for example i had a program function >>> >>> Do you mean a public static method in some Java Class? >>> >>> You should be able to define an "import function", even in Guvnor. >>> >>> -W >>> >>> "utiliser une fonction dans une rule" n'est pas "appeler une fonction >>> pour d´efiner une rule" >>> >>> >>> >>> >>> that returns me the max and I want to make it available to one who will create the business rule .It goes like that when access to the creation of a new rule template and not technical (he knows not to programming) it will use this function already defined in the "create new Function". please do you know how to make this call? thanks in advance 2012/2/13 Wolfgang Laun > It is not so easy to create rules programmatically (if that's what you > mean). > > You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule > API in the "Drools Introduction and General User Guide"), but this is a > rather inconvenient way of accumulating strings to create a package. I'd > rather create a String and feed the DRL compiler with it, but YMMV. > > -W > > > > 2012/2/13 freelance developpement > >> Hi every one, >> >> I defined a function in Guvnor and I want to call it to define a >> rule template. But I do not know how. >> >> Have you any ideas? >> Thank you in advance >> >> ___ >> 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] Call of a function in the definition of a rule template
Your best bet would be to use a free-form DRL fragment in the Template UI and call the function as you would using DRL. Alternatively, feel free to look at https://issues.jboss.org/browse/GUVNOR-1435 and submit a pull request :) 2012/2/13 freelance developpement > No it's not a method defined in a java class, but it is a function defined > in Guvnor using the "Create new function". > > I want to call this function when I am trying to define a rule template. > > 2012/2/13 Wolfgang Laun > >> 2012/2/13 freelance developpement >> >>> I have not understood your answer, what I meant was ,for example i had a >>> program function >>> >> >> Do you mean a public static method in some Java Class? >> >> You should be able to define an "import function", even in Guvnor. >> >> -W >> >> "utiliser une fonction dans une rule" n'est pas "appeler une fonction >> pour d´efiner une rule" >> >> >> >> >> >>> that returns me the max and I want to make it available to one who will >>> create the business rule .It goes like that when access to the creation >>> of a new rule template and not technical (he knows not to programming) it >>> will use this function already defined in the "create new Function". >>> >>> please do you know how to make this call? >>> >>> thanks in advance >>> >>> >>> 2012/2/13 Wolfgang Laun >>> It is not so easy to create rules programmatically (if that's what you mean). You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule API in the "Drools Introduction and General User Guide"), but this is a rather inconvenient way of accumulating strings to create a package. I'd rather create a String and feed the DRL compiler with it, but YMMV. -W 2012/2/13 freelance developpement > Hi every one, > > I defined a function in Guvnor and I want to call it to define a rule > template. But I do not know how. > > Have you any ideas? > Thank you in advance > > ___ > 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] Call of a function in the definition of a rule template
No it's not a method defined in a java class, but it is a function defined in Guvnor using the "Create new function". I want to call this function when I am trying to define a rule template. 2012/2/13 Wolfgang Laun > 2012/2/13 freelance developpement > >> I have not understood your answer, what I meant was ,for example i had a >> program function >> > > Do you mean a public static method in some Java Class? > > You should be able to define an "import function", even in Guvnor. > > -W > > "utiliser une fonction dans une rule" n'est pas "appeler une fonction pour > d´efiner une rule" > > > > > >> that returns me the max and I want to make it available to one who will >> create the business rule .It goes like that when access to the creation >> of a new rule template and not technical (he knows not to programming) it >> will use this function already defined in the "create new Function". >> >> please do you know how to make this call? >> >> thanks in advance >> >> >> 2012/2/13 Wolfgang Laun >> >>> It is not so easy to create rules programmatically (if that's what you >>> mean). >>> >>> You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule >>> API in the "Drools Introduction and General User Guide"), but this is a >>> rather inconvenient way of accumulating strings to create a package. I'd >>> rather create a String and feed the DRL compiler with it, but YMMV. >>> >>> -W >>> >>> >>> >>> 2012/2/13 freelance developpement >>> Hi every one, I defined a function in Guvnor and I want to call it to define a rule template. But I do not know how. Have you any ideas? Thank you in advance ___ 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] Call of a function in the definition of a rule template
2012/2/13 freelance developpement > I have not understood your answer, what I meant was ,for example i had a > program function > Do you mean a public static method in some Java Class? You should be able to define an "import function", even in Guvnor. -W "utiliser une fonction dans une rule" n'est pas "appeler une fonction pour d´efiner une rule" > that returns me the max and I want to make it available to one who will > create the business rule .It goes like that when access to the creation of > a new rule template and not technical (he knows not to programming) it > will use this function already defined in the "create new Function". > > please do you know how to make this call? > > thanks in advance > > > 2012/2/13 Wolfgang Laun > >> It is not so easy to create rules programmatically (if that's what you >> mean). >> >> You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule >> API in the "Drools Introduction and General User Guide"), but this is a >> rather inconvenient way of accumulating strings to create a package. I'd >> rather create a String and feed the DRL compiler with it, but YMMV. >> >> -W >> >> >> >> 2012/2/13 freelance developpement >> >>> Hi every one, >>> >>> I defined a function in Guvnor and I want to call it to define a rule >>> template. But I do not know how. >>> >>> Have you any ideas? >>> Thank you in advance >>> >>> ___ >>> 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] Call of a function in the definition of a rule template
I have not understood your answer, what I meant was ,for example i had a program function that returns me the max and I want to make it available to one who will create the business rule .It goes like that when access to the creation of a new rule template and not technical (he knows not to programming) it will use this function already defined in the "create new Function". please do you know how to make this call? thanks in advance 2012/2/13 Wolfgang Laun > It is not so easy to create rules programmatically (if that's what you > mean). > > You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule > API in the "Drools Introduction and General User Guide"), but this is a > rather inconvenient way of accumulating strings to create a package. I'd > rather create a String and feed the DRL compiler with it, but YMMV. > > -W > > > > 2012/2/13 freelance developpement > >> Hi every one, >> >> I defined a function in Guvnor and I want to call it to define a rule >> template. But I do not know how. >> >> Have you any ideas? >> Thank you in advance >> >> ___ >> 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] Call of a function in the definition of a rule template
It is not so easy to create rules programmatically (if that's what you mean). You could use the experimental (unstable) "fluent" API (see 2.2.2.6. Rule API in the "Drools Introduction and General User Guide"), but this is a rather inconvenient way of accumulating strings to create a package. I'd rather create a String and feed the DRL compiler with it, but YMMV. -W 2012/2/13 freelance developpement > Hi every one, > > I defined a function in Guvnor and I want to call it to define a rule > template. But I do not know how. > > Have you any ideas? > Thank you in advance > > ___ > 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