Specifying Operations
How to define one or more operations for an adapter
Operations for Adapters
Adapters offer certain functions that can be selected within the X4 Designer using the property Operation in the Properties view. Each list entry of this selection menu corresponds to an operation method within the adapter.
An adapter needs at least one operation. If the adapter offers only a single operation, it will be automatically selected in the Process Designer.
Assigning Methods to Operations
Specify for each operation the annotation
@AdapterOperationfor declaring to a public method in the adapter class.Define the parameters.
- Each method can define a parameter, which corresponds to the adapter input.
- The method's return type can be
X4Documentor a JAXB-conform Java bean. If the return type isvoid, the input is considered as output. - To use Java beans, the input has to be XML and conform to the Java bean definition. Otherwise, the adapter execution will be aborted with the status
-1.
The basic frame of an Operation method is now ready.
Defining Metadata for Adapter Operations
To define metadata for adapter operations the annotation @AdapterOperation is used:
Field | Description |
|---|---|
name | Specifies the operation's name and can be freely selected. However, it has to be unique for each adapter. |