On 8/8/2013 11:59 AM, Peter Klügl wrote: > Hi, > > I wonder how to implement a generic AE that is able to create a new CAS > and copies a given view to a specified view of the new CAS. The new CAS > then should be serialized. > > What I tried is here: > https://svn.apache.org/repos/asf/uima/sandbox/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/engine/ViewWriter.java > > When I call this AE within Ruta without mapping, then > getContext().getEmptyCas(CAS.class) returns a CAS without additional > types and CasCopier removes all annotations (due to lenient). With > mapping, it complains that the sofaFS specified by the parameter cannot > be found. The getContext().getEmptyCas(CAS.class) is defined to get a empty CAS which has the same type system as the current one. The getContext() should return a UimaContext object. A Cas definition is located from that via the UimaContext's getResourceManger() call , which should return the overall (for the pipeline) ResourceManager. That, in turn, has a getCasManager() which should be pointing to info that includes the Type System info of the CAS that's flowing in the pipeline.
So I don't know why all the annotations are being removed. You shouldn't need the lenient option - the type system should be the same, I think. If you can post sufficient instructions to enable me to run (from trunk), or have a driver/ testcase, I can try and see what's going on... -Marshall > > I tried a few things without success. The next thing would be to provide > a parameter with the location of a descriptor for creating a separate > CAS and completely avoiding the CAS multiplier functionality... > > Any ideas? > > Peter >
