In your case, for the SP_Library and SP_Function, you would need to ensure you’re using the correct ruleset name prefix. For example, if your library is in a ruleset called “SharePointInt”, the call would look like:
Note that the ruleset and library names are converted to lowercase with underscores in Java.
Additional Configuration Requirements
Based on your description, here are some additional configurations to check:
Verify Library Configuration:
Ensure the “Library ready to be compiled” checkbox is selected in your library rule
Check that you’ve included all necessary Java packages in the “Java packages to Include” section:
o ``java.io.*
o ``java.security.*
o ``java.util.*
Any other packages required for SharePoint integration
Regenerate the Library:
After making any changes to the library configuration, click “Save” and then “Generate Library” again
Restart your application server to ensure the newly generated library is loaded
Check Function Parameters:
Ensure the parameters in your Java step match exactly (in number, order, and type) with those defined in your RUF
Verify Ruleset Visibility:
Make sure the ruleset containing your library is included in your application’s ruleset list
Check that the ruleset version is correct and accessible
SharePoint Integration Specifics
For SharePoint integration with Azure AD in Pega 24.2.1, here are some specific items to verify:
JAR File Import:
Confirm you’ve imported the Microsoft Authentication Library JAR file (msal4j.jar)
Verify the JAR file is properly imported using Configure > Application > Distribution > Import
Authentication Setup:
Ensure you’ve created the keystore file with the certificate
Verify the basic authentication profile is properly configured
Check that you’ve restarted the server after these configurations
RUF Implementation:
For SharePoint integration, your RUF should handle authentication and token management
The parameters should include clientID, tenantID, scope, keyStoreName, authProfileName, and token (as output)
Current Best Practices for RUF Calls
The method for calling RUFs from Java steps hasn’t significantly changed in Pega 24.2+. The fundamental approach remains the same as in previous versions. However, Pega generally recommends:
Using declarative approaches when possible instead of Java steps
When Java is necessary, encapsulating complex logic in RUFs rather than inline Java
Ensuring proper library generation and server restarts after changes
Debugging Suggestions
To troubleshoot this specific error:
Check the Exact Library Name:
Open your SP_Library rule and note the exact case-sensitive name
Verify the ruleset it belongs to
In your Java step, use the lowercase version with underscores: ruleset_name_sp_library.SP_Funtion(...)
Inspect Generated Java:
After generating the library, you can check the generated Java class in the PegaRULES database
This can help confirm if the library was properly generated
Try a Simple Test:
Create a simple test RUF that returns a string value
Call this from a Java step to verify the basic mechanism works