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

Destination State Consistency - Api Client Java Batch

Good morning everyone.
I'm looking for a clean way to check if the action assigned to a WorkItem is among the valid ones on the client side.
Now on the server side I have the method that does it, through IWorkflowInfo, I can retrieve the permitted states and I do a simple consistency check between what is set and those permitted.
I tried to replicate the same feature on the client side too, but I can't, when I go to do:
IWorkflowInfo workflowInfo = (IWorkflowInfo) teamRepository.getClientLibrary(IWorkflowInfo.class); this object is null, even if it doesn't report any errors in compilation, I don't think I'm missing libraries or anything else, it's more likely that there is no such functionality on the client side. Having said that, is there a way to get the permitted actions / states, from a starting state? Of course on the client side? I tried to search on Jazz and on google, but maybe I'm using the wrong words, unfortunately I didn't find what I'm looking for. Thanks to everyone in advance.

0 votes


Accepted answer

Permanent link
com.ibm.team.workitem.common.workflow.IWorkflowInfo is part of the common API which typically exists on the client and on the server. You can get the workflow info using IWorkItemCommon.findWorkflowInfo(). E.g. IWorkflowInfo wfInfo = getWorkItemCommon().findWorkflowInfo(workItem, getMonitor());

The work item commandLine has example code. Also examples: https://rsjazz.wordpress.com/?s=IWorkflowInfo&submit=Search and https://rsjazz.wordpress.com/2012/11/27/resolve-parent-if-all-children-are-resolved-participant/ shows how to iterate the states.



Emiliano Iannetti selected this answer as the correct answer

1 vote


2 other answers

Permanent link
Thanks for the quick reply, but how do I instantiate the Common? I would have also found this:
workItemClient.findWorkflowInfo(iWorkitem, null);
Of course the workItemClient is a correctly instantiated object that you also use in the links you suggested, but it takes a long time to instantiate, maybe with common, it takes less.
Thank you very much.

0 votes

Comments
        IWorkitemCommon = (IWorkItemCommon) teamRepository.getClientLibrary(IWorkItemCommon.class);

1 vote

IWorkitemClient is only available in the client API. If there is common API it is usually better to use the common API.
Authentication and startup of the TeamPlatform takes around 7 seconds. If the services are instantiated on the server, getting such a service is very quick. 


Permanent link
Thanks again, I also tried this method, but I did not notice any improvement. The timing is due to some error reports, side lack of icons in the configuration.
Thanks for the info, I did not know this consideration, I will use common for what you anticipated.

Thanks a lot anyway.

0 votes

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
× 11,052
× 416
× 170

Question asked: Jun 16, 7:25 a.m.

Question was seen: 918 times

Last updated: Jun 16, 10:31 a.m.

Confirmation Cancel Confirm