Below is the example of the SetMbUpdate operation use to add new objects to update. The request contains the list of new objects, parameters of their update and the pattern specifying that it is required to add new objects. Updated information about update elements tree is received in the response.
{
"SetMbUpdate" :
{
"tMbUpdate" :
{
"id" : "S1!M!S!MbUpd1"
},
"tArg" :
{
"pattern" :
{
"changeNodesPattern" :
{
"operation" : "Add",
"addObjectWithChildren" : "true"
}
},
"meta" :
{
"changeNodes" :
{
"it" :
[
{
"type" : "Folder",
"label" : "Folder for Object",
"enabled" : "true"
},
{
"type" : "Object",
"parentNode" : "1",
"object" :
{
"object" :
{
"@isShortcut" : "false",
"@isLink" : "false",
"@hf" : "false",
"i" : "M_UPDATE",
"n" : "Update unit",
"k" : "198414",
"c" : "1537",
"p" : "198413",
"h" : "false",
"hasPrv" : "false",
"ic" : "false"
},
"updatePart" : "Metadata",
"boundType" : "ById"
}
},
{
"type" : "Object",
"parentNode" : "1",
"object" :
{
"object" :
{
"@isShortcut" : "false",
"@isLink" : "false",
"@hf" : "false",
"i" : "D_COMPANY",
"n" : "Dictionary",
"k" : "198421",
"c" : "3076",
"p" : "198413",
"h" : "false",
"hasPrv" : "false",
"ic" : "false"
},
"updatePart" : "DataMetadata",
"includeData" : "true",
"boundType" : "ById"
}
}
]
}
},
"metaGet" :
{
"node" : "true",
"nodePattern" :
{
"customProperties" : "false",
"folder" :
{
"children" : "true",
"childrenRecursive" : "true"
},
"object" :
{
"extendedParams" : ""
}
}
}
}
}
}
{
"SetMbUpdateResult" :
{
"id" :
{
"id" : "S1!M!S!MbUpd1"
},
"meta" :
{
"rootFolder" :
{
"k" : "4294967295",
"index" : "-1",
"type" : "Folder",
"label" : "",
"condition" : "",
"enabled" : "1",
"folder" :
{
"childrenCount" : "1",
"children" :
{
"it" :
{
"k" : "1",
"index" : "0",
"type" : "Folder",
"label" : "Folder for Object",
"condition" : "",
"parentNode" : "4294967295",
"enabled" : "1",
"folder" :
{
"childrenCount" : "2",
"children" :
{
"it" :
[
{
"k" : "2",
"index" : "0",
"type" : "Object",
"label" : "Update unit",
"condition" : "",
"parentNode" : "1",
"enabled" : "1",
"folder" :
{
"childrenCount" : "0",
"children" : ""
},
"object" :
{
"object" :
{
"@ts" : "2020-04-14T10:19:08.502Z",
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "3",
"@hf" : "0",
"i" : "M_UPDATE",
"n" : "Update unit",
"k" : "198414",
"c" : "1537",
"p" : "198413",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
"isSaved" : "0",
"updatePart" : "Metadata",
"updateType" :
{
"it" :
[
"Bound",
"BindById"
]
},
"parent" : "3",
"includeChildrenDependencies" : "2",
"updateOrder" : "Default",
"includeData" : "0",
"alterType" : "Default",
"objectId" : "M_UPDATE",
"objectName" : "Update unit",
"objectOldKey" : "198414",
"constraint" : "None",
"boundType" : "ById",
"unboundType" : "Bound",
"forceUniqueId" : "0",
"forceKeepId" : "0",
"accessTokenOptions" : "Default",
"sdApplyLog" : "",
"version" : "0",
"originalMetabase" : ""
}
},
{
"k" : "5",
"index" : "1",
"type" : "DataObject",
"label" : "Dictionary",
"condition" : "",
"parentNode" : "1",
"enabled" : "1",
"folder" :
{
"childrenCount" : "0",
"children" : ""
},
"object" :
{
"object" :
{
"@ts" : "2020-04-14T10:49:39.000Z",
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "3",
"@hf" : "0",
"i" : "D_COMPANY",
"n" : "Dictionary",
"k" : "198421",
"c" : "3076",
"p" : "198413",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
"isSaved" : "0",
"updatePart" : "DataMetadata",
"updateType" :
{
"it" :
[
"Bound",
"BindById"
]
},
"parent" : "3",
"includeChildrenDependencies" : "2",
"updateOrder" : "Default",
"includeData" : "1",
"alterType" : "Default",
"objectId" : "D_COMPANY",
"objectName" : "Dictionary",
"objectOldKey" : "198421",
"constraint" : "None",
"boundType" : "ById",
"unboundType" : "Bound",
"forceUniqueId" : "0",
"forceKeepId" : "0",
"accessTokenOptions" : "Default",
"sdApplyLog" : "",
"version" : "0",
"originalMetabase" : "",
"dataObject" :
{
"method" : "All",
"primaryKey" : "",
"referenceConstraintsHandling" : "Default",
"batchMode" : "Override",
"updateRdsSequence" : "0",
"requestAdminCredentials" : "0",
"isIdentity" : "0",
"allowExistingRubricatorUpdate" : "0"
}
}
}
]
}
}
}
}
}
}
}
}
}
public static SetMbUpdateResult AddObjectInUpdate(MbId mb, string moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetMbUpdate()
{
tArg = new SetMbUpdateArg()
{
pattern = new MbUpdateMdPattern()
{
changeNodesPattern = new MbUpdateSetNodePattern()
{
operation = ListOperation.Add,
addObjectWithChildren = true
}
},
meta = new MbUpdateMd()
{
changeNodes = new MbUpdateNode[]
{
new MbUpdateNode() // Folder
{
type = MbUpdateNodeType.Folder,
label = "Folder for Object",
enabled = true
},
new MbUpdateNode() //Unit, it will be used as update unit
{
type = MbUpdateNodeType.Object,
parentNode = 1,
@object = new MbUpdateObjectNode()
{
@object = FindObjectById(mb, "M_UPDATE"),
updatePart = MbObjectUpdatePart.Metadata,
boundType = MbObjectUpdateBoundType.ById
}
},
new MbUpdateNode() //Table MDM dictionary
{
type = MbUpdateNodeType.Object,
parentNode = 1,
@object = new MbUpdateObjectNode()
{
@object = FindObjectById(mb, "D_COMPANY"),
updatePart = MbObjectUpdatePart.DataMetadata,
includeData = true,
boundType = MbObjectUpdateBoundType.ById
}
}
}
},
metaGet = new MbUpdateMdPattern()
{
node = true,
nodePattern = new MbUpdateNodePattern()
{
customProperties = false,
folder = new MbUpdateFolderNodePattern()
{
children = true,
childrenRecursive = true
},
@object = new MbUpdateObjectNodePattern()
{
extendedParams = new MbUpdateObjectNodeExtendedParamsPattern()
}
}
}
},
tMbUpdate = new MbUpdateId() { id = moniker }
};
//Set up update
var result = somClient.SetMbUpdate(tSet);
return result;
}
See also: