NOTICE: Our Community is moving. Get more information.
After adding a new requirement programmatically why can the requirement not be found in the requirement tree?
CaliberRM stores the requirement tree in a local cache. After
adding a requirement through the SDK and you try to access find the
requirement in the requirement tree ?null? will be returned. To
solve this you will need to clear the cache and reload the
The following sample code demonstrates creating a new
requirement and updating the requirement tree.
//Set to first project
Project p= session.getProjects();
//Set to current baseline
Baseline b = p.getCurrentBaseline();
//Set requirement tree
RequirementTree tree = (RequirementTree)
//Create new requirement
Requirement newRequirement = new
newRequirement.save("Created by Borland");
//As the tree is locally cached we need to update it
tree =(RequirementTree) b.getRequirementTree();