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

RTC default value proivder JAVA API problem

Hello all,

I developed server side extension, that provides default value for attribute and I'm facing one problem. Because it should generate unique sequential number, I'm using file to store last used number. But default value provider plug-in is run few times before workitem editor is shown in WebUI, and when I'm testing it, first time attribute has value 1, second time 6. How I can avoid this problem?

1 vote

Comments

Interesting problem. I don't know if it's possible to have this kind of semi-stateful behavior in the default value provider. It may be possible to avoid running the code which generates the sequence until later by adding some kind of a check in front of it. For example, checking on the value of something normally empty during initialization, but populated after initialization etc..



One answer

Permanent link

 Yes, value provider can run multiple times. So you would have to look at the value if it is not already there and only generate a new value if it is not yet set. Or, better, use a follow up action to generate the unique value only once, when the save happens like it is done here: https://github.com/jazz-community/rtc-workitem-numbering

0 votes

Comments

I thought it will be easier with default value provider, but I will do as you described and create follow up action.

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,953
× 457
× 411

Question asked: Oct 28 '19, 6:48 a.m.

Question was seen: 1,557 times

Last updated: Oct 29 '19, 6:27 a.m.

Confirmation Cancel Confirm