Api client on Batch Java
Accepted answer
You might want to look at https://github.com/jazz-community/work-item-command-line to understand how this works.
More examples for client and server APIs are here https://rsjazz.wordpress.com/ the posts are usually tagged with server, common or client API. https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ explains the general concepts. https://rsjazz.wordpress.com/2013/03/14/what-apis-are-available-for-rtc-and-what-can-you-extend/ is a quick overview as well.
Comments
You should do the Lab 1 of the newest workshop https://jazz.net/library/article/1000 the latest releases explain how to setup for client API development. See https://rsjazz.wordpress.com/ for some good to know for the workshop and the last versions.
3 other answers
Comments
Sorry but the command line is not very useful to me or rather, at the moment we would like to manage everything on the Java API side but client, not using a command prompt.
- I wrote my blog, so that I don't have to answer every question a million times. All the examples you are looking for are there on the blog.
- If you worked with the server API you know the extensions workshop. The newest version has Lab 1 enhanced to set up a Plain Java Client development workspace. It also shows the snippet code that comes with plain Java and already should answer many of your questions
- Any Java Application needs to be called at some time - through main(). I can't see why the code for WCL, which does all the stuff you want to do, would be irrelevant.
The general pattern is, you need to startup the team platform, login, use the teamrepository object.
You get client libraries which are the client side service objects. By picking the client libraries you should prefer the common libraries over the client 'client libraries' if they provide what you need.
There are the most important links, I think
Comments
That is a valid way of doing it.
The WorkitemOperation creates the work item and sets the provided values.
You only get a workitem handle through the run() method.
The resolveAuditable() does not instantiate the work item, it gets the work item (interface) with all the attributes resolved from the (work item) handle.