2025-03-06 - Graph Handler Docs

From Izara Wiki
Jump to navigation Jump to search

GraphHandler Function

CreateNode

Request Parameters

  • objType
    • Type : object
    • Required: true
  • objType.objectType
    • Type : string
    • Required : true
  • objType.serviceTag
    • Type : string
    • Required : true
  • objInstanceFull
    • Type : object
    • Required: true
  • objInstanceFull.identifiers
    • Type : string
    • Required : true
  • objInstanceFull.fields
    • Type : object
    • Required: optional
  • settings
    • Type : object
    • Required : optional
  • settings.updatePropertiesOnMatch
    • Type: Boolean // false // true
    • Required : optional
  • originTimestamp
    • Type : date.now() // number
    • Required : optional for create or update
  • relationships
    • Type : array
    • Required : optional for create
  • relationships[item]
    • Type : object
    • Required: optional
  • relationships[item].relType
    • Type : object
    • Required: optional
  • relationships[item].relationshipProperties
    • Type : object
    • Required: optional
  • relationships[item].relationshipDirection
    • Type : string
    • Required: true
  • relationships[item].targetIdentifiers
    • Type : object
    • Required: true
  • callingFlowConfig
    • Type: object
    • Required : optional
  • callingFlowConfig.callingFlow
    • Type: string
    • Required : optional

Request Example

{
  "objType": {
    "objectType": string,
    "serviceTag": string
  },
  "objInstanceFull": {
    "identifiers": {
      // ...identifier
    },
    "fields": {
      // ...fields
    }
  },
  "relationships": [
    {
      "relType": {
        "serviceTag": string,
        "relationshipTag": string
      },
      "relationshipProperties": {
        //... key and value of targetIdentifiers
      },
   	  "relationshipDirection": string, // "from" | "to"
      "targetObjType": {
        "serviceTag": string,
        "objectType": string
      },
      "targetIdentifiers": {
        //... targetIdentifiers
      }
    }
  ],
  "originTimestamp": number,    // timestamp when create
  "settings": { 
   "updatePropertiesOnMatch": boolean  // default=false
  },
  "callingFlow": string,
  "callingFlowProperties": object,
}

Output Response

  • returnValue
    • Type: object
  • returnValue.queryResult
    • Type: object
    • Description: data from created node
  • queryResult.objTypes
    • Type: array
    • Description: serviceTag and objectType
  • queryResult.exitsNode
    • Type: object
  • queryResult.userNode
    • Type: object
    • Description: return user's created.
  • queryResult.additionalReturn
  • Type: object
    • Description: data from targetNode
  • queryResult.relationships
    • Type: array
    • Description: data from relationships in targetNode
  • returnValue.objType
    • Type: object
  • returnValue.objInstanceFull
  • Type: object
    • Description: data in graph
  • returnValue.objInstanceFull.identifiers
    • Type: object
    • Description: Id has properties Key
  • returnValue.objInstanceFull.fields
    • Type: object
    • Description: data properties in graph
  • returnValue.relationships
    • Type: array
    • Description: data from relationships that create node to targetNode
  • returnValue.settings
    • Type: object
  • returnValue.Status
    • Type: string
    • Description: Status from create node. Return "error" or "complete".
  • returnValue.errorsFound
    • Type: array
  • returnValue.graphServiceTag
    • Type: string

Return Example

{
  returnValue: {
    queryResult: {
      objTypes: [
        {
          serviceTag: "string",
          objectType: "string"
        }
      ],
      objInstanceFull: {
        identifiers: {
          //...identifier
        },
        fields: { 
         //...fields
        }
      },
      existsNode: {},
      userNode: {
        objTypes: [
          {
            "serviceTag": "UserAccount",
            "objectType": "user"
          }
        ],
        properties: {
          //...properties
        }
      },
      additionalReturn: {
        targetNode0: {
          objTypes: [
            {
              serviceTag: "string",
              objectType: "string"
            }
          ],
          properties: {
           //...properties
          }
        }
      },
      relationships: [
        {
          relType: {
            serviceTag: "string",
            relationshipTag: "string"
          },
          relationshipProperties: {
            //...properties
          }
        }
      ]
    },
    objType: {
      objectType: "string",
      serviceTag: "string"
    },
    objInstanceFull: {
      "identifiers": {
        //...identifier
      },
      fields: {
        //...fields
     }
    },
    relationships: [
      {
        relType: {
          serviceTag: "string",
          relationshipTag: "string"
        },
        relationshipProperties: {
          //...properties
        },
        targetObjType: {
          serviceTag: "string",
          objectType: "string"
        },
        targetIdentifiers: {
          //...identifier
        }
      }
    ],
    settings: {}
  },
  status: "string", // "complete' or "error"
  errorsFound: [],
  graphServiceTag: "GraphHandler"
 }

GetNode

Request Parameters

  • objType
    • Type : object
    • Required: true
  • objType.objectType
    • Type : string
    • Required : true
  • objType.serviceTag
    • Type : string
    • Required : true
  • objInstanceFull
    • Type : object
    • Required: true
  • objInstanceFull.identifiers
    • Type : string
    • Required : true
  • objInstanceFull.fields
    • Type : object
    • Required: optional
  • versionedDataLabels
    • Type: Array
    • Required : optional
  • settings.updatePropertiesOnMatch
    • Type: Boolean
    • Required : optional

Request Example

{
 "objType":{
    "serviceTag":string,
    "objectType":string
 },
 "objInstanceFull":{
    "identifiers":{
     // ...identifier
    },
    "fields":{
     // ...fields
    }
 },
 "versionedDataLabels":[
   //…versionedData
 ],
 "settings": {
  "returnSystemFieldsName" :boolean // default =  true or false
 }
}

Output Response

  • {object}
  • objTypes
    • Type: array
  • objInstanceFull
    • Type: object
  • objInstanceFull.identifiers
    • Type: object
  • objInstanceFull.fields
    • Type: object
  • versionDataSystemFields
    • Type: object
  • versionDataSystemFields.versionedDataLabel
    • Type: object

Return Example

{
 objTypes: [
   {
     serviceTag: "string",
     objectType: "string",
   }
 ],
 objInstanceFull: {
   identifiers: {
     //… identifier 
   },
   fields: {
    //…fields
   }
 },
 versionDataSystemFields: {
   versionedDataLabel: {
     originTimestamp: number,
     forMatchedId: "string",
     versionedDataId: "string"
   }
  }
}

GetNodes

Request Parameters

  • objType
    • Type : object
    • Required: true
  • objType.objectType
    • Type : string
    • Required : true
  • objType.serviceTag
    • Type : string
    • Required : true
  • fields
    • Type : object
    • Required: true
  • versionedDataLabels
    • Type: Array
    • Required : optional
  • settings.returnSystemFieldsName
    • Type: Boolean
    • Required : optional

Request Example

{
  "objType":{
     "serviceTag":string,
     "objectType":string
  },
  "fields":{
    //…fields with matching value
  },
  "versionedDataLabels":[
     //…versionedDataLabels
  ],
  "settings":{
     "returnSystemFieldsName":boolean // default=false
  }
}

Output Response

  • getNodesReturnValues
    • Type: array
  • objTypes
    • Type: array
  • objInstanceFull
    • Type: object
  • objInstanceFull.identifiers
    • Type: object
  • objInstanceFull.fields
    • Type: object
  • versionDataSystemFields
    • Type: object
  • versionDataSystemFields.versionedDataLabel
    • Type: object

Return Example

{
  getNodesReturnValues: [
    {
      objTypes: [
        {
           serviceTag: 'string',
           objectType: 'string'
        }
      ],
      objInstanceFull: {
        identifiers: {
           //...identifier
        },
        fields: {
           //.. all fields-1
        }
      },
      versionDataSystemFields: {}
    },
    {
      objTypes: [
        {
        serviceTag: 'string',
        objectType: 'string'
        }
      ],
      objInstanceFull: {
        identifiers: {
        //...identifier
           },
        fields: {
        //...all fields-2
        }
      },
      versionDataSystemFields: {
        versionedDataLabel: {
          originTimestamp: number,
          forMatchedId: 'string',
          versionedDataId: 'string'
        }
      }
    }
  ]
}

UpdateNode

Request Parameters

  • objType
    • Type : object
    • Required: true
  • objType.objectType
    • Type : string
    • Required : true
  • objType.serviceTag
    • Type : string
    • Required : true
  • objInstanceFull
    • Type: object
    • Required : true
  • objInstanceFull.identifiers
    • Type: object
    • Required : true
  • objInstanceFull.fields
    • Type : object
    • Required: true
  • versionedDataIds
    • Type: object
    • Required: optional
  • originTimestamp
    • Type: number
    • Required: true
  • settings
    • Type: object
    • Required: optional
  • callingFlow
    • Type: string
    • Required: optional

Request Example

{
"objType": {
   "serviceTag": string,
   "objectType": string
},
"objInstanceFull": {
   "identifiers": {
   //…identifiers
   },
   "fields": {
   //…fields
   }
  },
"versionedDataIds": {},
"originTimestamp": number, //// timestamp when update
"settings": {},
"callingFlow": string
}

Output Response

  • returnValue
    • Type: object
  • returnValue.queryResult
    • Type: object
    • Description: data from created node
  • queryResult.objTypes
    • Type: array
    • Description: serviceTag and objectType
  • queryResult.objInstanceFull
    • Type: object
    • Description: identifiers and fields
  • queryResult.userId
    • Type: object
    • Description: data that update from user Account
  • queryResult.versionDataSystemFields
    • Type: object
    • Description: optional return versionedData
  • returnValue.objType
    • Type: object
  • returnValue.objInstanceFull
    • Type: object
    • Description: data in graph
  • returnValue.objInstanceFull.identifiers
    • Type: object
  • returnValue.objInstanceFull.fields
    • Type: object
    • Description: data properties in graph
  • returnValue.Status
    • Type: string
    • Description: status from updated node // error or complete
  • returnValue.errorsFound
    • Type: array
  • returnValue.graphServiceTag
    • Type: string

Return Example

{
   returnValue: {
     queryResult: {
       objTypes: [
         {
           serviceTag: 'string',
           objectType: 'string'
         }
       ],
       objInstanceFull: {
         identifiers: {
           //...identifiers
         },
         fields: {
          //...fields
         }
       },
       userId: {
         objTypes: [ { serviceTag: 'UserAccount', objectType: 'user' } ],
         objInstanceFull: { identifiers: { userId: 'string' } }
       },
       versionDataSystemFields: {
         versionedDataLabel: {
         }
       }
     },
     objType: { objectType: 'string', serviceTag: 'string' },
     objInstanceFull: {
       identifiers: {
          //...identifiers
       },
       fields: {
       //...fields
       }
     }
   },
   status: 'string',//"complete" // "error"
   errorsFound: [],
   graphServiceTag: 'string'
 }

CreateRelationship

Request Parameters

  • firstObject
    • Type: object
    • Required: true
  • secondObject
    • Type: object
    • Required: true
  • objType
    • Type : object
    • Required: true
  • objType.objectType
    • Type : string
    • Required : true
  • objType.serviceTag
    • Type : string
    • Required : true
  • identifiers
    • Type: object
    • Required : true
  • onCreateAddRelationships
    • Type: array of object
    • Required: optional
  • relType
    • Type: object
    • Required: true
  • relationshipDirection
    • Type: string
    • Required: true
  • relationshipProperties
    • Type: object
    • Required: true
  • Settings
    • Type: object
    • Required: true
  • settings.updateRelPropsWhenExist
    • Type: boolean
    • Required: optional
  • callingFlow
    • Type: string
    • Required: optional
  • callingFlowConfig
    • Type: object
    • Required: optional

Request Example

{
   "firstObject":{
      "objType":{
         "serviceTag": string,
         "objectType":string
      },
      "identifiers":{
        //…identifiers
      },
      "onCreateAddRelationships":[
         {
            "objType":{
               "serviceTag":string,
               "objectType":string
            },
            "identifiers":{
               //…identifiers
            },
            "relType":{
               "serviceTag":string,
               "relationshipTag":string
            },
            "relationshipProperties":{
               //…properties
            },
            "relationshipDirection":string // “from” , “to” 
         }
      ]
   },
   "secondObject":{
      "objType":{
         "serviceTag":string,
         "objectType":string
      },
      "identifiers":{
        //…identifiers
      },
      "onCreateAddRelationships":[
         //…optional 
      ]
   },
   "relType":{
      "serviceTag":string,
      "relationshipTag":string
   },
   "relationshipDirection":string, // “from” , “to”
   "relationshipProperties":{
        //…properties
   },
   "settings":{
      "updateRelPropsWhenExist": boolean, 
   },
   "callingFlow":"xxxx",
   "callingFlowProperties":{
      "graphServiceName": string
   }
}

Output Response

  • returnValue
    • Type: object
  • queryResult
    • Type: object
  • queryResult.relationship
    • Type: object
  • queryResult.relationship.relType
    • Type: object
  • queryResult.relationship.relationshipProperties
    • Type: object
  • queryResult.firstNode
    • Type: object
    • Description: return data structure from firstNode
  • queryResult.secondNode
    • Type: object
    • Description: return data structure from secondNode
  • queryResult..onCreateAddRelationships
    • Type: array
    • Description: return data structure from onCreateAddRelationships
  • returnValue.firstObject
    • Type: object
    • Description: return same data send to create relationship
  • returnValue.secondObject
    • Type: object
    • Description: return same data send to create
  • relType
    • Type: object
  • relationshipDirection
    • Type: string
  • relationshipProperties
    • Type: object
  • settings
    • Type: object
  • Status
    • Type: string
    • Description: status from create node // error or complete
  • errorsFound
    • Type: array

Return Example

{
    returnValue: {
      queryResult: {
        relationship: {
          relType: {
            serviceTag: 'string',
            relationshipTag: 'string'
          },
          relationshipProperties: {
           //…properties
          }
        },
        firstNode: {
          objTypes: [
            {
              serviceTag: 'string',
              objectType: 'string'
            }
          ],
          objInstanceFull: {
            identifiers: { //… identifiers },
            fields: {
             //… all fields
            }
          },
          onCreateAddRelationships: [
            {
              objTypes: [
                {
                  serviceTag: 'string',
                  objectType: 'string'
                }
              ],
              objInstanceFull: {
                identifiers: { //… identifiers },
                fields: { //… all fields }
              },
              relType: {
                serviceTag: 'string',
                relationshipTag: 'string'
              },
              relationshipProperties: {
               //… all properties
              }
             ]
            },
        secondNode: {
          objTypes: [
            {
              serviceTag: 'string',
              objectType: 'string'
            }
          ],
          objInstanceFull: {
            identifiers: { //… identifiers },
            fields: {
            //… all fields
            }
          },
          onCreateAddRelationships: [
           //… optional 
          ]
        }
      },
      firstObject: {
        objType: { serviceTag: 'string', objectType: 'string' },
        identifiers: { //…identifiers },
        onCreateAddRelationships: [
        //… return same data send to create relationship
        ]
      },
      secondObject: {
        objType: {
          serviceTag: 'string',
          objectType: 'string'
        },
        identifiers: { //…identifiers },
        onCreateAddRelationships: [
         //…optional
        ]
      },
      relType: {
        serviceTag: 'string',
        relationshipTag: 'string'
      },
      relationshipDirection: 'string', // “from”// “to”
      relationshipProperties: { //…properties },
      settings: { 
        updateRelPropsWhenExist: boolean
     }
    },
    Status: 'string', //“complete” // “error”
    errorsFound: []
  }