You shouldn't have to "require" any core module like the logic module.  If
you use it, you will have to have the logic api on your classpath in order
to compile your module though.

Ben
On Nov 8, 2011 8:39 PM, "Darius Jazayeri" <[email protected]> wrote:

> Copying the dev list.
>
> Starting with Logic 0.5, you're not allowed to *register* rules unless
> you explicitly include the logic module.
>
> One solution is to manually create an AGE rule (using Groovy) via the
> logic module on the server you intend to run the report on. (I'd try this
> first.)
>
> The other solution is to have your module require the logic module, and
> use TokenService.registerToken to actually add the age rule.
>
> -Darius
>
> On Tue, Nov 8, 2011 at 1:42 AM, Lara Kellett <[email protected]>wrote:
>
>> Hi Guys,
>>
>> Currently refactoring our Reporting stuff and in on of our reports we
>> currently have the following code
>>
>> LogicService ls = Context.getLogicService();
>>
>>                try {
>>                        ls.getRule("AGE");
>>                }
>>                catch (Exception ex) {
>>                        AgeRule ageRule = new AgeRule();
>>                        ls.addRule("AGE", ageRule);
>>                }
>>
>> Think this may have worked on 0.4 logic but when running against 0.5
>> in my dev environment as I am getting
>>
>> An error occurred while executing this method. Error message: Use
>> TokenService.registerToken
>> java.lang.UnsupportedOperationException: Use TokenService.registerToken
>>
>> How do I get access to the TokenService and what do I need to do to
>> rewrite this for 0.5 to get this report running in my dev environment?
>>
>> Thanks,
>>
>> Lara
>>
>
> ------------------------------
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from 
> OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-devel-l" in the  body (not 
the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

Reply via email to