Skip to content

Commit 7f30dc0

Browse files
Add support for using Camunda 8.8 without Kafka leveraging execution-listener #34
1 parent 6af9175 commit 7f30dc0

26 files changed

+1093
-575
lines changed

adapters/camunda8/src/main/java/io/vanillabp/cockpit/adapter/camunda8/Camunda8AdapterConfiguration.java

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import io.vanillabp.cockpit.adapter.camunda8.workflow.Camunda8WorkflowEventHandler;
1212
import io.vanillabp.cockpit.adapter.camunda8.workflow.Camunda8WorkflowHandler;
1313
import io.vanillabp.cockpit.adapter.camunda8.workflow.Camunda8WorkflowWiring;
14+
import io.vanillabp.cockpit.adapter.camunda8.workflow.publishing.Camunda8WorkflowEventPublisher;
1415
import io.vanillabp.cockpit.adapter.common.CockpitCommonAdapterConfiguration;
1516
import io.vanillabp.cockpit.adapter.common.properties.VanillaBpCockpitProperties;
1617
import io.vanillabp.cockpit.adapter.common.service.AdapterConfigurationBase;
@@ -77,7 +78,7 @@ public class Camunda8AdapterConfiguration extends AdapterConfigurationBase<Camun
7778
@Autowired
7879
private Camunda8VanillaBpProperties properties;
7980

80-
private final Map<Class<?>, Camunda8BusinessCockpitService> cockpitServices = new HashMap<>();
81+
private final Map<Class<?>, Camunda8BusinessCockpitService<?>> cockpitServices = new HashMap<>();
8182

8283
@Override
8384
public String getAdapterId() {
@@ -90,12 +91,17 @@ public Camunda8UserTaskEventHandler camunda8BusinessCockpitUserTaskEventHandler(
9091
}
9192

9293
@Bean
93-
public Camunda8WorkflowEventHandler ccamunda8BusinessCockpitWorkflowEventHandler(
94-
final ApplicationEventPublisher applicationEventPublisher,
95-
final WorkflowPublishing workflowPublishing) {
96-
return new Camunda8WorkflowEventHandler(applicationEventPublisher, workflowPublishing);
94+
public Camunda8WorkflowEventHandler ccamunda8BusinessCockpitWorkflowEventHandler() {
95+
return new Camunda8WorkflowEventHandler();
9796
}
9897

98+
@Bean
99+
public Camunda8WorkflowEventPublisher camunda8BusinessCockpitWorkflowEventPublisher(
100+
final WorkflowPublishing workflowPublishing) {
101+
102+
return new Camunda8WorkflowEventPublisher(
103+
workflowPublishing);
104+
}
99105

100106
@Bean
101107
public Camunda8UserTaskEventPublisher camunda8BusinessCockpitUserTaskEventPublisher(
@@ -138,25 +144,33 @@ public Camunda8UserTaskWiring camunda8BusinessCockpitUserTaskWiring(
138144
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
139145
public Camunda8WorkflowHandler camunda8WorkflowHandler(
140146
final VanillaBpCockpitProperties cockpitProperties,
147+
final ApplicationEventPublisher applicationEventPublisher,
141148
final AdapterAwareProcessService<?> processService,
142149
final String bpmnProcessId,
143-
final String bpmnProcessName,
150+
final String bpmnProcessVersionInfo,
151+
final String processTitle,
144152
final Optional<Configuration> templating,
153+
final String aggregateIdPropertyName,
145154
final CrudRepository<Object, Object> workflowAggregateRepository,
146155
final Object bean,
147156
final Method method,
148-
final List<MethodParameter> parameters) {
157+
final List<MethodParameter> parameters,
158+
final CamundaClient client) {
149159

150160
final var result = new Camunda8WorkflowHandler(
151161
cockpitProperties,
162+
applicationEventPublisher,
152163
processService,
153164
bpmnProcessId,
154-
bpmnProcessName,
165+
bpmnProcessVersionInfo,
166+
processTitle,
155167
templating,
168+
aggregateIdPropertyName,
156169
workflowAggregateRepository,
157170
bean,
158171
method,
159-
parameters);
172+
parameters,
173+
client);
160174
final var cockpitService = cockpitServices.get(processService.getWorkflowAggregateClass());
161175
if (cockpitService != null) {
162176
final var tenantId = properties.getTenantId(processService.getWorkflowModuleId());
@@ -208,9 +222,11 @@ public Camunda8UserTaskHandler camunda8UserTaskHandler(
208222
@Bean
209223
public Camunda8WorkflowWiring camunda8BusinessCockpitWorkflowWiring(
210224
final ApplicationContext applicationContext,
225+
final ApplicationEventPublisher applicationEventPublisher,
211226
final VanillaBpCockpitProperties cockpitProperties,
212227
final Camunda8VanillaBpProperties camunda8Properties,
213228
final SpringBeanUtil springBeanUtil,
229+
final SpringDataUtil springDataUtil,
214230
final Map<Class<?>, AdapterAwareProcessService<?>> connectableServices,
215231
@Qualifier(CockpitCommonAdapterConfiguration.TEMPLATING_QUALIFIER)
216232
final Optional<Configuration> templating,
@@ -219,9 +235,12 @@ public Camunda8WorkflowWiring camunda8BusinessCockpitWorkflowWiring(
219235
final ObjectProvider<Camunda8WorkflowHandler> workflowHandlers) {
220236
return new Camunda8WorkflowWiring(
221237
applicationContext,
238+
applicationEventPublisher,
239+
workerId,
222240
cockpitProperties,
223241
camunda8Properties,
224242
springBeanUtil,
243+
springDataUtil,
225244
new WorkflowMethodParameterFactory(),
226245
connectableServices,
227246
getConnectableServices(),
@@ -238,8 +257,6 @@ public Camunda8DeploymentAdapter camunda8BusinessCockpitDeploymentAdapter(
238257
final VanillaBpCockpitProperties cockpitProperties,
239258
final Camunda8UserTaskWiring camunda8UserTaskWiring,
240259
final Camunda8WorkflowWiring camunda8WorkflowWiring,
241-
final Camunda8UserTaskEventHandler userTaskEventHandler,
242-
final Camunda8WorkflowEventHandler workflowEventHandler,
243260
final ApplicationEventPublisher applicationEventPublisher) {
244261

245262
return new Camunda8DeploymentAdapter(
@@ -249,8 +266,6 @@ public Camunda8DeploymentAdapter camunda8BusinessCockpitDeploymentAdapter(
249266
cockpitProperties,
250267
camunda8UserTaskWiring,
251268
camunda8WorkflowWiring,
252-
userTaskEventHandler,
253-
workflowEventHandler,
254269
applicationEventPublisher);
255270
}
256271

@@ -296,7 +311,7 @@ public <WA> Camunda8BusinessCockpitService<?> newBusinessCockpitServiceImplement
296311
}
297312
}
298313

299-
final var result = new Camunda8BusinessCockpitService<WA>(
314+
final var result = new Camunda8BusinessCockpitService<>(
300315
workflowAggregateRepository,
301316
workflowAggregateClass,
302317
springDataUtil::getId,

0 commit comments

Comments
 (0)