What exactly is "@java"?
In our custom Authentication activity we have a Property-Set step that uses "@java". It causes the following warning:
"The usage of @java in expressions is deprecated and support for it will be removed in a future version. Consider replacing @java with utility functions or other product features."
However, the reason for this being present is that it ships with PRPC OOTB. Please can someone explain:
1) What this does and how it differs from using a java method?
2) Why does PRPC ship with example code for you to copy that contains guardrail breaches?
Many thanks for your help,
***Edited by Moderator Marissa to update platform capability tags****
The @Java construct lets you embed a Java Call directly into the Expression Language.
It always you to inline a call to Java, without having to create an explicit Java Step/Method.
The difference between using a Java Step/Method is that the expected use here is for the Java to return a value , which can then be used in an expression
- whereas a Java Method is more suited to more complex 'imperative' code; and where there isn't necessarily a return-value/status.
Note: 'Deprecated' doesn't mean "You cannot use this" - it just means that the feature in question is less favoured than it used to be, and that the feature may be not be available in a future release; so where possible - use an alternative.
Feature Deprecation isn't unique to the Pega Platform; for instance the Java API has evolved over time and features/APIs that were standard at the time, have been subsequently marked as deprecated - to forewarn that the feature in question may be removed in a future version.
As PRPC evolves; many older OOTB Rules are migrated across versions; and some of the older rules will be found to be using (now) deprecated-features.
Keep up to date on this post and subscribe to comments
- "estimatePageDataSize" Java Method in Pega Private API "com.pega.pegarules.priv..."
- "Failed to process passivation queue: java.lang.NullPointerException" "getMaxPageNameLength"
- Connect REST- "Caught unhandled exception: java.net.SocketTimeoutException: Read timed out", when used Content Type "application/x-www-form-urlencoded"
- class "java.lang.Long" does not match mode "String" of property
- Java package cant be resolved getting "com.atl cannot be resolved to a type" errorI am trying to use my custom made java code in prpc