You are here:
Associate Context Definitions with Unified Catalog
Enlist your context definitions in Unified Catalog to make them available for building service processes. After creating a context definition, you must make it available within Unified Catalog. This step allows its predefined attributes to be selected and included in the process type—Case, Incident, or Service Request.
Required Editions
| Unified Catalog Editions and Permissions. |
Create a context definition, map attributes, and activate the context definition.
Unified Catalog uses only the Output and Input-Output attribute types for each node.
Associate ApexClass with Context Definition
- From Setup, in the Quick Find box, enter Unified Catalog, and then select Unified Catalog.
- Click New Context Definition.
- Specify the context definition details.
- Select the context definition that you want to associate with Unified Catalog.
- Select the mappings for Read and Write.
-
To handle custom logic, click New Apex Class and create your own
custom Apex classes. Else, use the provided default options.
This process requires Apex classes. They define the specific Data Structure required to transfer information from a Salesforce Flow to an invocable Apex action.
Note All custom Apex classes must use the context definition's API name as a prefix. Also, all classes must include the tag name of the Context Definition attributes as properties or class fields.
- Save your context definition.
The context definition is now available for selection within the Unified Catalog's selected process type.
Configure Custom Dataflow in Flow Builder
Define and send custom data through Apex-Defined resources: To send the custom data collected through the Flow to an invocable action, you must first define Data Structure. You define Data Structure by using Apex-Defined Resources in the flow.
- In Flow Builder, go to the Manager tab and click New Resource.
- Set Resource Type to Variable.
- Enter API Name (for example, contextDef) and optionally a description.
- Set Data Type to Apex-Defined.
-
Select the Apex Class that you defined when creating the context
definition.
If your data structure requires deep nesting, you must repeat these steps to create separate Apex-Defined Variables for the nested custom types.
- Check the Available for input or Available for output options if the variable requires access outside the Flow.
- Click Done.
- Populate the Data Structure by adding an Assignment element to the flow and specify its name and API name (for example, assignContextData).
-
In the Set Variable Values section, populate the custom data structure:
- Assign values to the attributes of the variables.
- Use the Add operator to build the nested structure by adding the nested Apex-Defined variables into their parent variable.
- To send the data to the invocable action, add an Action element to the flow for the invocable action (for example, SampleService).
- In the Set Input Values section, turn on the Context Attributes switch to include context resources and add the new resource.
- Locate the input field for the context data (contextDef) and apply the fully populated Apex-Defined variable from the Assignment step as the input value.
- Save and activate the flow.
