Package com.yworkflow.definition.model
Interface ExtensionProvider
public interface ExtensionProvider
Provides access to workflow extensions by resolving them by type and value. ExtensionProvider is
the central registry for all workflow extensions including conditions, functions, attribute
registers, and validators.
Extensions are the primary mechanism for extending workflow functionality with custom business logic. They can be referenced in workflow definitions by type and value, and the ExtensionProvider is responsible for resolving these references to actual extension instances.
Multiple ExtensionProvider instances can be chained together with different priorities, allowing for layered extension resolution. Higher priority providers are consulted first when resolving extensions.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionattributeResolver(Attributes args) Returns the attribute resolver for this extension provider.getAttributeRegister(String type, String value, Attributes args) Resolves a workflow attribute register by type and value.getCondition(String type, String value, Attributes args) Resolves a workflow condition by type and value.getFunction(String type, String value, Attributes args) Resolves a workflow function by type and value.default intReturns the priority of this extension provider.getValidator(String type, String value, Attributes args) Resolves a workflow input validator by type and value.voidinit()Initializes the extension provider.
-
Method Details
-
init
void init()Initializes the extension provider. This method is called when the extension provider is registered with the workflow engine and allows the provider to set up any necessary resources. -
attributeResolver
Returns the attribute resolver for this extension provider. The attribute resolver is responsible for resolving attribute references in workflow definitions.- Parameters:
args- the args to configure the resolver with- Returns:
- the workflow attribute resolver
-
getCondition
Resolves a workflow condition by type and value.- Parameters:
type- the condition type (e.g., "user", "role", "custom")value- the condition value (e.g., "manager", "admin", "conditionId")args- the arguments for the condition- Returns:
- the resolved workflow condition
-
getFunction
Resolves a workflow function by type and value.- Parameters:
type- the function type (e.g., "email", "database", "custom")value- the function value (e.g., "send", "query", "functionId")args- the arguments for the function- Returns:
- the resolved workflow function
-
getAttributeRegister
Resolves a workflow attribute register by type and value.- Parameters:
type- the register type (e.g., "database", "service", "custom")value- the register value (e.g., "userService", "config", "registerId")args- the arguments for the register- Returns:
- the resolved workflow attribute register
-
getValidator
Resolves a workflow input validator by type and value.- Parameters:
type- the validator type (e.g., "format", "range", "custom")value- the validator value (e.g., "email", "1-100", "validatorId")args- the arguments for the validator- Returns:
- the resolved workflow input validator
-
getPriority
default int getPriority()Returns the priority of this extension provider. Higher priority providers are consulted first when resolving extensions. The default priority is 0.- Returns:
- the priority of this extension provider
-