Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to know if name (aka title) attribute value is synchronized with primary text attribute value

Hello,

The situation:
We have developed a custom widget, which uses the DNG Javascript API, and a custom application, which uses the Lyo/OSLC API. to retrieve and manipulate requirement's attributes. In both cases we read and manipulate requirement attribute values.
In DNG the primary text and name attribute value are synchronized, if name attribute was not modified by the user. So, if name was modified, these both attribute are un-synchronized and may differ over time.
(see explanation by @matt99)

The problem:
When using one of the APIs, the name/title value is returned, even if it is only synchronized with the primary text attribute value.

The expectations:
The name/title attribute value is not returned (or at least empty), since it is not defined by the user explicitly by the user.
Alternatively, there is some indication if the name/title value is derived from the primary text value.

Does maybe a solution already exist, which would match with our above described expections?

Thank you & Kind regards,
 Benjamin

0 votes


Accepted answer

Permanent link

In the OSLC API you can look for this artifact attribute in the RDF resource: 

xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
<rm:hasServerGeneratedTitle rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</rm:hasServerGeneratedTitle>

false indicates that the artifact has it's own name/title,
true indicates that the artifact name/title is derived from the primary text content.

Benjamin Röhl selected this answer as the correct answer

0 votes

Comments

Thanks for your quick reply.
Could you please also say since which DNG version this property is available?

Couldn't find the exact version when this feature (and property) was introduced, but I see it already present in DNG 4.0.7, so it started in one of the 4.0.x versions.

I tried to find the property "hasServerGenerated" in the RDF representation of a requirement resource, but without success.

Could you please guide me how to query the resource, so the property is included @bbekker ?

It can be retrieved by not using OSLC API, instead using the private API.

Thus, you have to put "DoorsRP-Request-Type: private" as request header, instead of "OSLC-Core-Version: 2.0".

Which version are you using? We are using DNG 6.0.4 and I was not able to get this data by using GET on e.g. https://<server>/rm/resources/MB_07c68fb661f54a7aa1ef7bd72461b3f3 with "Accept: application/rdf+xml" and "DoorsRP-Request-Type: private" headers
Thank you!

It is working with 6.0.5iFix004

showing 5 of 6 show 1 more comments

2 other answers

Permanent link

 The javascript API does not expose the information you need unfortunately (it gives you the Title as an attribute value without any indication of whether it is dynamically generated from the primary text or explicitly set in the artifact).

If you really cared, there is a pattern for having the javascript API call out to an external service that can  make OSLC requests back to the RM server to discover the information you need.

1 vote


Permanent link

Thanks to @bbekker for OSLC API hint.

But, is there also something for the Javascript API?
If not, I would create a change request for this.

0 votes

Comments

I'm not really familiar with the RM Javascript extensions, but would think that with the RM.Data.getAttributes method you can access that property.

If it's not, you can put in a request for enhancement, which you can do here: IBM Software RFE Community

I was not able to use the RM.Data.getAttributes method. Has this been proven to work? Using DNG 6.0.4

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,932
× 478
× 152

Question asked: Nov 23 '17, 12:03 p.m.

Question was seen: 4,618 times

Last updated: May 24 '18, 5:06 a.m.

Confirmation Cancel Confirm