Sailpoint IdentityNow beforeProvisioning Rule error

Hi, I have one query on webservice beforeRule. I have updated beforeRule in sanbox. here is the use case… there are many submethods which I have added in beforeRule without any error, but when I include the main method to call the submethods I am getting this error:

"java.security.PrivilegedActionException: org.apache.bsf.BSFException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: ``import java.util.Map; \timport sailpoint.object.ProvisioningPlan; \timport sailpoi . . . '' : Command not found: CreateTestAccount

All submethods used by CreateTestAccount got updated successfully.

Could you please guide me on this issue.

how can I call main methods in beforeRule where it used submethods.

Would you be able to share your rule?

Hi @mpotti here is the code from my rule:

if (null != provisioningPlan && null != requestEndPoint && Util.isNotNullOrEmpty(requestEndPoint.getUniqueNameForEndPoint()) && null != application)
		{
			    log.info("xxxxxxxxxxx Starting capamdev BeforeRule 01 xxxxxxxxxxx");
				log.info("xxxxxxxxxxx requestEndPoint.getUniqueNameForEndPoint  :: "+requestEndPoint.getUniqueNameForEndPoint());
				AccountRequest acctReq = getAccountRequest(provisioningPlan, application.getName());
				log.info("xxxxxxxxxxx acctReq.getOperation  :: "+acctReq.getOperation());
				log.info("xxxxxxxxxxx acctReq.getAttributeRequests()  :: "+acctReq.getAttributeRequests());
				log.info("xxxxxxxxxxx provisioningPlan xml  :: "+ provisioningPlan.toMap());
				log.info("__________X_____________");
				
				
				if(AccountRequest.Operation.Create.equals(acctReq.getOperation())){
					log.info("xxxxxxxxxxx inside BeforeRule 02 create ops xxxxxxxxxxx");
					List attReqList = acctReq.getAttributeRequests();
					log.info("**** test A01 ***");
					if(null != attReqList && !attReqList.isEmpty()){
					log.info("**** test A02 ***");
					for(AttributeRequest acctReq : attReqList){
						log.info("**** test A03 ***");
						}
					}
					log.info("__________XX_____________");
					String stringResponse2 = CreateTestAccount("testuser", "test user");
				}

here when I perform create account activity, I am getting below error in log:

{"exception":{"stacktrace":"java.security.PrivilegedActionException: org.apache.bsf.BSFException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: ``import java.util.Map; \timport java.util.HashMap; \timport sailpoint.object.Provis . . . '' : Typed variable declaration : Command not found: CreateTestAccount(java.lang.String, java.lang.String) : at Line: 232 : in file: inline evaluation of: ``import java.util.Map; \timport java.util.HashMap; \timport sailpoint.object.Provis . . . '' : CreateTestAccount

This CreateTestAccount method is defined in same rule after if condition. All dependent methods are there in same rule.

Could you please help me on missing part.

Hi Himanshu,

In java, the compiler will read your code from top to bottom. You will need to move your CreateTestAccount function to the top of your rule. Then the compiler will recognize the function before you call it.

Let me know if that resolves your issue!

Thanks,

Liam

Hi @liamkokeeffe Thanks for your response. I arranged the java method i.e. from top to bottom approach and it worked!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.