You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Erik Fäßler <er...@uni-jena.de> on 2013/05/30 09:53:28 UTC

Cannot set values in CasProcessorConfigurationParameterSettingsImpl

Hi all,

I am working with a CPE descriptor which is loaded by my Java application, adopted to some parameters given to the application, creates the CPE and runs it.
Now I wanted to set a parameter value of an AE where this value was not overridden in the CPE descriptor but only set in the AE descriptor itself.

I noticed that setting the value in the CasProcessorConfigurationParameterSettings did not have any effect, i.e. retrieving the value after setting did not reveal the set value. A short view onto the code of the class reveals why:

It has a parameterList which is correctly extended by new parameters.
And it has an array "params" which is created in the constructor and then never changed.

Then, when asking for values, a loop iterates over the existing parameter values and returns the one with the correct name - except that the loop doesn't iterate over the parameterList which contains the actual values, but over the "params" array which doesn't seem to contain anything except of as many null values as there were parameter overrides in the CPE.

So my workaround for now will be to override the parameter in the CPE descriptor and then be able to set it to whatever I want.

But my main question is: Is this intended behaviour? The params array seems useless to me and the being able to set parameters which can never be retrieved again seems a bit odd.

Employed UIMA version is 2.4.0.

Best regards,

	Erik

Re: Cannot set values in CasProcessorConfigurationParameterSettingsImpl

Posted by Marshall Schor <ms...@schor.com>.
I'm no expert here, but this seems like a bug to me...  You might want to file a
Jira bug report at
https://issues.apache.org/jira/browse/UIMA

-Marshall
On 5/30/2013 3:53 AM, Erik Fäßler wrote:
> Hi all,
>
> I am working with a CPE descriptor which is loaded by my Java application, adopted to some parameters given to the application, creates the CPE and runs it.
> Now I wanted to set a parameter value of an AE where this value was not overridden in the CPE descriptor but only set in the AE descriptor itself.
>
> I noticed that setting the value in the CasProcessorConfigurationParameterSettings did not have any effect, i.e. retrieving the value after setting did not reveal the set value. A short view onto the code of the class reveals why:
>
> It has a parameterList which is correctly extended by new parameters.
> And it has an array "params" which is created in the constructor and then never changed.
>
> Then, when asking for values, a loop iterates over the existing parameter values and returns the one with the correct name - except that the loop doesn't iterate over the parameterList which contains the actual values, but over the "params" array which doesn't seem to contain anything except of as many null values as there were parameter overrides in the CPE.
>
> So my workaround for now will be to override the parameter in the CPE descriptor and then be able to set it to whatever I want.
>
> But my main question is: Is this intended behaviour? The params array seems useless to me and the being able to set parameters which can never be retrieved again seems a bit odd.
>
> Employed UIMA version is 2.4.0.
>
> Best regards,
>
> 	Erik