Question

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,

Mike.

***Edited by Moderator Marissa to update platform capability tags****

Correct Answer
January 14, 2019 - 11:17am

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.

 

 

 

Comments

Keep up to date on this post and subscribe to comments

Pega
January 14, 2019 - 11:17am

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.

 

 

 

January 17, 2019 - 7:51am
Response to JOHNPW_GCS

That makes perfect sense, John. Many thanks for taking the time to explain it so clearly.

February 21, 2019 - 5:34am
Response to JOHNPW_GCS

Hi John,

When I tried to do the save as of one of the OOTB activities in to my application rule set to customize according to the business ,Iam getting below error 

"The usage of @java in expressions is no longer supported. Consider replacing @java with utility functions or other product features."

We are using Pega Infinity version.Please suggest which function can be used as a replacement for @java

 

 

February 21, 2019 - 2:17pm
Response to JhansiRani

As per my understanding the statement asks you to use the equivalent utility function if it already exists in the system else you can create a new function and place your java code into it then try to call the function instead of using @java.