OrgPreferenceReadiness

Use this node to inspect preferences in the org before the app is created.

Asset Type Name for Rules 

Not supported

Example Definition in chain.json 

1{
2  "name": "perform_readiness_checks",
3  "label": "Performs Readiness Checks",
4  "dominoVariant": "sfdc_internal__UnifiedAnalyticsDominoVariant",
5  "parameters": {},
6  "definition": {
7    "nodes": {
8      "readiness_check1": {
9        "graphNodeType": {
10          "name": "OrgPreferenceReadiness"
11        },
12        "parameters": {
13          "name": "RequiredChecks",
14          "preferenceNames": ["S1DesktopEnabled","InsightsEnabled"]
15        },
16        "sources": [],
17        "runAs": "CurrentUser"
18      },
19      "readiness_check2": {
20        "graphNodeType": {
21          "name": "OrgPreferenceReadiness"
22        },
23        "parameters": {
24          "name": "OptionalCheck1",
25          "preferenceNames": ["${Variables.optionalPreference1}"],
26          "condition": "${Readiness.RequiredChecks.InsightsEnabled}",
27          "valueOnError": {"${Variables.optionalPreference1}":  false}
28        },
29        "sources": ["readiness_check1"],
30        "runAs": "CurrentUser"
31      }
32    }
33  }
34}

Parameters 

ParameterDefinition
name(Required) The name of the readiness check. For example, the result of readiness_check1 is stored as ${Readiness.RequiredChecks}.
preferenceNames(Required) A non-empty list of org preference names to check.
condition(Optional) An EL expression, evaluated at runtime, that determines whether to run this readiness check task or not.
valueOnError(Optional) A Map<String, Boolean> containing the default values of each of the org preference check in the event of an error or failure. Each key in the map must be defined in the preferenceNames attribute.

Set runAs to CurrentUser so that this node runs with the permissions of the user installing the app. If you omit runAs, the node runs as AutoProc, a system user.

Note

App Context Values 

App Context ValueDefinition
Readiness.RequiredChecks.<PreferenceName>A boolean value that indicates whether the preference is enabled (true) or not (false).

On Failure 

Failure handling depends on whether valueOnError is defined:

  • If no valueOnError is defined, the result is passed through as it is. A failed check returns FAIL_TERMINAL and the chain stops.
  • If valueOnError is present and the task succeeded, the result is passed through as it is.
  • If valueOnError is present and the task failed for any reason, the task returns WARN_AND_CONTINUE and passes along the error message. valueOnError is written to the app context so that downstream nodes can continue.

See Also