Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation.core.annotations
Annotation Type OperationMethod


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface OperationMethod

To be used to mark methods provided by an operation. A method must have at most one argument which is the operation input and a return type which is the operation output. Methods with zero parameters (void input) will match any input. An operation may have multiple methods if it supports multiple input and output types.

For each INPUT/OUTPUT type association you must create a new method in an operation and annotate it using this annotation. The set of input types available in an operation are the operation accepted types and the set of output types are the operation produced types. A produced type will become the input type for the next operation in the chain, that will be dispatched to the right method that know how to consume the type.

When an operation provides 2 methods accepting the same input type the chain will need to take a decision to determine the best way to continue. A common algorithm to find the right path until the end of the chain is backtracking: from a set of potential nodes one is selected to be visited (randomly or not). If the node is a dead end then another node from the set is taken until the path to the last node is created.

A chain may have no paths until the last operation. In this case the chain is invalid and the chain processor will trigger an error. Also, a chain can provide multiple paths to the last operation. To help the engine to find the best path until the last operation you can use the priority() attribute to specify which method is preferred. The default priority is 0 (e.g. no priority). Higher priorities have more chance to be selected when a conflict occurs. If no user priority is specified (i.e. priority is 0) then the default priority is used. Here is how the default priority is computed (the top most case has the greater priority):

If no one of these rules applies then the method will not match the input.

The class owning the annotated method must be annotated using Operation

Author:
Bogdan Stefanescu

Optional Element Summary
 Class<? extends OutputCollector> collector
          If defined the method is iterable.
 int priority
           
 

collector

public abstract Class<? extends OutputCollector> collector
If defined the method is iterable.

It means that when such a method is called with an input type of Iterable (where INPUT is the declared method input type) the method will be iteratively called to generate all the outputs and collect them using the given OutputCollector.

Returns:
Default:
org.nuxeo.ecm.automation.OutputCollector.class

priority

public abstract int priority
Default:
0

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.