2025-08-01 - Graph Use Case/CreateRelationship

From Izara Wiki
Jump to navigation Jump to search

Overview

Using Case

Create Relationship Basic Case

Example Param

{
  "firstObject": {
    "objType": {
      "serviceTag": "xxxx",
      "objectType": "yyyy"
    },
    "identifiers": {
      // identifiers
    }
  },
  "secondObject": {
    "objType": {
      "serviceTag": "xxxx",
      "objectType": "yyyy"
    },
    "identifiers": {
      // identifiers

    }
  },
  "relType": {
    "serviceTag": "xxxx",
    "relationshipTag": "rel"
  },
  "relationshipProperties": {
    // optionalproperties 
  },
  "relationshipDirection": "from", // or 'to'
  "settings": {
    "updateRelPropsWhenExist": false // true 
  },
  "callingFlow": "xxxx", // optional
  "callingFlowProperties": { // optional
    "graphServiceName": "GraphHandler"
  }
}

Example Output

  • Note!: If send parameter updateRelPropsWhenExist = false , return will not update relationship properties // if send parameter updateRelPropsWhenExist = true return will update relationship properties
{
 returnValue: {
   queryResults: {
      objects: [
        {
          objType: {
            serviceTag: "xxxx",
            objectType: "yyyy"
          },
          identifiers: {
           //identifiers
          }
        },
        {
          objType: {
            serviceTag: "xxxx",
            objectType: "yyyy"
          },
          identifiers: {
        //identifiers
          }
        }
      ],
      relType: {
        serviceTag: "xxxx",
        relationshipTag: "rel"
      },
      relationshipProperties: {
       // properties
      },
      settings: {
        updateRelPropsWhenExist: true // or false
      }
    }
  },
  requestParam: {
    // return example send param
  }
  status: "complete", // or error
  errorsFound: []
}

Create onCreateAddRelationships

Create Relationship If Parent Not Have