cancel
Showing results for 
Search instead for 
Did you mean: 

PowerDesigner: Unique IDs for RQMs

0 Kudos

Hi,

We have a set of requirement models (RQMs), several colleagues are working on these models simultaneously. Therefore, it is important that we label each requirement with a fixed ID which is unique throughout all the RQMs.

Is there a way to achieve this in PD?

We had the following idea:

  1. Create a custom ID-table in the repository using SQL, which contains IDs
  2. Create an event handler which, for example after saving the model, lists all the new requirements
  3. For each new requirement, generate a new ID incrementing the latest ID in the ID-table, set the requirement’s ID and add the ID to the ID-table

This way, the IDs would be unique throughout all RQMs. The problem is that this would require every user has an ODBC connection to the DB since he needs to run SQL commands. Since we are using a proxy, this constitutes a problem.

Consequently, we have the following questions:

  • Is there a way to generate unique IDs for Requirements? Since the objects’ permanent-IDs are obviously unique in the repository, perhaps there is a way to use a similar strategy. In our opinion, there should be a way to generate unique IDs in PD, since it is otherwise veyr difficult to work on models simultaneously.
  • Is there a way to execute SQL commands via a proxy connection?
  • Is there a way to access the objects’ Permanent-IDs before the objects have been checked-in to the repository? Or are they generated during check-in?

Kind regards,

Milan

Ondrej_Divis
Contributor
0 Kudos

Hi Milan,

there is no need to create anything new. You can use unique ObjectID attribute, which is assigned to any object in PowerDesigner during its creation. By script, you can access it in your current RQM model like this:

For each req in Activemodel.Requirements
  output req.ObjectID
Next

And you can customize your model by Extension to display this unique ObjectID on the General tab in the properties of any Requirement. If you need more information, you can send me an email (available in my profile).

Regards,

Ondrej

GeorgeMcGeachie
Active Contributor
0 Kudos
If necessary, there is a PD function that allows you to generate another unique ID -

NewGUID()

(this might be useful if you want an ID that can survive "save as new model" or generating a new RQM, both of which cause new object IDs to be created)

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Ondrej,

Thanks for your reply!

Is the Object-ID unique in the repository? We also considered using the Object-ID, but we aren't sure about two things:

- If two people are working offline on two requirements, is it possible that the same Object-ID is generated? Or are they hashed in a way that they are by definition always unique?

- If I open a new branch, or if I integrate a requirement into another branch, does it still have the same Object-ID? I thought that the object's permanent-ID (POID) is constant if you have the same object in different branches, but the object-ID depends on the branch the object is located in. Or is this not correct?

Thanks and kind regards,

Milan

GeorgeMcGeachie
Active Contributor
0 Kudos

Object IDs are unique, and they do not change, as long as it's the same object in the same model. Every version of an object will have the same object ID - that's how PD knows for certain that it's the same object