This function is used to test a condition, and then process the outcome. The outcome could be as simple as True or False, another function, or returning a value in an attribute.
Example Scenarios
- Setting the UAC value to enabled or disabled, based on the user’s employee status.
- Adding or removing a user from a group, based on a certain value.
- Sending a notification, if a user meets a certain criterion.
Where can it be used?
As with any function this can be used extensively throughout Identity Panel wherever the Rule Engine is invoked. A good indicator of this is to look for the presence of a (?) button in the top right corner of a text box.
Examples include (but are not limited to) the following:
- HyperSync - Attribute Flow, Stateful Sync and various Filter rules
- Test Panel – Fixtures
- Environment Settings - Custom Rule Functions
- Reports
How the function works
The following list describes how the function works, and the steps it goes through. It is worth noting that unlike MIMWAL IIF Function, Identity Panel does not evaluate the True or False paths until a decision is made with the condition parameter.
- Function is invoked.
- Function evaluates the condition parameter.
- If the condition is true, it then processes the true parameter.
- If the condition is false, it then processes the false parameter.
- If the condition parameter fails, it returns Null.
Q&A
Q: Can I pass an attribute into the condition parameter?
A: Yes, but it will first check to see if the attribute presence, and return true if its present, and false if it is not. The exception to this is if the attribute is Boolean, in which case it will return the Boolean value stored, so if false is present, false is returned.
Pre-Requisites
None
Using the Function
Built In Documentation
If(Condition, True, False)
If (Condition) use True else use False
Deploying
Parameters
Condition
The binary (true or false) condition to evaluate in the form of a rule expression. A rule expression can be comprised of constant values, attributes, or other functions, including custom rule functions. For more complex conditions, it can be useful to create a custom rule function.
You can also nest If Statements within If Statements. When you start to have more than two if statements within your condition, it might be worth considering using the Switch Function.
Please note when passing in attributes, behavior varies according to the object type of the attribute value:
- The standard process when passing in attributes, is that the condition returns true if the attribute is present, and false if the attribute is not present.
- The exception is when the attribute is a Boolean object type. In this case, the value of the attribute is used to determine which condition to run. If the Boolean attribute is not present, it returns false.
True
The rule expression to evaluate and return if the condition resolves to a true value.
False
The rule expression to evaluate and return if the condition resolves to a false value.
Special Variables
None
Returned Value
A value of either true or false is returned, depending on the result of the condition evaluated. If there is an error in the condition evaluation itself, null is returned.
Comments
0 comments
Please sign in to leave a comment.