Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

After adding a new requirement programmatically why can the requirement not be found in the requirement tree?

After adding a new requirement programmatically why can the requirement not be found in the requirement tree?

Problem:

After adding a new requirement programmatically why can the requirement not be found in the requirement tree?

Resolution:


  • Product Name: CaliberRM Java SDK
  • Product Version: All Versions
  • Platform/OS Version: All

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 requirement tree.

The following sample code demonstrates creating a new requirement and updating the requirement tree.

//Set to first project

Project p= session.getProjects()[0];

//Set to current baseline

Baseline b = p.getCurrentBaseline();

//Set requirement tree

RequirementTree tree = (RequirementTree) b.getRequirementTree();

//Create new requirement

Requirement newRequirement = new Requirement("New Requirement",p,reqType,0,session);

newRequirement.save("Created by Borland");

//As the tree is locally cached we need to update it

tree.getManager().getCache().clear();

tree =(RequirementTree) b.getRequirementTree();

tree.save();


Old KB# 15787

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 18:25
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.