cancel
Showing results for 
Search instead for 
Did you mean: 
1WSCGomez
Moderator
Moderator

We have two ways of entity linking through the graph.

  1. Direct linking
  2. Linking through a scheduler
  3. We do not recommend direct linking without using the scheduler.
  4. The scheduler should have a minimum 30-minute time interval as per best practice.

There can be only 2 issues with entity linking.

  1. Entity not getting linked.
  2. The wrong entity getting linked.

Entity not getting linked:

If you are performing a new implementation, please make sure the scheduler is created and running.

Please refer to this doc to understand how to create a scheduler: https://docx.riversand.com/docs/create-a-schedule-to-link-entity-to-a-product?highlight=create%20sch...

If the scheduler is running, you can find scheduled info for every trigger irrespective of Business Rule or if there was any entity qualified for a graph or not using the below query.

Payload:

{

    "params": {

        "query": {

            "filters": {

                "typesCriterion": [

                    "scheduleinfo"

                ]

            }

        },

        "fields": {

            "attributes": [

                "_ALL"

            ]

        }

    },

    "options": {

        "maxRecords": 30

    }

}

URL: /api/schedulerservice/get

Screenshot of payload and response

 
1WSCGomez_0-1796390393073.png

You can filter with scheduleTaskName or scheduleID and find historicalInvocation. If you do not see this please review the scheduler configuration.

Any entity linking fails for two reasons:

  1. BR is not getting triggered.
    1. The BR definition:
    2. Rule context mapping:
  2. Invalid graph model

 

BR is not getting triggered:

Invalid Graph Model:

To identify whether the graph model is invalid, at first we need to know whether the graph model is being invoked or not.This can be done through Application logs, by searching the entity id (system generated GUID)  and the required graph model. If details shows a log of starting graph for the given model, this will imply the graph is being triggered.

1WSCGomez_4-1796390263709.png

 

If there is no log similar to the above screenshot, implies graph was never called which also implies the BR might not have triggered at all. If we see the above logs getting logged and still the entity is not getting linked, we need to check the match criteria configured for the respective  graph model

Second, ensure that the relationship is created at the child/children, so that no timing issue occurs during the linking.

For example, Product(parent) and Sku(child), the relationships must be created at the child that is the sku.

     

 Query to verify if relationship is getting created at child

Check relationship of entity Expand source

API: http://{{WEBURL}}:{{WEBPORT}}/{{TENANT_ID}}/api/entityservice/get
 
{
  "params": {
    "query": {
      "id": "9876zyxv",
      "filters": {
        "typesCriterion": [
          "sku"
        ]
      }
    },
    "fields": {
      "attributes": [
        "_ALL"
      ],
      "relationships": [
        "_ALL"
      ]
    },
    "options": {
      "maxRecords": 1
    }
  }
}
 

 

Output:

1WSCGomez_3-1796390239536.png

 

Note: Verify if the relationships section appears in the output section. If it appears then the modelling is correct.

 

Query to verify where the if relationship is getting created at parent.

To check relationship at parent level Expand source

API: http://{{WEBURL}}:{{WEBPORT}}/{{TENANT_ID}}/api/entityservice/get
 
{
  "params": {
    "query": {
      "id": "1234abcd",
      "filters": {
        "typesCriterion": [
          "product"
        ]
      }
    },
    "fields": {
      "attributes": [
        "_ALL"
      ],
      "relationships": [
        "_ALL"
      ]
    },
    "options": {
      "maxRecords": 1
    }
  }
}

 

Note: Ensure the relationships tag does not show in the output of the query. If the relationships tag shows up then there is an issue with the modelling.

 

Query to find all the graph models:

Get all graph models Expand source

API : http://{{WEBURL}}:{{WEBPORT}}/{{TENANT_ID}}/api/entitymodelservice/get
 
{
  "params": {
    "query": {
      "filters": {
        "typesCriterion": [
          "graphProcessModel"
        ]
      }
    },
    "fields": {
      "attributes": [
        "_ALL"
      ],
      "relationships": [
        "_ALL"
      ]
    }
  }
}

The wrong entity getting linked. 

An entity gets linked only through the graph model, if a wrong entity is getting linked this will be an issue with the graph model itself.

The wrong entity getting linked. 

An entity gets linked only through the graph model, if a wrong entity is getting linked this will be an issue with the graph model itself.

Please post your questions in the comments section.

Version history
Revision #:
2 of 2
Last update:
12 hours ago
Updated by:
 
Contributors