2025-03-27 Graph Use Case/CreateNode: Difference between revisions
Jump to navigation
Jump to search
m (Seagame moved page 2025-03-27 Graph CreateNode to 2025-03-27 Graph Use Case/CreateNode) |
|||
| Line 29: | Line 29: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
{ | { | ||
returnValue: { | |||
queryResult: { | |||
returnCreateNode: { | |||
objType: { | |||
serviceTag: 'xxxx', | |||
objectType: 'yyyy' | |||
}, | |||
properties: { //properties } | |||
}, | |||
existsNode: { }, | |||
userNode: { // if has userNode send to createNode | |||
objType: { serviceTag: 'UserAccount', objectType: 'user' }, | |||
properties: { userId: 'xxxx' } | |||
} | |||
} | |||
}, | |||
requestParams: { | |||
// return example send param | |||
} | |||
}, | |||
status: "string", // "complete' or "error" | |||
errorsFound: [], | |||
graphServiceTag: "GraphHandler" | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 05:43, 16 July 2025
Overview
Using Case
CreateNode with identifiers
Example Param
{
"objType":{
"serviceTag": "xxxx",
"objectType": "yyyy",
},
"objInstanceFull":{
"identifiers":{
"xxxx" : "yyyy"
},
"fields":{
// "optional"
"xxxx" : "yyyy"
}
},
"relationships":[],
"originTimestamp": 1234567890,
"settings":{
"updatePropertiesOnMatch": false
}
}
Example Output
{
returnValue: {
queryResult: {
returnCreateNode: {
objType: {
serviceTag: 'xxxx',
objectType: 'yyyy'
},
properties: { //properties }
},
existsNode: { },
userNode: { // if has userNode send to createNode
objType: { serviceTag: 'UserAccount', objectType: 'user' },
properties: { userId: 'xxxx' }
}
}
},
requestParams: {
// return example send param
}
},
status: "string", // "complete' or "error"
errorsFound: [],
graphServiceTag: "GraphHandler"
}
CreateNode with versionedData
Example Param
{
"objType": {
"serviceTag": "xxxx",
"objectType": "yyyy"
},
"objInstanceFull": {
"identifiers": {
"xxxx": "yyyy"
},
"fields": {
"can send all fields of versionedData",
"if send any fields of versionedData will be hook properties then return all "
},
“Relationship”: [],
"originTimestamp": 1234567890,
"callingFlow": "string"
}
Exmaple Output
{
returnValue: {
queryResult: {
objTypes: [
{
serviceTag: "xxxx",
objectType: "yyyy"
}
],
objInstanceFull: {
identifiers: {
//identifiers
},
fields: {
// fields of main node
}
},
existsNode: {},
userNode: {
objTypes: [
{
serviceTag: "UserAccount",
objectType: "user"
}
],
properties: {
userId: "xxxx"
}
},
additionalReturn: {},
relationships: []
},
objType: {
objectType: "xxxx",
serviceTag: "yyyy"
},
objInstanceFull: {
identifiers: {
// identifiers
},
fields: {
//fields of main Node and versionedData
}
},
relationships: [],
settings: {
updatePropertiesOnMatch: true
}
},
status: "complete",
errorsFound: [],
graphServiceTag: "GraphHandler"
}
CreateNode with belongTo
- Params like create basicNode & versionedData but in objectSchema optional has belongTo If in objectSchema have belongTo will create query and return dataStructure of belongTo
- Must send : x-correlation-base-user-id : xxxx AND x-correlation-target-id : yyyy ( identifiers of that node)
CreateNode with extendObjtype
- create objectSchema that have objectType for create main node eg. objectType: objectA then upload To S3
- create objectSchemathat have extendObjtype for existParentNode eg. objectType: objectB then upload To S3
- Send parameter with identifiers’s objectType of extendObjtype for create Node
CreateNode with targetNode
Example Param
{
"objType": {
"serviceTag": "xxxx",
"objectType": "yyyy"
},
"objInstanceFull": {
"identifiers": {
"xxxx": "yyyy"
},
"fields": {
"//fields"
}
},
"relationships": [
{
"relType": {
"serviceTag": "xxxx",
"relationshipTag": "yyyy"
},
"relationshipProperties": {
"// optional"
},
"relationshipDirection": "from"
"targetObjType": {
"serviceTag": "xxxx",
"objectType": "yyyy"
},
"targetIdentifiers": {
"xxxx": "yyyy"
}
}
],
"originTimestamp": 1234567890,
"settings": {
"updatePropertiesOnMatch": true
}
}
Exmaple Output
{
returnValue: {
queryResult: {
objTypes: [
{
serviceTag: "xxxx",
objectType: "yyyy"
}
],
objInstanceFull: {
identifiers: {
//identifiers
},
fields: {
// fields of npde
}
},
existsNode: {},
userNode: {
objTypes: [
{
serviceTag: "UserAccount",
objectType: "user"
}
],
properties: {
userId: "xxxx"
}
},
additionalReturn: {
targetNode0: {
objTypes: [
{
serviceTag: "xxxx",
objectType: "yyyy"
}
],
properties: {
// properties
}
}
},
relationships: [
{
relType: {
serviceTag: "xxxx",
relationshipTag: "zzzz"
},
relationshipProperties: {
relId: ""
// properties
}
}
]
},
objType: {
objectType: "xxxx",
serviceTag: "yyyy"
},
objInstanceFull: {
identifiers: {
//identifiers
},
fields: {
// fields
}
},
relationships: [
{
relType: {
serviceTag: "xxxx",
relationshipTag: "zzzz"
},
relationshipProperties: { },
targetObjType: {
serviceTag: "xxxx",
objectType: "yyyy"
},
targetIdentifiers: {
// targetIdentifiers
}
}
],
settings: {
updatePropertiesOnMatch: true
}
},
status: "complete",
errorsFound: [],
graphServiceTag: "GraphHandler"
}