I have created a form in sailpoint iiq.
There is a field in which I have written few scrits. Part of the sript is getting very long. I need to store that part of script in a rule library and need to give its reference in the form’s field.
What should be the format of that rule library and how can I give the reference of that code in field’s script.
Check out below sample.
<Field displayName="Display Name" name="displayName" type="string">
<Script>
<Includes>
<Reference class="sailpoint.object.Rule" name="Vishal Test Library"/>
</Includes>
<Source>return getVishalValue();</Source>
</Script>
</Field>
Hi @vishal_kejriwal1
This is my rule library which I created
And I am giving reference like this
Its not working
give it try like below
<Field displayName="User Status" dynamic="true" name="status" postBack="true" type="string">
<AllowedValuesDefinition>
<Value>
<List>
<String>active</String>
<String>Inactivate</String>
</List>
</Value>
</AllowedValuesDefinition>
<Script>
<Includes>
<Reference class="sailpoint.object.Rule" id="7f00000195641f7e8195746ae6511757" name="Test Rule For Form"/>
</Includes>
<Source>
if (null != value && void != value) {
return getUserStatus(value);
}
</Source>
</Script>
</Field>
Example Rule
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="beanshell" name="Test Rule For Form" significantModified="">
<Source>
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Log logger = LogFactory.getLog("rule.test");
import sailpoint.api.*;
import sailpoint.object.*;
import sailpoint.tools.*;
String getUserStatus(String str) {
if (str.equals("active")) {
return "Enable";
}
return "Disable";
}
</Source>
</Rule>
Hope it works!