Integration graphs

An integration graph is a data model graph used by Guidewire App Events. It defines a set of business information to be sent to an external application as part of outbound integrations. For example, the Claim graph defines what information to send about a claim. For more information on integration graphs, see the App Events Guide.

When you generate endpoints for a custom entity, you can also add the custom resource to an integration graph if the resource has a parent resource and that parent resource belongs to the integration graph. To add the custom resource to the graph, answer the final prompt ("Should <CustomEntity> be added to an integration graph?") with "y". An additional prompt asks for the name of the graph.

When a custom entity is added to an integration graph, the REST endpoint generator modifies the following files:

  • The <graphName>_graph_ext-1.0.schema.json file
  • The <graphName>_graph_ext-1.0.mapping.json file
  • The shared_ext-1.0.apiconfig.yaml file

You do not need to configure the graph schema file. But, configurations are required in the graph mapper file and the apiconfig.yaml file.

The graph schema file

The graph schema file defines the structure of the integration graph. When you specify that you want to add a custom resource to a given graph, the REST endpoint generator adds code to the corresponding <graphName>_graph_ext-1.0.schema.json file.

For example, suppose you generated endpoints for the CustomEntity_Ext data model entity and added the corresponding resource to the Claim graph. The claim_graph_ext-1.0.schema.json file has the following code added (shown in bold):

{ 
  "$schema": "http://json-schema.org/draft-07/schema#", 
  "x-gw-combine": [ 
    "ext.claim.v1.claim_combined_ext-1.0", 
    "gw.content.cc.claim.v1.claim_graph_content-1.0" 
  ], 
  "definitions": { 
    "Claim": { 
      "properties": { 
        "customEntitiesExt": { 
          "title": "Custom entities ext", 
          "description": "The collection of custom entities ext on this claim", 
          "type": "array", 
          "items": { 
            "$ref": "#/definitions/CustomEntityExt" 
          } 
        } 
      } 
    } 
  } 
} 

Typically, the graph schema file does not require configuration.

The graph mapper file

The graph mapper file defines how information is written to the properties in an integration graph. When you specify that you want to add a custom resource to a given graph, the REST endpoint generator adds code to the corresponding <graphName>_graph_ext-1.0.mapping.json file.

For example, suppose you generated endpoints for the CustomEntity_Ext data model entity and added the corresponding resource to the Claim graph. The claim_graph_ext-1.0.mapping.json file has the following code added (shown in bold):

{ 
  "schemaName": "ext.claim.v1.claim_graph_ext-1.0", 
  "combine": [ 
    "ext.claim.v1.claim_combined_ext-1.0", 
    "gw.content.cc.claim.v1.claim_graph_content-1.0" 
  ], 
  "mappers": { 
    "Claim": { 
      "schemaDefinition": "Claim", 
      "root": "entity.Claim", 
      "properties": { 
        "customEntitiesExt": { 
          "path": "TODO RestEndpointGenerator provide a collection  
                   of CustomEntities_Ext", 
          "mapper": "#/mappers/CustomEntityExt" 
        } 
      } 
    } 
  } 
} 

You must configure the file by specifying the path for custom entity collection properties. This is typically set to the corresponding array on the parent data model entity.

Following on from the previous example, the path attribute in claim_graph_ext-1.0.mapping.json file would need to be set as follows:

{ 
  "schemaName": "ext.claim.v1.claim_graph_ext-1.0", 
  "combine": [ 
    "ext.claim.v1.claim_combined_ext-1.0", 
    "gw.content.cc.claim.v1.claim_graph_content-1.0" 
  ], 
  "mappers": { 
    "Claim": { 
      "schemaDefinition": "Claim", 
      "root": "entity.Claim", 
      "properties": { 
        "customEntitiesExt": { 
          "path": "Claim.CustomEntities_Ext", 
          "mapper": "#/mappers/CustomEntityExt" 
        } 
      } 
    } 
  } 
} 

The apiconfig mapping

The shared_ext-1.0.apiconfig.yaml maps shared element resource and collection resources to Resource Gosu file. It also specifies URI mappings for integration graphs. When you specify that you want to add a custom resource to a graph, the REST endpoint generator adds code to the corresponding shared_ext-1.0.apiconfig.yaml file.

For example, suppose you generated endpoints for the CustomEntity_Ext data model entity and added the corresponding resource to the Claim graph. The shared_ext-1.0.apiconfig.yaml file has the following code added (shown in bold):
entityURIMappings:
 CustomEntity_Ext:
    uri: "${parentUri}/custom-entities-ext/${CustomEntity_Ext.RestId}"
    parent: "TODO RestEndpointGenerator link to the parent of CustomEntity_Ext"

You must configure the file by specifying the parent for custom entities. This is typically set to the corresponding foreign key on the custom data model entity.

Following on from the previous example, the path attribute in the shared_ext-1.0.apiconfig.yaml file would need to be set as follows:

entityURIMappings:
  CustomIEntity_Ext:
    uri: "${parentUri}/custom-entities-ext/${CustomEntity_Ext.RestId}"
    parent: "CustomEntity_Ext.Claim"