Hi,
I am in the process of developing a custom BLOCK extension that instead of
changing the scope of the block, it uses the scope of the whole Document.
With this type of BLOCK one could loop through a series of annotations, and
for each of those annotations search in the whole document for something
else. I guess my first questions is: Is it even possible to do something
like this without creating a custom BLOCK extension?
I got something to work, but it doesn't seem to apply the conditions for the
block. This is more or less the code I have so far:
List<Type> types = ((RutaRuleElement)
rule.getRuleElements().get(0)).getMatcher().getTypes(getParent() == null ?
this : getParent(), stream);
for (Type eachType : types) {
//System.out.println("each Type: " +
eachType.getShortName());
for(AnnotationFS each : stream.getAllofType(eachType))
{
RutaStream window = stream.getWindowStream(each,
eachType);
for (RutaStatement element : getElements()) {
if (element != null) {
element.apply(window, crowd);
}
}
}
}
I assume in order to apply the conditions I would need something like this:
RuleApply apply = rule.apply(stream, crowd);
But for some reason this doesn't work, because I guess the scope has already
been changed and it is not able to find any of the annotations in within the
scope.
Does this make any sense? Is there a better way to do this?
Any help would be much appreciated.
Cheers,
Miguel