It's all about the answers!

Ask a question

Fill custom date attribute with value for artifacts in dng


Sagnick Banerjee (1112) | asked Dec 11 '17, 8:36 a.m.
edited Dec 11 '17, 1:54 p.m. by Geoffrey Clemm (30.1k33035)

 I am trying to fill custom date field with some custom date value for artifacts, through oslc, by extending the extended properties of artifact.

But this do not throw any exception but neither update the date field for the artifact.
Suggest me how to update the date values programmatically.


Comments
Gabriel Ruelas commented Dec 11 '17, 9:18 a.m. | edited Dec 11 '17, 1:55 p.m.

 Hi,   Are you using OSLC reqeust directly or using o library like Eclipse Lyo ?

Best Regards.

2 answers



permanent link
Sagnick Banerjee (1112) | answered Dec 12 '17, 12:20 a.m.

Using o library like Eclipse Lyo


permanent link
Gabriel Ruelas (1.1k13) | answered Dec 12 '17, 8:24 a.m.

 In that case you can try following workaraound:

                                //Get Feature Requirement Type URL
ResourceShape featureInstanceShape = RmUtil.lookupRequirementsInstanceShapes(
serviceProviderUrl, OSLCConstants.OSLC_RM_V2,
OSLCConstants.RM_REQUIREMENT_TYPE, client, "Feature");


// We need to use Resource shapes to properly handle date attributes attributes,
// so they aren't interpreted as dateTime.
// The following 4 lines will enable the logic to properly handle date attributes
List<ResourceShape> shapes = new ArrayList<ResourceShape>();
shapes.add(featureInstanceShape);
OSLC4JUtils.setShapes(shapes);
OSLC4JUtils.setInferTypeFromShape("true");

After that Eclipse Lyo seems to handle dtaeTime fields better,

Good luck


Comments
Sagnick Banerjee commented Dec 14 '17, 4:48 a.m.

 Thanks for the feedback, but this I have already tried and it do not work. Can you please send me the date format or the code how you create a date for requirement management.

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.