@@ -32,7 +32,7 @@ public class MySmartWorker {
3232
3333 private final FetchGoodsInPort fetchGoodsInPort;
3434
35- @ProcessEngineWorker (topic = " fetchGoods" )
35+ @ProcessEngineWorker (" fetchGoods" )
3636 public Map<String , Object > fetchGoods (
3737 @Variable (name = " order" ) Order order
3838 ) {
@@ -79,13 +79,13 @@ public class MyWorker {
7979Parameter resolution of the method annotated with ` ProcessEngineWorker ` is based on a set of strategies
8080registered by the ` ParameterResolver ` bean. Currently, the following parameters are resolved:
8181
82- | Type | Purpose |
83- | ----------------------------------------| ---------------------------------------------------------------------------|
84- | TaskInformation | Helper abstracting all information about the external task. |
85- | ExternTaskCompletionApi | API for completing the external task manually |
86- | VariableConverter | Special utility to read the process variable map and deliver typed value |
87- | Map<String, Object> | Payload object containing all variables. |
88- | Type annotated with @Variable ("name) | Marker for a process variable. |
82+ | Type | Purpose |
83+ | ------------------------------------------ | ---------------------------------------------------------------------------|
84+ | TaskInformation | Helper abstracting all information about the external task. |
85+ | ExternTaskCompletionApi | API for completing the external task manually |
86+ | VariableConverter | Special utility to read the process variable map and deliver typed value |
87+ | Map<String, Object> | Payload object containing all variables. |
88+ | Type annotated with ` @Variable("name") ` | Marker for a process variable. |
8989
9090Usually, the requested variable is mandatory and the parameter resolver reports an error, if the requested variable is not
9191available in the process payload. If you want to inject the variable only if it exists in the payload you have two options.
@@ -103,7 +103,8 @@ If you want to throw a BPMN error, please throw an instance of a `BPMNErrorOccur
103103## Customizations
104104
105105You might want to register your own parameter resolution strategies. For this purpose, please construct
106- the parameter resolver bean on your own and register your own strategies:
106+ the parameter resolver bean on your own and register your own strategies. Your custom strategy must implement
107+ ` ParameterResolutionStrategy ` interface:
107108
108109``` kotlin
109110
@@ -113,10 +114,7 @@ class MyConfig {
113114 @Bean
114115 fun myParameterResolver (): ParameterResolver {
115116 return ParameterResolver .builder().addStrategy(
116- ParameterResolutionStrategy (
117- parameterMatcher = { param -> .. . },
118- parameterExtractor = { param, taskInformation, payload, variableConverter, taskCompletionApi -> .. . },
119- ),
117+ MyCustomParameterResolutionStrategy (),
120118 ).build()
121119 }
122120}
@@ -144,7 +142,7 @@ class MyConfig {
144142
145143```
146144
147- If you want to switch the entire library off (for example you are in the context of an integrtion test, and parts of your Process Engine API are deactivated),
145+ If you want to switch the entire library off (for example you are in the context of an integration test, and parts of your Process Engine API are deactivated),
148146you can do it by setting the property ` dev.bpm-crafters.process-api.worker.enabled ` to ` false ` .
149147
150148## Examples
0 commit comments