using "can be parent"
Hi,
i derived a PersistantProperty from baselang.Property. I could restrict the user to only use int and String for the type field by using childConcept...
e.g.
can be parent
(operationContext, scope, node, childConcept, link)->boolean {
if (link == link/PersistentProperty : type/) {
if (childConcept == concept/IntegerType/ || childConcept == concept/StringType/) {
return true;
} else if (childConcept == concept/ClassifierType/) {
return true;
}
return false;
}
true;
}
As one can see above, i also accept other Classes as types in my PersistantProperty. But if i use code completion, various classes are proposed as Type. But i just want my own classes proposed here - the are instances of BusinessObject. (BusinessObject extends ClassConcept).
How can i achieve this?
Any help appreciated,
Dan
i derived a PersistantProperty from baselang.Property. I could restrict the user to only use int and String for the type field by using childConcept...
e.g.
can be parent
(operationContext, scope, node, childConcept, link)->boolean {
if (link == link/PersistentProperty : type/) {
if (childConcept == concept/IntegerType/ || childConcept == concept/StringType/) {
return true;
} else if (childConcept == concept/ClassifierType/) {
return true;
}
return false;
}
true;
}
As one can see above, i also accept other Classes as types in my PersistantProperty. But if i use code completion, various classes are proposed as Type. But i just want my own classes proposed here - the are instances of BusinessObject. (BusinessObject extends ClassConcept).
How can i achieve this?
Any help appreciated,
Dan
Please sign in to leave a comment.
My problem is that i want to restrain possible child nodes. Therefore i use a constraint "can be parent". I use the link field and the childConcept filed to restrain to specific Child-Concepts. But what if my childConcept is a ClassifierType. How can i get the Classifier the ClassifierType is pointing to?
Any ideas?
Dan
You can try calling node.classifier:
node<ClassifierType> myNode;
node.classifier