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

Api client on Batch Java

Good evening everyone.
I'm trying to create a batch that automatically creates RTC workItems having N parameters in input. I have always "worked" with plugins and Server-side APIs, now I need the client ones. Can you help me understand how to initially instantiate the objects that I will need later? Like a workItemClient, like a ProjectAreaHandle and the rest?
For the projectArea having the name it should be simple but I always miss the getProcessService that I used Server-side, can you help me? Thank you very much everyone.

0 votes


Accepted answer

Permanent link

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.

Emiliano Iannetti selected this answer as the correct answer

0 votes

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

Permanent link
Good morning Ralph, thanks for the quick reply, I had already seen some links, but unfortunately I did not find the info I was looking for, I still have the link to github, which I will take a look at right away.
I also wanted to ask you in the meantime, the biggest obstacle I encounter is that using the Server side APIs, I already had everything obtainable, instead now I have to start from some attributes to create everything and I am getting a bit lost to tell the truth...
Can I ask you, if it is not too much, a few lines of addressing to obtain a ProjectArea, a WorkItem and similar, because I think I will then be able to "populate" everything, but I am missing the instantiation of the same, not using the server APIs.
In the meantime, thank you very much anyway.

0 votes

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.

  1. 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. 
  2. 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
  3. 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


You are absolutely right, in fact it was me who was at fault and I apologize. I tried to search in your guidelines but it talks about plain and not WorkItem (unless I missed it). However, trying and trying again I recovered the ProjectArea and performed the login, I just have to figure out how to create a WI from scratch and I should be there.

In the meantime, thank you very much for the answers and availability.


Permanent link
For example I found this: Using the Work Item Server API to create Work Items
But I can't find it with the client side API, am I doing something wrong in my search? Thanks.

0 votes


Permanent link
Good evening Ralph and good evening everyone.
I answer myself to the specific question, if it can be useful to someone I indicate here how I solved it:
Creating a class with all the attributes necessary for the ticket, which extends the WorkItemOperation class and implementing the run method that calls the method called execute within the class itself. This returns an IWorkItemHandle that through the resolveAuditable method instantiates the aforementioned WorkItem.

Thanks to everyone.

0 votes

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. 

Good morning, thanks for the correction, you are right, even when I speak of tickets I meant Workitem.
Thanks a lot again. 

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
× 7,495
× 1,325
× 1,220
× 234
× 36

Question asked: Nov 21, 12:10 p.m.

Question was seen: 345 times

Last updated: Nov 28, 6:19 a.m.

Confirmation Cancel Confirm