Hi everyone
I'm looking for a way to have an attribute that represents the unique ID of an object. Of course we already have "Object Identifier", but in the case we export and re-import the module, this identifier has changed. What I'm looking for is an attribute that is automatically calculated, then in case of export and import , the value should be the same (not recalculated). The ID should be unique for the whole project and also in the case an object has been deleted and purged, it shall not be possible to use this ID again.
Does anyone already encountered such problematic ?
Thanks !! Joooris - Mon May 15 09:38:40 EDT 2017 |
Re: Unique ID attribute Sounds like requirements management...
If you don't have stuff like RMF plugin, you wil have to do this by yourself. - generate unique IDs - include IDs in your exports - import modules using unique ID attribute as key
Perhaps somebody else will have a better solution. |
Re: Unique ID attribute ChristopheP - Mon May 15 11:33:20 EDT 2017 Sounds like requirements management...
If you don't have stuff like RMF plugin, you wil have to do this by yourself. - generate unique IDs - include IDs in your exports - import modules using unique ID attribute as key
Perhaps somebody else will have a better solution. Thanks for your answer.
Actually we started to implement something.
We want to use a DXL attribute (let's call it UniqueID) with the following calculation : if value of UniqueID is empty THEN we copy the content of the identifier of the object ELSE it means there is already a unique ID value, so don't need to copy.
But, the dxl script crashs when it wants to read the value of itself : if (obj.attrDXLName != "" ) It is maybe not possible ?
|
Re: Unique ID attribute I think that a Text DXL attribute like the following should suffice: obj.attrDXLName = uniqueID(module(obj)) obj."Absolute Number" ""
obj.attrDXLName = qualifiedUniqueID(module(obj)) obj."Absolute Number" ""
|
Re: Unique ID attribute Quote "......in the case we export and re-import the module, this identifier has changed...." If you're exporting and importing using a spreadsheet format then there is no reason for existing uniqueID's to change, the DOORS spreadsheet import tool has an option to "Update existing objects". Any new rows of data added to the exported spreadsheet will be automatically given a new uniqueID within DOORS during the import. Deleted items in the exported spreadsheet have to be applied manually within DOORS.
If you're exporting and importing using a document format (MSWord, RTF) then it would be useful to know how you will import both a unique ID and requirements text using this format? This type of import will only import into the DOORS Object Heading and Object Text attributes.
Paul Miller |
Re: Unique ID attribute PMiller - Mon May 15 18:54:44 EDT 2017 Quote "......in the case we export and re-import the module, this identifier has changed...." If you're exporting and importing using a spreadsheet format then there is no reason for existing uniqueID's to change, the DOORS spreadsheet import tool has an option to "Update existing objects". Any new rows of data added to the exported spreadsheet will be automatically given a new uniqueID within DOORS during the import. Deleted items in the exported spreadsheet have to be applied manually within DOORS.
If you're exporting and importing using a document format (MSWord, RTF) then it would be useful to know how you will import both a unique ID and requirements text using this format? This type of import will only import into the DOORS Object Heading and Object Text attributes.
Paul Miller Hi, I know that the export / import is done by "Atego" tool. Note that we do not update the old one, we use the new imported module as a baseline release. It means we have two modules with the same name : one in the folder we call "current" and the other one (imported) in the folder "baseline" which is considered as a new module. With such usage, all objects identifier are calculated from absolute number "1" (for the new imported one) and makes the "diff" function fails only because identifiers of objects are different between those two modules. |
Re: Unique ID attribute Antonio__Norkus - Mon May 15 12:32:03 EDT 2017 I think that a Text DXL attribute like the following should suffice: obj.attrDXLName = uniqueID(module(obj)) obj."Absolute Number" ""
obj.attrDXLName = qualifiedUniqueID(module(obj)) obj."Absolute Number" ""
Hi,
Thank you, but I want it to be calculated only if it has not already been calculated. This is why I tried : if (obj.attrDXLName != "" ) but it sounds like Doors doesn't like it ! |
Re: Unique ID attribute Joooris - Tue May 16 03:44:11 EDT 2017 Hi,
Thank you, but I want it to be calculated only if it has not already been calculated. This is why I tried : if (obj.attrDXLName != "" ) but it sounds like Doors doesn't like it ! A DXL attribute is automatically calculated by DOORS, and the user can force a re-calculation of visible DXL attributes by clicking F5. You cannot control re-calculation manually in the attribute's DXL...as you have seen, it crashes DOORS. |
Re: Unique ID attribute Antonio__Norkus - Tue May 16 03:51:53 EDT 2017 A DXL attribute is automatically calculated by DOORS, and the user can force a re-calculation of visible DXL attributes by clicking F5. You cannot control re-calculation manually in the attribute's DXL...as you have seen, it crashes DOORS. Hi,
Yes I know that. I don't want to control the re-calculation. What I wanted was "if the cell is empty, then put the computed value, else let the cell as it is" I can do this with two attribute : one DXL attribute (dAttr), and one simple text attribute (iD). The Dxl attribute check if the iD attribute is empty, if empty it puts the computed value, else nothing => it works. But I have to use 2 different attributes. |
Re: Unique ID attribute Joooris - Tue May 16 03:44:11 EDT 2017 Hi,
Thank you, but I want it to be calculated only if it has not already been calculated. This is why I tried : if (obj.attrDXLName != "" ) but it sounds like Doors doesn't like it ! You need a real attribute, not a DXL attribute. DXL attributes will not keep their values when you close and reopen a module. So, in your script you will always have the case that the value is not yet calculated and your DXL attribute will always be identical to the object identifier -> you will have no additional value at all from a Dxl attribute... |
Re: Unique ID attribute Joooris - Tue May 16 05:10:32 EDT 2017 Hi,
Yes I know that. I don't want to control the re-calculation. What I wanted was "if the cell is empty, then put the computed value, else let the cell as it is" I can do this with two attribute : one DXL attribute (dAttr), and one simple text attribute (iD). The Dxl attribute check if the iD attribute is empty, if empty it puts the computed value, else nothing => it works. But I have to use 2 different attributes.
I don't understand why you need to do that since, for an object in a particular module, the value will never change. However, If you must have the DXL attribute write to a manual attribute, you need to account for the DXL attribute being executed in read-only mode or if the user does not have write access to the module/object/attribute. |
Re: Unique ID attribute Hi all,
Thanks for your participation !! I think I did not explain my problem clearly :)
Here is a screenshot I took of my project :
We have on the left a module where we can see the the "aID" column which is in fact "Object Identifier". Then, on the right after an export and an import we have the module with all good informations, but the "Object Identifier" attribute represented by "aID" restarted to count from "1". Note that we don't delete the first module, it is still in the project, and we need both of them for different reasons !
To sum up I'm looking for a way to get an attribute that will contain a unique value and that will be the same for both modules on each object. |
Re: Unique ID attribute Joooris - Tue May 16 11:57:48 EDT 2017 Hi all,
Thanks for your participation !! I think I did not explain my problem clearly :)
Here is a screenshot I took of my project :
We have on the left a module where we can see the the "aID" column which is in fact "Object Identifier". Then, on the right after an export and an import we have the module with all good informations, but the "Object Identifier" attribute represented by "aID" restarted to count from "1". Note that we don't delete the first module, it is still in the project, and we need both of them for different reasons !
To sum up I'm looking for a way to get an attribute that will contain a unique value and that will be the same for both modules on each object. yes, we understood the problem. The solution, as Christophe, Paul and Antonio pointed out is to run a script before(!) the export which creates a manual ("real") attribute containing either the current object identifier or a uniqueID (preferred!), let's call it "Jooris_ID". This attribute must be included in your export, it must be imported by Atego, it must be kept in the remote database. it must be sent back from Atego and you need to import it into your new "current" module. Only then you can make a match between your "baseline" module and your "current" module by comparing the "Jooris_ID" of the objects in the two modules. Objects in current with an empty Jooris_ID is new, Jooris_IDs that are not included any more are deleted, other objects where the same ID exists in both modules may have been changed in attributes, moved (restructured), received new internal or external links, soft deleted, soft undeleted, etc.
Before your next (2nd) export, you need to update the Jooris_ID in your new "current" module: if it has a value: keep it, if not: create a new uniqueID for these values. It may be that at this step you have a problem: Somehow you have to tell Atego that the new objects you received from them now get a Jooris_ID and for this you have to identify the Atego object, to solve this perhaps you get an Atego / remote_DB (?) ID that you also have to import and export again.
But perhaps Atego already has a solution for this scenario. Better double-check the documentation before implementing your own solution. |
Re: Unique ID attribute
(
Have fun ! ) |
Re: Unique ID attribute Hi All,
Thanks for your replies ! We finally developed a very simple script that copy the content of "Object Identifier" into an specific attribute (and create it in case it doesn't exist) for every object of the current module. The disadvantage is that we have to do it before every baseline, but it does the job !
Thanks again ! |
Re: Unique ID attribute Joooris - Tue May 16 03:44:11 EDT 2017 Hi,
Thank you, but I want it to be calculated only if it has not already been calculated. This is why I tried : if (obj.attrDXLName != "" ) but it sounds like Doors doesn't like it ! I think DOORS doesn't like this because you are comparing "an attribute value of an object" with a string. And with DXL if you compare 'something' with a string or if you use 'something' like a string : you will have to cast this 'something' as string to avoid such a problem. Get used to always cast things which are not strings like this: something ""
You should trie if (obj.attrDXLName "" != "" ) it will be probably ok.
Some examples (and you will find several topics about strings on the forum) :
string your_string_1 = "a text !"
string your_string_2 = "another text...."
int a_number = 5
...
if ( your_string_1 == "something" ) // this is OK
if ( your_string_1 != your_string_2 ) // this is OK
...
your_string_1 = "5"
if ( a_number == your_string_1 ) // this is NOT ok !!!
if ( a_number "" == your_string_1 ) // but this one is OK
...
print (a_number) // this works but you'd better get used to do:
print (a_number "")
print ("My number is: " a_number) // because this one will crash
print ("My number is: " a_number "") // but this one will be OK
|