[rules-dev] Access a static variable from Java file to DRL File

Roopa roopa.musuley at gmail.com
Thu May 2 16:58:45 EDT 2013


Laune.

It Worked
Thanks a lot



On Thu, May 2, 2013 at 3:17 PM, laune [via Drools] <
ml-node+s46999n4023647h3 at n3.nabble.com> wrote:

> If you import a class
>    import a.b.c.Const
> you can use its statics in the usual way, e.g., Const.ORDER_AM
>
> There's also an import static, which should let you omit the class name
>    import static a.b.c.Const.ORDER_AM
> but this might only work for static methods (at least, it did, some
> versions ago).
>
> -W
>
> On 2 May 2013 21:47, Roopa <[hidden email]<http://user/SendEmail.jtp?type=node&node=4023647&i=0>
> > wrote:
>
>> Hi,
>>
>> I am a newbie to Drools. Can anyone give me some inputs on
>>
>> 1) How to access a static variable constant from java file into drl file.
>> say a static constant is declared in a java file
>> VCRuleServiceConstants.java
>>
>> public static final double
>> ORDER_AMOUNT_FOP_REVIEWED_ADD_TO_EXISTING_ORDER_TIER1 = 100000;
>>
>> How to access this variable in the drl file.
>> Since its not an instance variable of that class, even if I insert as a
>> "fact", unable to access the variable in drl file.
>>
>> I can very well use the constant value directly in the drl file, but
>> wanted
>> to know.
>> Please do suggest me some options available.
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Access-a-static-variable-from-Java-file-to-DRL-File-tp4023641p4023645.html
>> Sent from the Drools: Developer (committer) mailing list mailing list
>> archive at Nabble.com.
>> _______________________________________________
>> rules-dev mailing list
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=4023647&i=1>
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>
>
> _______________________________________________
> rules-dev mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4023647&i=2>
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://drools.46999.n3.nabble.com/Access-a-static-variable-from-Java-file-to-DRL-File-tp4023641p4023647.html
>  To unsubscribe from Access a static variable from Java file to DRL File, click
> here<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4023641&code=cm9vcGEubXVzdWxleUBnbWFpbC5jb218NDAyMzY0MXwxODc5NzMzMDg4>
> .
> NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://drools.46999.n3.nabble.com/Access-a-static-variable-from-Java-file-to-DRL-File-tp4023641p4023648.html
Sent from the Drools: Developer (committer) mailing list mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20130502/7ce07062/attachment.html 


More information about the rules-dev mailing list