Logic Transforms
Choose a value: map the input through a table with lookup, pick the first matching rule with decision, or choose between two branches with if. All comparisons are exact and case-sensitive.
Conditions
decision rules and if use the same when clause: a JSON object of attribute names and the values they must have.
"when": { "department": "IT", "location": "India" }
- Every entry must match for the condition to be true.
- Each key names an attribute. Expected values can contain
${name}tokens. - A missing attribute never matches, and an empty
whennever matches. - Conditions test attributes only, never the input or a pipeline's current value. In a provisioning risk Value transform, the only attribute is
value.
lookup
Looks the input up in a table and returns the matching value. If the input is missing or is not a key in the table, returns the default. The input must equal a key exactly.
| Option | Description | Default |
|---|---|---|
| input | The value to look up. | The previous step's result in a pipeline; otherwise none |
| mapping | A JSON object of keys and the values to return. Returned values can contain tokens; they can't be nested transforms. | None: the default is returned |
| default | The value to return when nothing matches. It can contain tokens. | None: no value is returned |
{
"type": "lookup",
"input": "${department}",
"mapping": { "IT": "Information Technology", "HR": "Human Resources" },
"default": "Unknown"
}
department = HR → Human Resources
department = Legal → Unknown
department = hr → Unknown (keys are case-sensitive)
decision
Tries a list of rules in order and returns the result of the first rule whose when condition matches. If no rule matches, returns the default. decision ignores input and the previous step's result.
| Option | Description | Default |
|---|---|---|
| rules | A JSON list of rules. Each rule is an object with when and then. | None: the default is returned |
| rules[].when | The condition. See Conditions. | None: the rule never matches |
| rules[].then | The value to return when the rule matches. It can contain tokens; it can't be a nested transform. | None: no value is returned |
| default | The value to return when no rule matches. | None: no value is returned |
{
"type": "decision",
"rules": [
{ "when": { "department": "IT", "location": "India" },
"then": "OU=India,OU=IT,DC=example,DC=com" },
{ "when": { "department": "IT", "location": "USA" },
"then": "OU=USA,OU=IT,DC=example,DC=com" }
],
"default": "OU=Users,DC=example,DC=com"
}
department = IT, location = India → OU=India,OU=IT,DC=example,DC=com
department = IT, location = UK → OU=Users,DC=example,DC=com
Put the most specific rules first, because the first match wins.
if
Tests a when condition and returns then if it matches or else if it doesn't. Unlike decision, each branch can be plain text or a nested transform, and a nested transform receives the previous step's result when if runs inside a pipeline.
| Option | Description | Default |
|---|---|---|
| when | The condition. See Conditions. | None: the condition is false |
| then | Returned when the condition matches. Text or a transform. | None: no value is returned |
| else | Returned when it doesn't. Text or a transform. | None: no value is returned |
{
"type": "if",
"when": { "employeeType": "Contractor" },
"then": "OU=Contractors,DC=example,DC=com",
"else": "OU=Employees,DC=example,DC=com"
}
employeeType = Contractor → OU=Contractors,DC=example,DC=com
employeeType = Employee → OU=Employees,DC=example,DC=com
Nested transforms in the branches
{
"type": "if",
"when": { "employeeType": "Contractor" },
"then": { "type": "concat", "values": ["c-", "${username}"] },
"else": { "type": "lowercase", "input": "${username}" }
}
employeeType = Contractor, username = rkumar → c-rkumar
employeeType = Employee, username = PSharma → psharma
