How to Associate a work item with a changeset while delivering it to stream using RTC SDK
We are using RTC SDK to read some details from the repository.
We have referred to the following link:
https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl
It works well as far as reading data is concerned.
We are also trying to commit data using the API's provided by the SDK but we are facing problems while delivering it to the stream. The precondition defined to associate a work item with the change set doesn't allow us to deliver the same.
Is there a way by which we can associate an existing work item or new work item with the change set? This would help us delivering the content into the stream.
Any Help is highly appreciated.
Thank You,
Youraj
Accepted answer
Please read https://jazz.net/library/article/292 . Based on that add a new role to your process configuration for example name it automation.
Add this role to the automation user and order the roles so that the automation role is on the top (or the first role in the member view. This is the primary role.
Then go to the operational behavior configuration. If you check the operational behavior is configured for the automation user but don't enter the precondition that stops you from delivering today, or make it optional, like in the image below, the following happens (provided the automation user has the role in the process area that owns the stream). The operational behavior will find the user has role Automation, it will look for the operation, find there is a configuration and there is nothing configured (or only optional). The operational behavior will fire (or not fire) for this role. Since operational behavior only fires for the first role found, this user would not have to provide a work item link.
This way you basically override the operational behavior configuration for the secondary roles. The image below adds the configuration that is overwritten for everyone.
Comments
I added the image for the configuration for role Everyone.
Hi Ralph,
Thanks for the detailed description. But i am aware of this approach where in you can remove all the preconditions in RTC Eclipse Client. I am wondering if i could do the same using any of the API's in my source code before invoking deliver API.
e.g.
Before i invoke
/Method used to deliver/
workspace.deliver(stream, sync, Collections.EMPTY_LIST,
sync.outgoingChangeSets(component), monitor);
Is there any API like
OverrulePrecondition()
/Can be used to overrule all defined preconditions
The intent, here, is to successfully commit and deliver the content to the stream over-ruling all the preconditions.
Regards,
Youraj
Hi Youraj,
to me this makes no sense at all. You can configure the process in such a way, that you can deliver with your automation user as described above. Human users don't get the role required to do that. Or rather, it is up to you which user has which role and which process enactment applies to that user. From my perspective that is how it should be done.
I would not give the automation user Admin rights that allows him to reconfigure the process. Mutch too dangerous and expensive.
The Eclipse client can overrule server preconditions, if they are configured to allow that. Other than that a server precondition that is mandatory can not be overruled.
The Eclipse Client is used to configure the process -> some API in Eclipse can configure the process (operational behavior) -> you can use some mechanism in Eclipse to change the process so that behavior does not apply to the automation user.
I have not played with that part of the API and don't currently intent to. You can try that path, I would suggest to rather follow the proposal above.
Hi Ralph,
From the eclipse RTC Client a user having all admin privileges can overrule all the preconditions while delivering the change set. I believe this is being done by calling some API's internally which forcefully overrule all the preconditions. My question here is whether these API's are exposed or not. If these are already there in the exposed source API's list, i can very well make use of them.
Please correct me if i am wrong here.
Regards,
Youraj
The additional role creation and configuring no preconditions for the role helped me to deliver the changes.
Thank you for your help.
Regards,
Youraj
Got confused and deleted my unnecessary comment.
One other answer
- You can create a special role and assign it to the user that runs the automation. Make it the primary role and override the requirement to associate a work item for this role.
- You can link a work item to the change set.
For the latter option, see http://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ for how to look at change sets in this context, see http://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ and http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/ for the link API. If you use the Client Libraries look at http://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ how to set it up together with the API to have access to the source code.