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

How can a single requirement be retrieved using the VB.Net SDK?

How can a single requirement be retrieved using the VB.Net SDK?

Problem:

How can a single requirement be retrieved using the VB.Net SDK?

Resolution:


  • Product Name: CaliberRM
  • Product Version: 2008
  • Product Component: SDK
  • Platform/OS Version: All

The sample VB.net code below uses a new techique to obtain a single requirement object using the SDK. This technique can be employed to prevent Java Heap memory issues when retrieving requirements from large CaliberRM databases. The code uses the new method "AllProjectIDs", details of this can be found in the following solution

How can a single project be retrieved using the VB.Net SDK?

The new SDK has a new method called "getRequirements", this method returns a CaliberRM collection of CaliberRM requirement object which then can be used to obtain a single requirement. The method syntax is as follows

Public Function getRequirements(projectID as CaliberRM.ProjectID, baseLineID as CaliberRM.BaselineID, requirementIDs as CaliberRM.Collection)

Sample VB.net Code

Dim collectionfactory As CaliberRM.CollectionFactory
Dim myreqcollection As CaliberRM.Collection
Dim req As CaliberRM.Requirement
Dim serialnumber as Integer

"obtain project
my_project = my_session.getProject(allprojids(0))

"Obtain current baseline ID
BID = my_project.CurrentBaseline.BaselineID

"Create a collection for the requirement serial number
collectionfactory = New CaliberRM.CollectionFactory
mycollection = collectionfactory.Create()

"add serial number to collection
mycollection.Add(serialnumber)

"Create collection to hold requirements
Dim myreqcollection As CaliberRM.Collection
myreqcollection = collectionfactory.Create()

"technique to obtain requirement object
For r = 0 To mycollection.Count - 1
myreqcollection = my_session.getRequirements(allprojids(0), BID, mycollection)

req = myreqcollection.Item(0)
Debug.Print(req.Name)

Next


Old KB# 30149

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 20:43
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.