12 hours ago - edited 12 hours ago
We have two ways of entity linking through the graph.
There can be only 2 issues with entity linking.
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
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:
BR is not getting triggered:
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.
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:
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"
]
}
}
}
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.
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.