Processor Type Inheritance and Runtime Selection

Every document, within the transformation or aggregation phase, has at least one type, but possibly more. You can define a type inheritance for each of them.

To do so, see: IMutableTransformationDocumentParameterized.setType, ICreateTransformationHandler.create'*', ICreateAggregateHandler.create'*'.

For example, you could write:

@Override
 public void process(final IJavaAllUpdatesTransformationHandler handler, final IMutableTransformationDocument
 document) throws Exception {
 document.setType("cat", "felid", "mamal", "vertebrate");
  ...
}

As a result, the processors selected for execution apply the following rules:

  • Either the transformation or aggregation has the all types pattern.

    • In Java, this is achieved by returning null or an empty string.

    • In Groovy, this is achieved with an empty string.

  • Or the document type inheritance matches the defined processor type.

With the following sequence of Groovy aggregation processors, the document presented before is executed in order within Processor 1, Processor 3, and Processor 4.

Processor #

Groovy code

1

process("cat") {  ...}

2

process("dog") {  ...}

3

process("mamal") {  ...}

4

process("") {  ...}