Build Rules in Eclipse

Hello Team,
I would like to know is it safe to use eclipse of buliding all rules there, I have setup eclipse environment and it provide great help while writing rules in Sailpoint.
Questions:

  • List item

Would cloud rules will support all java related syntaxes like type-safe, any java util class etc?

List<AttributeRequest> attrRequests = accountRequest.getAttributeRequests();
			    
			    for (ProvisioningPlan.AttributeRequest attrRequest : attrRequests) {
}
  • This particular code is showing fine in eclipse, but rule is not accepting and accepting below:
List attrRequests = accountRequest.getAttributeRequests();
			    
			    for (ProvisioningPlan.AttributeRequest attrRequest : attrRequests) {
}

What are the things I should keep in mind if I am working on eclipse? Any thoughts?

Hello Deepak,

Please make sure you are using the correct import files from sailpoint.object class.

I do have coorect import, but its about using List<AttributeRequest> attrRequests vs List attrRequests

There is no difference as such. The fundamental difference between Generics in Java and their support in BeanShell lies in BeanShell’s lack of comprehensive Generics support. But even if you use it in beanshell rule, it wouldn’t cause any problem considering the code has been factored with XML parsing or CDATA has been used.

okk, validator is not accpeting List<AttributeRequest> attrRequests and I have to add List attrRequests, let see

You cannot use List<AttributeRequest> inside your rule as < messes up the xml file you are saving the rule as. Remove any <********> in your rule, like
replace List <AttributeRequest> with List

hi Deepak,

Like others have mentioned, you should not be using the Generics while converting the rule to xml based file.
I think you are worried if that will work or not. It will work and I would recommend you to still use eclipse to code first like you are doing and generate the xml file. That way you can avoid most of the logic mistakes, compile time errors and if you have to validate you can validate once in eclipse. I know their would be pain in converting Java classes to SailPoint Xml versions everytime. But if you follow that you will be able to avoid redeployments escpecially the cloud rules which will take ample amount of time and also it is cost involved in each and every deployment.

One last point I want to mention. When you are converting the java class to xml make sure you give the correct Naming convension and the code is within CDATA like below

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="beanshell" name="ActiveDirectory_BeforeProvisioningRule" type="BeforeProvisioning">
  <Description></Description>
  <Source>
    <![CDATA[
            ............................code here........................
            ...............................................................................
    ]]>
  </Source>
</Rule>
2 Likes

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