Loading
Unified Catalog
Associate Context Definitions with Unified Catalog

Associate Context Definitions with Unified Catalog

Associate active context definitions with Unified Catalog to make their predefined attributes available when you build service processes for Case, Incident, or Service Request. If a flow sends custom context data to an invocable action, configure Apex-defined resources in Flow Builder.

Required Editions

Unified Catalog Editions and Permissions.
User Permissions Needed
To associate context definitions with Unified Catalog:
  • Unified Catalog Admin
  • Context Service Admin

Before associating a context definition with Unified Catalog, create a context definition, map attributes, and activate the context definition.

Note
Note

Unified Catalog uses only the Output and Input-Output attribute types for each node.

Associate an Apex Class with a Context Definition

  1. From Setup, in the Quick Find box, enter Unified Catalog, and then select Unified Catalog.
  2. Click New Context Definition.
  3. Specify the context definition details.
    1. Select the context definition to associate with Unified Catalog.
    2. Select the mappings for Read and Write.
    3. To handle custom logic, click New Apex Class and create custom Apex classes. Otherwise, use the provided default options.

      This process requires Apex classes. The classes define the data structure required to transfer information from a Salesforce flow to an invocable Apex action.

      Note
      Note All custom Apex classes must use the context definition's API name as a prefix. All classes must also include the tag names of the context-definition attributes as properties or class fields.
  4. Save your context definition.

    The context definition is now available for selection within the Unified Catalog's selected process type.

Send Custom Context Data from Flow Builder

If a flow sends custom data to an invocable action, use Apex-defined resources to define the data structure and pass the collected data to the action.

  1. In Flow Builder, go to the Manager tab and click New Resource.
  2. Set Resource Type to Variable.
  3. Enter an API name, such as contextDef, and optionally enter a description.
  4. Set Data Type to Apex-Defined.
  5. 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.
  6. If the variable requires access outside the flow, select Available for input or Available for output.
  7. Click Done.
  8. Add an Assignment element to the flow to populate the data structure. Specify its name and API name, such as assignContextData.
  9. 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.
  10. To send the data to the invocable action, add an Action element to the flow for the invocable action. For example, use the illustrative action name SampleService.
  11. In the Set Input Values section, turn on the Context Attributes switch to include context resources and add the new resource.
  12. Locate the input field for the context data, such as contextDef, and use the populated Apex-Defined variable from the Assignment step as the input value.
  13. Save and activate the flow.
 
Cargando
Salesforce Help | Article