Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
To delete a child concept and update the array length of the parent concept you need to use below catalog function(s):
For Contained concepts arrays.
This works as a hierarchy where each concept is contained by the concept above it, then when deleting, the instance is deleted along with any other contained instances at lower levels of the containment hierarchy.
Instance.PropertyArray.removeContainedConcept(<PropertyArrayConceptReference>,<childToDelete>);
PropertyArray.removeConceptReference(<PropertyArrayConceptReference>,<childToRemoveFromArray>);
Instance.deleteInstance(<childToDelete>);
// contained concept array (delete first child in array)
if (cp.cpChild@length>0) {
Concepts.cpChild c2=cp.cpChild[0];
Instance.PropertyArray.removeContainedConcept(cp.cpChild,c1);
}
// referenced concept array (remove the first child from array and delete it if necessary)
if (cp.cpChild@length>0) {
Concepts.cpChildRef c11=cp.cpChildRef[0];
Instance.PropertyArray.removeConceptReference(cp.cpChildRef,c11);
Instance.deleteInstance(c11);
}
When trying to delete a contained/referenced concept array child, it is possible you'll see the returned length of the contained concept array is incorrect, this is the expected behavior if you're using just Instance.deleteInstance(child), use the mentioned functions for the correct behavior.