IdentityNow Before Creation Rule implementation issue

Hi,
I have an Active Directory source, and I’m trying to define a Before Creation Rule on it following the official guide:
Specifically, using in order:

  1. The rule template provided at the following link: Before and After Operations on Source Account Rule | SailPoint Developer Community ( appropriately changing the paths of $logFile and $command variables)
  2. The PowerShell Script Template provided at the following link: Before and After Operations on Source Account Rule | SailPoint Developer Community
  3. Invoked the appropriate method to set the Rule BeforeCreate to upload the rule from step 1 into the source: Connector Executed Rules | SailPoint Developer Community

However, the create account on Active Directory fails with the following error:

class sailpoint.tools.xml.PersistentHashMap cannot be cast to class java.lang.String (sailpoint.tools.xml.PersistentHashMap is unnamed module of loader \u0027app\u0027; java.lang.String is in module java.base of loader \u0027bootstrap\u0027)"]

if I remove the rule from the source the create account is executed correctly.
Could you help me understand why if the rule is set on the source (as per previous step 3) the error mentioned above is detected?

Thanks in advance for your support.

Regards,
Paolo

Hi @psalat8887100 ,

Welcome to SailPoint Developer Community.

The above error seems like some class casting issue, would you like to share the script for better understanding?

Feel free to hide sensitive information.

Thanks,
Vijay Maripi

Hi Vijay Maripi,
at the moment, I have not produced any customizations but I have limited myself to uploading the example reported in the following links (from official documentation) just to test the functioning:

  1. The rule template provided at the following link: Before and After Operations on Source Account Rule | SailPoint Developer Community ( appropriately changing the paths of $logFile and $command variables)
  2. The PowerShell Script Template provided at the following link: Before and After Operations on Source Account Rule | SailPoint Developer Community

despite this I get the error mentioned above.

Thanks in advance for your availability,
Paolo

Hi @psalat8887100
The examples you mentioned from the official documentation are indeed templates. To address the error you’re encountering, I suggest developing the rule based on your specific requirements. Additionally, ensure that the paths mentioned in the rule are adjusted according to your environment.

Hi Gourab Sadhukhan,
as I imagined. Are there available some examples from which to start even trivially to be able to print the “context” of the rule? (something similar for this case to what in IdentityIQ is reported as “Dumping the Beanshell namespace in a rule”: Dumping the BeanShell namespace in a rule - Compass).
I add that the paths have been appropriately modified to conform to the environment I am operating on.
Alternatively it would be interesting to understand how to analyze the error (e.g. through which log file), beyond the shared error message I have no evidence of the error in any log.

Thanks,
Paolo

Hi Paolo,

Are you able to identify which line code is causing the issue? Also, can you share the code snippet of your rule.

Thanks,
Karthi