It's all about the answers!

Ask a question

how to set custom enum attributes of DNG artifacts using extended properties?


thimmaiah aa (263) | asked Oct 20 '22, 2:21 a.m.
edited Nov 04 '22, 2:22 a.m.

 Hello,

Im trying to set the custom enum value of a DNG artifact using extended properties of a requirement object. But im getting a 403 forbidden error. Im able to set the string attributes using the same code but not enum attributes. Any hints on this?

QName targetQName = new QName(namespaceURI, localPart, prefix);
Map<QName, Object> reqMap = requirement.getExtendedProperties();
reqMap.put(targetQName, “rdf uri of enum value”);
requirement.setExtendedProperties(reqMap);


Comments
Ian Barnard commented Oct 20 '22, 3:38 a.m. | edited Oct 20 '22, 3:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

What version+ifix are you using?


IME it's simplest to get the HTTP operations to be correct and working before trying to write code to produce those operations, i.e. use a REST browser extension in a logged-in browser tab to get the PUT working. Then if it doesn't work when you've coded it use a trace of the HTTP operations from your code to compare with the working trace from using the REST extension.


thimmaiah aa commented Oct 20 '22, 5:20 a.m.

 Its the 7.0.2 version with ifix013. I'm able to set the custom attributes using put request in the Restlcient, But i'm unable to do so using extended properties api.


Ian Barnard commented Oct 20 '22, 7:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Need much more detail - please edit into your question an example of a PUT that fails - the actual URL used, all the headers (titles of cookies is sufficient), the body, obfuscating SERVER:PORT as needed. Also show the full response/headers/body.


Shailee Sinha commented Nov 11 '22, 2:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR

 test

Accepted answer


permanent link
thimmaiah aa (263) | answered Oct 25 '22, 3:06 a.m.
Finally I found what was missing. The value should be the URI object as mentioned below


QName targetQName = new QName(namespaceURI, localPart, prefix);
Map<QName, Object> reqMap = requirement.getExtendedProperties();
reqMap.put(targetQName, new URI( “rdf uri of enum value”));
requirement.setExtendedProperties(reqMap);

this updates the enum values using extended properties.

Ralph Schoon selected this answer as the correct answer

Your answer


Register or 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.