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:
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).
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).
One answer
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.
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.