Hello,
I am trying to create a hierarchy of nodes and folder in the datalayer and I am facing an issue with that.
When I create a folder on the datalayer which contains only nodes of different types, it goes smoothely without any problem. The problem starts when I want to create a Folder that contains nodes and other folders which also contains nodes.
The goal hierarchy:
- Root
- node1 (boolean node)
- parent1
- child1 (boolean node)
I tried several ways of doing that as follows: (The arguments of RegisterNodes are the name of the node, type and array length, I customized it to achieve certain goals)
Trial1:
auto Object = new ProviderNodeAllData(dlProvider, "Root", true);
Object->RegisterNodes("node1", "bool8", 0);
Object = new ProviderNodeAllData(dlProvider, "Root", true);
Object->RegisterNodes("Parent1/Child1", "bool8", 0);Trial2:
auto Object = new ProviderNodeAllData(dlProvider, "Root", true);
Object->RegisterNodes("node1", "bool8", 0);
Object = new ProviderNodeAllData(dlProvider, "Root/Parent1", true);
Object->RegisterNodes("child1", "bool8", 0);Trial3:
auto Object = new ProviderNodeAllData(dlProvider, "Root", true);
Object->RegisterNodes("node1", "bool8", 0);
auto Object2 = new ProviderNodeAllData(dlProvider, "Root/Parent1", true);
Object2->RegisterNodes("child1", "bool8", 0);Trial4:
auto Object = new ProviderNodeAllData(dlProvider, "Root", true);
Object->RegisterNodes("node1", "bool8", 0);
auto Object2 = new ProviderNodeAllData(dlProvider, "Root", true);
Object2->RegisterNodes("Parent1/child1", "bool8", 0);The issue is as shown in the picture, the folder doesn't have metadata:
Here is a part of registerNodes function:
void ProviderNodeAllData::RegisterNodes(std::string name, std::string type, int32_t ArrayLength)
{
comm::datalayer::DlResult result;
comm::datalayer::Variant data;
result = _provider->registerNode(_addressBase + "**", this);
//These if statments checks the datatype of the node to be registered and create that node for non arrays
if(type == "bool8" && ArrayLength == 0){
result = data.setValue(false);
createDataContainer(result, name, data);
.
.
.
.
}
Your help is highly appreciated.
Regards,
Osama