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

How to change a build property dynamically with RTC SDK

Hello,

I need to alter the build definition workspace dynamically, whenever a build definition is requested. The value is based in a build definition property.

I created an adivisor (server-side) to solve this.

The problem is that the workspace is changing normaly, but the current request (wich call this advisor) is executing with old workspace value. How to change also the current request value or how to update the current request values?

Can anybody help me?

0 votes



2 answers

Permanent link
Hi, if you change the properties on a build definition they'll be used for the next build. You need to change the property to the build request instance. I generally start a build from another action and set them there (the requestBuild method have a "NewOrModifiedProperties" parameter). I'm not sure you can do this when the request has already started.

Couldn't you start the build basing on some workflow action? It would be easier to manage this behavior.

1 vote

Comments

In my case, I need to change the build definition workspace whenever a build is requested, and I need to use this new value for the same request.

Is there a way to do this, for the same action (request build)?

Really, I'm saving the build definition. I need to save (if possible) the new property value in the current request.

Is it possible to do this?


Permanent link
I tested to alter the properties from newOrModifiedBuildProperties and worked. Editing this value from newOrModifiedBuildProperties, the current request update the information normally. Below is the my code for this.
private void setWorskpaceBuilProperty(BuildRequestParamsImpl buildRequest, String newValue) {
        List<IBuildProperty> newOrModifiedBuildProperties = buildRequest.getNewOrModifiedBuildProperties();
        IBuildProperty propertyChange = null;
         for (IBuildProperty iBuildProperty : newOrModifiedBuildProperties)
            if (iBuildProperty.getName().equalsIgnoreCase(IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID))
                propertyChange = iBuildProperty;        
         if (propertyChange == null)
             return;
         propertyChange.setValue(newValue);
    }

1 vote

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,927
× 562
× 411
× 27

Question asked: Apr 20 '16, 10:14 a.m.

Question was seen: 3,854 times

Last updated: Apr 22 '16, 8:23 a.m.

Confirmation Cancel Confirm