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

Follow-up encoding problem

Hello,

I'm writing follow-up that checks that wi has no blocking relationships. It works fine in my development environment but fails in client environment.

My client has JTS with Russian translation.  It looks like string that I check in my java code "Зависит от"(Depends On) is incorrectly encoded in the client environment.

Any ideas?

0 votes

Comments

 What encoding are you using for your Java  source? (In Eclipse that is controlled in preferences General > Workspace > Text file encoding)

I use UTF-8


Accepted answer

Permanent link
Timur,

that was what I meant, don't use the display names to identify anything in server extensions. There are ID's and constants available to use instead. This allows to code this up and it will work for any template. Again, see http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/ and the earlier article on linking to understand how the code should be modified. E.g. use  WorkItemLinkTypes.BLOCKS_WORK_ITEM
Timur Markunin selected this answer as the correct answer

1 vote

Comments

Thanks a lot, Ralph!
I've used getTargetEndPointDescriptor().getId(). It's language independent.


2 other answers

Permanent link
Timur,

I am not sure what you do here. Are you using a string to identify the link endpoints? If so, I would suggest to use the constants to access the link types. e.g. as described here: http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/

If you do this you should be independent from the language you use in the templates. I would suggest to avoid using translated strings for extensions wherever possible. Use the ID's instead. This is sometimes not easy to do, especially if coding a client that gets data as strings, but try it if possible at all.

If you do it and you still experience problems I would suggest to open a work item.

0 votes


Permanent link
Hi Ralph! Thanks for your response!
I'm using following code to check wi's relations:

IWorkItemReferences iwr = ((ISaveParameter) data).getNewReferences();
List<IEndPointDescriptor> epdl = iwr.getTypes();
     for(int i=0;i<epdl.size();i++)
         {
            ILinkType lt = epdl.get(i).getLinkType();
             if(lt.getLinkTypeId().endsWith(BlockingItemLink))
             {
 if(epdl.get(i).getDisplayName().equalsIgnoreCase(DependsOnLink)||epdl.get(i).getDisplayName().equalsIgnoreCase(DependsOnLinkRU))
                                {
                                    IReportInfo info = collector.createExceptionInfo("This wi is  blocked by another wi", new Throwable("Error"));
                                    // tell the caller to post an error, and reject the action
                                    collector.addInfo(info);
                                   
                                }
                            }

The problem is that if process template is translated than epdl.get(i).getDisplayName() returns translated string.

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
× 10,938

Question asked: Oct 03 '12, 6:37 a.m.

Question was seen: 4,074 times

Last updated: Oct 05 '12, 5:03 a.m.

Confirmation Cancel Confirm