Alternative to setAllowedValuesDefinition()

Hi all,

Is there an alternative to setAllowedValuesDefinition() function in SailPoint?

I need this to bypass a validation that is restricting value selection in a form.

Thanks in advance

Hi

You can achive that by using a Rule:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="beanshell"  name=Identity_Create_Allowed_Values_Areas" type="AllowedValues">
    <Description>Allowed Values Rules are used by provisioning policies to
        determine the possible values of the policy fields.</Description>
    <Signature returnType="Object">
        <Inputs>
            <Argument name="log">
                <Description>
                    The log object associated with the SailPointContext.
                </Description>
            </Argument>
            <Argument name="context">
                <Description>
                    A sailpoint.api.SailPointContext object that can be used to query
                    the database if necessary.
                </Description>
            </Argument>
            <Argument name="identity">
                <Description>
                    The Identity object being provisioned.
                </Description>
            </Argument>
            <Argument name="form">
                <Description>
                    The Form object for the provisioning plan.
                </Description>
            </Argument>
            <Argument name="field">
                <Description>
                    The Field object being analyzed.
                </Description>
            </Argument>
        </Inputs>
        <Returns>
            <Argument name="value">
                <Description>
                    An Object (possibly a Collection) of the allowed values for the given
                    field..
                </Description>
            </Argument>
        </Returns>
    </Signature>
    <Source>
        <![CDATA[
	  import java.util.List;
	  import xyz.EntityOrganizationManager;

 	 String entityName = (String) form.getField("entity").getValue();
	  return EntityOrganizationManager.getAreas(entityName);

 ]]>
    </Source>
</Rule>

and then the rule can be used in your form like here:

 <Field displayName="Bereich" dynamic="true" filterString="" name="area" postBack="true" required="true" section="Organisation/Funktion" type="string">
      <AllowedValuesDefinition>
        <RuleRef>
          <Reference class="sailpoint.object.Rule" name="Identity_Create_Allowed_Values_Areas"/>
        </RuleRef>
      </AllowedValuesDefinition>
    </Field>

the method return a list of values that are dynamically calculated:

public static List<String> getAreas(String entityName) {}
2 Likes