public interface AutomationService
Modifier and Type | Method and Description |
---|---|
CompiledChain |
compileChain(Class<?> inputType,
OperationChain chain)
Builds the operation chain given a context.
|
CompiledChain |
compileChain(Class<?> inputType,
OperationParameters... chain)
Same as previous but takes an array of operation parameters
|
<T> T |
getAdaptedValue(OperationContext ctx,
Object toAdapt,
Class<?> targetType)
Adapts an object to a target type if possible otherwise throws an exception.
|
AutomationFilter |
getAutomationFilter(String id) |
AutomationFilter[] |
getAutomationFilters() |
ChainException |
getChainException(String onChainId) |
ChainException[] |
getChainExceptions() |
List<OperationDocumentation> |
getDocumentation()
Generates a documentation model for all registered operations.
|
OperationType |
getOperation(String id)
Gets an operation type given its ID.
|
OperationChain |
getOperationChain(String id)
Deprecated.
since 5.9.2 no specific chain registry anymore: chains are now operations, use
getOperation(String) method instead. |
List<OperationChain> |
getOperationChains()
Deprecated.
since 5.9.2 no specific chain registry anymore: chains are now operations, use
getOperations() method
instead. |
OperationType[] |
getOperations()
Gets all operation types that was registered.
|
TypeAdapter |
getTypeAdapter(Class<?> accept,
Class<?> produce)
Gets a type adapter for the input type accept and the output type produce.
|
boolean |
hasChainException(String onChainId) |
boolean |
hasOperation(String id) |
boolean |
isTypeAdaptable(Class<?> typeToAdapt,
Class<?> targetType)
Checks whether or not the given type is adaptable into the target type.
|
void |
putAutomationFilter(AutomationFilter automationFilter) |
void |
putChainException(ChainException exceptionChain) |
void |
putOperation(Class<?> type)
Registers an operation given its class.
|
void |
putOperation(Class<?> type,
boolean replace)
Registers an operation given its class.
|
void |
putOperation(Class<?> type,
boolean replace,
String contributingComponent)
Registers an operation given its class.
|
void |
putOperation(Class<?> type,
boolean replace,
String contributingComponent,
List<WidgetDefinition> widgetDefinitionList) |
void |
putOperation(OperationType op,
boolean replace)
Registers an operation given it's type.
|
void |
putOperationChain(OperationChain chain)
Deprecated.
since 5.9.2 no specific chain registry anymore: chains are now operations, use
{@link #putOperation(OperationType, boolean) method instead.
|
void |
putOperationChain(OperationChain chain,
boolean replace)
Deprecated.
since 5.9.2 no specific chain registry anymore: chains are now operations, use
{@link #putOperation(OperationType, boolean) method instead.
|
void |
putTypeAdapter(Class<?> accept,
Class<?> produce,
TypeAdapter adapter)
Registers a new type adapter that can adapt an instance of the accepted type into one of the produced type.
|
void |
removeAutomationFilter(AutomationFilter automationFilter) |
void |
removeExceptionChain(ChainException exceptionChain) |
void |
removeOperation(Class<?> key)
Removes an operation given its class.
|
void |
removeOperation(OperationType type)
Removes an operation given it's type.
|
void |
removeOperationChain(String id)
Deprecated.
since 5.9.2 no specific chain registry anymore: chains are now operations, use
removeOperation(OperationType) method instead. |
void |
removeTypeAdapter(Class<?> accept,
Class<?> produce)
Removes a type adapter
|
Object |
run(OperationContext ctx,
OperationChain chain)
Builds and runs the operation chain given a context.
|
Object |
run(OperationContext ctx,
String chainId)
Same as previous but for managed chains identified by an ID.
|
Object |
run(OperationContext ctx,
String id,
Map<String,?> params)
Shortcut to execute a single operation described by the given ID and map of parameters
|
Object |
runInNewTx(OperationContext ctx,
String chainId,
Map<String,?> chainParameters,
Integer timeout,
boolean rollbackGlobalOnError)
This running method execute operation process through a new transaction.
|
void putOperation(Class<?> type) throws OperationException
Operation
annotation.
If an operation having the same ID exists an exception will be thrown.OperationException
void putOperation(Class<?> type, boolean replace) throws OperationException
Operation
annotation.
If the replace
argument is true then any existing operation having the same ID will replaced with
this one.OperationException
void putOperation(Class<?> type, boolean replace, String contributingComponent) throws OperationException
Operation
annotation.
If the replace
argument is true then any existing operation having the same ID will replaced with
this one. Third argument represents the name of the component registring the operationOperationException
void putOperation(OperationType op, boolean replace) throws OperationException
OperationException
void removeOperation(Class<?> key)
void removeOperation(OperationType type)
OperationType[] getOperations()
OperationType getOperation(String id) throws OperationNotFoundException
OperationNotFoundException
CompiledChain compileChain(Class<?> inputType, OperationChain chain) throws OperationException
InvalidChainException
is thrown. The returned
object can be used to run the chain.OperationException
CompiledChain compileChain(Class<?> inputType, OperationParameters... chain) throws OperationException
OperationException
Object run(OperationContext ctx, OperationChain chain) throws OperationException
InvalidChainException
is thrown.OperationException
Object run(OperationContext ctx, String chainId) throws OperationException
OperationException
Object run(OperationContext ctx, String id, Map<String,?> params) throws OperationException
OperationException
@Deprecated void putOperationChain(OperationChain chain) throws OperationException
run
and
passing the chain ID. If a chain having the same ID exists an exception is thrownOperationException
@Deprecated void putOperationChain(OperationChain chain, boolean replace) throws OperationException
run
and
passing the chain ID. If the replace attribute is true then any chain already registered under the same id will
be replaced otherwise an exception is thrown.OperationException
@Deprecated void removeOperationChain(String id)
removeOperation(OperationType)
method instead.@Deprecated OperationChain getOperationChain(String id) throws OperationNotFoundException
getOperation(String)
method instead.OperationNotFoundException
@Deprecated List<OperationChain> getOperationChains()
getOperations()
method
instead.void putTypeAdapter(Class<?> accept, Class<?> produce, TypeAdapter adapter)
void removeTypeAdapter(Class<?> accept, Class<?> produce)
TypeAdapter getTypeAdapter(Class<?> accept, Class<?> produce)
<T> T getAdaptedValue(OperationContext ctx, Object toAdapt, Class<?> targetType) throws OperationException
OperationException
boolean isTypeAdaptable(Class<?> typeToAdapt, Class<?> targetType)
This is a shortcut to getTypeAdapter(typeToAdapt, targetType) != null
List<OperationDocumentation> getDocumentation() throws OperationException
OperationException
boolean hasOperation(String id)
id
- operation IDvoid putChainException(ChainException exceptionChain)
void removeExceptionChain(ChainException exceptionChain)
ChainException[] getChainExceptions()
ChainException getChainException(String onChainId)
void putAutomationFilter(AutomationFilter automationFilter)
void removeAutomationFilter(AutomationFilter automationFilter)
AutomationFilter getAutomationFilter(String id)
AutomationFilter[] getAutomationFilters()
boolean hasChainException(String onChainId)
void putOperation(Class<?> type, boolean replace, String contributingComponent, List<WidgetDefinition> widgetDefinitionList) throws OperationException
OperationException
Object runInNewTx(OperationContext ctx, String chainId, Map<String,?> chainParameters, Integer timeout, boolean rollbackGlobalOnError) throws OperationException
ctx
- the operation context.chainId
- the chain Id.chainParameters
- chain parameters.timeout
- Transaction timeout.rollbackGlobalOnError
- Rollback or not transaction after failing.OperationException
Copyright © 2018 Nuxeo. All rights reserved.