# Sailpoint IdentityNow beforeProvisioning Rule error

**URL:** <https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483>\
**Category:** SHF Discussion and Questions\
**Tags:** webservice-connector, sailpoint-identity-security\
**Created:** [November 21, 2024, 4:59pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483 "2024-11-21T16:59:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [November 21, 2024, 4:59pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483/1 "2024-11-21T16:59:43Z")

</div>

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:

```auto
"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.

---

<div class="post-metadata">

**Author:** ![mpotti](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mpotti/32/2916_2.png) [@mpotti](https://developer.sailpoint.com/discuss/u/mpotti)\
**Post date:** [November 21, 2024, 5:41pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483/2 "2024-11-21T17:41:19Z")

</div>

Would you be able to share your rule?

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [December 1, 2024, 3:30pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483/3 "2024-12-01T15:30:24Z")

</div>

Hi @mpotti here is the code from my rule:

```auto
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:

```auto
{"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.

---

<div class="post-metadata">

**Author:** ![liamkokeeffe](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/liamkokeeffe/32/29279_2.png) [@liamkokeeffe](https://developer.sailpoint.com/discuss/u/liamkokeeffe)\
**Post date:** [December 1, 2024, 11:10pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483/4 "2024-12-01T23:10:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [December 3, 2024, 1:54pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483/5 "2024-12-03T13:54:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [February 1, 2025, 1:55pm UTC](https://developer.sailpoint.com/discuss/t/sailpoint-identitynow-beforeprovisioning-rule-error/90483/6 "2025-02-01T13:55:49Z")

</div>

Closed on February 1, 2025, 1:55pm UTC

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