It's all about the answers!

Ask a question

Unable to update the Resource title in Design management


masoom Abdullah (53119) | asked Mar 21 '17, 7:47 a.m.

Hi,

I am able to update the Description but unable to update the title and label of a Resource in Design management. Please find the code snippet attached.



        DmClient dmClient=null;
       
        try {
            dmClient= new DmClient(user, password, url);
        } catch (DmClientException e) {
            e.printStackTrace();
        }
       
        DmProject dmProject= dmClient.getProject("ae.playground (DM external)");
       
        DmConfiguration dmConfiguration= dmClient.getDefaultConfiguration(dmProject);
       
        try{
            DmResource dmResource= dmClient.getResource("https://rb-alm-11-p.de.bosch.com/dm/models/504", dmConfiguration);
           
            if( dmResource != null )
            {
                dmResource.setDescription("Description is updated.");
                dmResource.setLabel("Label is updated.");
                dmResource.setTitle("Title is updated.");
               
                DmEditingSession editingSession = dmClient.createEditingSession(dmConfiguration);
               
                dmClient.putResource(dmResource, editingSession);
               
                dmClient.commitEditingSession(editingSession);
                       
            } else {
                System.out.println( "Resource not found");
            }
        } catch( DmClientException ce ) {
            System.out.println( "DM Client Exception: " + ce.getMessage());
        } catch (DmResourceException e) {
            System.out.println( "DM Resource Exception: " + e.getMessage());
        }

Be the first one to answer this question!


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.