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

How to set value to a custom attribute of type Small String?

Hi all,

I am trying set value to a custom attribute of type Small String by Java API. Here is my code:

IAttribute iQtdeUstAjustada = wiCommon.findAttribute(newWorkItem.getProjectArea(), "vlr_ust_ajustada", monitor);

BigDecimal ustAjustada = getQtdeUstFinal();
String vlrAjustada = ustAjustadas.setScale(2, BigDecimal.ROUND_UNNECESSARY).toPlainString();

workingCopy.setValue(iQtdeUstAjustada, vlrAjustada);


The setValue method is raising the following exception:

2014-10-30 12:05:54,398 [WebContainer : 4 @@ 12:05 lcesar /ccm/service/com.ibm.team.workitem.common.internal.rest.IWorkItemRestService/workItem2] ERROR com.ibm.team.process.common                         - assertion failed:
org.eclipse.core.runtime.AssertionFailedException: assertion failed:
        at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
        at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
        at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setValue(WorkItemImpl.java:2909)
        at customized.followup.calculatevalue.service.CalculateValue.run(CalculateValue.java:101)

How to set value to a Small String attribute? Can't I use String?
Important: this code works well when I am testing in Eclipse with Jetty server. The exception is raised only on the production environment (WAS and DB2).


1

0 votes



One answer

Permanent link
It is absolutely unobvious in which context you ask this question. There is no hint about the RTC version. This seems to be Java API, but, who knows. If you can't provide a useful description, no one can answer this question.

0 votes

Comments

Sorry, Ralph....
I am developing a participant extension. RTC version is 4.0.7.
As you can see, in my code I am creating a BigDecimal variable and later I created a String variable with the bigdecimal value.

BigDecimal ustAjustada = getQtdeUstFinal(); // this method returns a BigDecimal value.
String vlrAjustada = ustAjustadas.setScale(2,BigDecimal.ROUND_UNNECESSARY).toPlainString();

Well, when I set the String variable to workitemcopy to save it, occurs the error that I described above.

workingCopy.setValue(iQtdeUstAjustada, vlrAjustada); // error occurs here.

Detail:
iQtdeUstAjustada is an attribute of type Small String.

I do not know if I can explain...I hope so.

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,936

Question asked: Oct 30 '14, 10:20 a.m.

Question was seen: 4,027 times

Last updated: Nov 19 '14, 12:07 p.m.

Confirmation Cancel Confirm