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

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

 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);

0 votes

Comments

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.

 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.

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.

 test


Accepted answer

Permanent link
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

0 votes

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,938

Question asked: Oct 20 '22, 2:21 a.m.

Question was seen: 795 times

Last updated: Nov 11 '22, 2:16 a.m.

Confirmation Cancel Confirm