Last activity: 16 Oct 2018 12:03 EDT
Not able to use tools.getSystemSettings() inside function rule
I want to use tools.getSystemSettings() in my function rule. However am getting the error message that "tools cannot be resolved".
Do we need to import any package before using tools.getSystemSettings() in function rule?.kindly help.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Can you try using like below and let us know if it helps,
Thanks for the reply Bala.
I tried as above ,but am still getting the same error that "tools cannot be resolved" when try to save function rule.Any other way ?
Sopra Steria AG
Try with below syn.
String XYZ = tools.getSystemSettings().getDynamic("Ruleset","SettingName");
You may need to pass "tools" in as a parameter to your function. /Eric
Can you offer the operation details about how to pass "tools" as a parameter in our function , Such as how to define, pass this parameter ?
Thanks in advance !
can you try this @(Pega-RULES:Utilities).getSystemSetting()
I tried.@(Pega-RULES:Utilities) cannot be used inside function rule
>>> I [email protected](Pega-RULES:Utilities) cannot be used inside function rule
The syntax for calling a function from within java is much different than the syntax of calling the function from an activity pre or post condition.
If your goal is to call "@(Pega-RULES:Utilities).getSystemSetting()" from a function rule, then first use that syntax in an activity pre or post condition, and after you successfully save the activity, use "action > java" and search for references to that call to getSystemSetting to see what java syntax got generated, and you can copy that syntax into your function definition.
Replace tools with (PRThread)ThreadContainer.get().getPublicAPI()
Department of Planning and Environment
Use something as below in your function rule
PublicAPI tools = null;
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null)
tools = thisThread.getPublicAPI();
throw new PRAppRuntimeException("Pega-RULES", 0, "Unable to obtain current thread");
the way to invoke the systems settings will be tools.getSystemSettings() i
standard chartered bank
To avoid "tools cannot be resolved" error
you can define tools as parameter tab ( ex : callWhen) . Otherwise you have to add the below line in your function
Check this article:
U can try "PublicAPI tools=ThreadContainer.get().getPublicAPI();"
hope it may help in ur case.