# Cloud Rule Checking Errors: \[RegExRuleValidator(602)\]

**URL:** <https://developer.sailpoint.com/discuss/t/cloud-rule-checking-errors-regexrulevalidator-602/77639>\
**Category:** SHF Discussion and Questions\
**Tags:** rules, sailpoint-identity-security\
**Created:** [August 22, 2024, 12:59pm UTC](https://developer.sailpoint.com/discuss/t/cloud-rule-checking-errors-regexrulevalidator-602/77639 "2024-08-22T12:59:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhilRawlings1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/philrawlings1/32/37266_2.png) [@PhilRawlings1](https://developer.sailpoint.com/discuss/u/PhilRawlings1)\
**Post date:** [August 22, 2024, 12:59pm UTC](https://developer.sailpoint.com/discuss/t/cloud-rule-checking-errors-regexrulevalidator-602/77639/1 "2024-08-22T12:59:02Z")

</div>

Hi,  
I’m running a rule I’ve written through the "saas-rule-validator"and I’m getting this response which doesn’t seem to make sense:  
Error message:

```auto
[RegExRuleValidator(602)] <Rule> tag: Rule name 'Rule - BeforeProvisioning - OU moves' defined within the Rule tag does not match name defined in the file name of: OU moves

```

Code =

```auto
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule name="Rule - BeforeProvisioning - OU moves" type="BeforeProvisioning">
  <Description>Moves user to correct OU based upon Identity attributes</Description>
  <Source><![CDATA[

```

File name =  
 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/7/7ea01ebed92cd38f5615259dd9a25b76372d55af.png)

The error message is suggesting that the rule name != the file name (which it doesn’t according to the error message) but does if you compare the values. I’m using the following command to test the rule:

```auto
sp-rv -f C:\Users\myname\sailpoint-saas-rule-validator-3.0.41

```

If seeing the whole code helps:

```auto
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule name="Rule - BeforeProvisioning - OU moves" type="BeforeProvisioning">
  <Description>Moves user to correct OU based upon Identity attributes</Description>
  <Source><![CDATA[

import sailpoint.object.Identity;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.ProvisioningPlan.Operation;

List accountRequests = plan.getAccountRequests();

if (accountRequests != null) {
    for (AccountRequest accountRequest: accountRequests) {
        AccountRequest.Operation op = accountRequest.getOperation();
        if(op == null) continue;
        String nativeIdentity = accountRequest.getNativeIdentity();
        Identity identity = plan.getIdentity();
        String activeOU = null;
        String actualOU = null;
        if(identity != null){
            activeOU = identity.getAttribute("activeParentOu"); //Where they should be
            actualOU = identity.getAttribute("actualParentOu"); //Where they are
        }
        
        if(actualOU != null && activeOU != null activeOU != actualOU){ //If the account is not in the correct OU, move them
            accountRequest.add(new AttributeRequest("AC_NewParent", ProvisioningPlan.Operation.Set, activeOU));
        }
    }
}

  ]]></Source>
</Rule>

```

As I’m also getting this error message:

```auto
  Line 24 - [LintProcessor(0)] Could not parse line, check to ensure line is syntatically correct. Error: Encountered "activeOU" at line 24, column 49. Error occured between lines 9 and 24

```

Thanks,  
Phil

---

<div class="post-metadata">

**Author:** ![patrickboston](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/patrickboston/32/5876_2.png) [@patrickboston](https://developer.sailpoint.com/discuss/u/patrickboston)\
**Post date:** [August 22, 2024, 1:03pm UTC](https://developer.sailpoint.com/discuss/t/cloud-rule-checking-errors-regexrulevalidator-602/77639/2 "2024-08-22T13:03:00Z")

</div>

This process is goofy, but the name of your file should be:  
`Rule - BeforeProvisioning - OU moves`

and then the name attribute in the rule should just be:  
`OU moves`

Documented here: [Cloud Executed Rules | SailPoint Developer Community](https://developer.sailpoint.com/docs/extensibility/rules/cloud-rules#review-guidelines)

---

<div class="post-metadata">

**Author:** ![gourab](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gourab/32/18650_2.png) [@gourab](https://developer.sailpoint.com/discuss/u/gourab)\
**Post date:** [August 22, 2024, 1:06pm UTC](https://developer.sailpoint.com/discuss/t/cloud-rule-checking-errors-regexrulevalidator-602/77639/3 "2024-08-22T13:06:02Z")

</div>

Hi @PhilRawlings1 ,  
I noticed that there is a missing `&&` in this line. It should be:  
if (actualOU != null && activeOU != null && activeOU != actualOU) {

---

<div class="post-metadata">

**Author:** ![amahlemohlokonya](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/amahlemohlokonya/32/15504_2.png) [@amahlemohlokonya](https://developer.sailpoint.com/discuss/u/amahlemohlokonya)\
**Post date:** [August 22, 2024, 1:14pm UTC](https://developer.sailpoint.com/discuss/t/cloud-rule-checking-errors-regexrulevalidator-602/77639/4 "2024-08-22T13:14:24Z")

</div>

Hi @PhilRawlings1 , The error also indicates incorrect assignment for the String

As I’m also getting this error message:

```auto
  Line 24 - [LintProcessor(0)] Could not parse line, check to ensure line is syntatically correct. Error: Encountered "activeOU" at line 24, column 49. Error occured between lines 9 and 24

```

```
    String activeOU = null;
    String actualOU = null;

```

It should be

```
    String activeOU = "";
    String actualOU = "";

```

---

<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:** [October 21, 2024, 1:14pm UTC](https://developer.sailpoint.com/discuss/t/cloud-rule-checking-errors-regexrulevalidator-602/77639/5 "2024-10-21T13:14:31Z")

</div>

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