Hi again,

It sounds like the values of these variables pertain to a particular
CAS (since you don't want the values to change until that CAS has been
fully processed).  If so, then storing them them in the CAS was a fine
solution.  The CollectionReader and CAS Consumers run in separate
threads, so the CollectionReader definitely may move on to a new CAS
before the CAS Consumer processes the first one.

The problem is that I need to share data that is not a primitive type
which I could represent in the CAS (it's a rather complex Java object).

If you wanted your Collection Reader and CAS Consumer so share data
that was *not* related to a particular CAS, you could use UIMA's
external resource mechanism to accomplish that.

I was originally searching for that (because it was mentioned at the
UIMA workshop at the LREC) but I only found out how to use the session
variables. Do you have a pointer to finding out how to use that mechanism?

What I want is that wherever I put the Java object, it should be automatically removed when a CAS is fully processed - no matter if it was successful or not. The object is bound to a document but representable in the CAS. Before I had an ID encoded in the CAS and passed the object out-of-band via a static hashmap (CollectionReader puts object there under the ID and CASConsumer reads it again). However I was not too happy with this solution. Would this scenario be solvable
with the external resources approach?

Richard Eckart

Technische Universität Darmstadt
Institute of Linguistics and Literary Studies
Department of English Linguistics

Hochschulstrasse 1
64289 Darmstadt
Germany



Reply via email to