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:
[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 =
<?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 =
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:
sp-rv -f C:\Users\myname\sailpoint-saas-rule-validator-3.0.41
If seeing the whole code helps:
<?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:
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