Skip to content

Commit

Permalink
Improve startup performance
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanpelikan committed Jan 29, 2024
1 parent 82b0fae commit 967ef84
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>io.vanillabp</groupId>
<artifactId>spring-boot-support</artifactId>
<version>1.0.7</version>
<version>1.0.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.vanillabp.camunda7.wiring.ProcessEntityAwareExpressionManager;
import io.vanillabp.camunda7.wiring.TaskWiringBpmnParseListener;
import io.vanillabp.springboot.adapter.AdapterConfigurationBase;
import io.vanillabp.springboot.adapter.SpringBeanUtil;
import io.vanillabp.springboot.adapter.SpringDataUtil;
import io.vanillabp.springboot.adapter.VanillaBpProperties;
import jakarta.annotation.PostConstruct;
Expand All @@ -24,6 +25,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -108,11 +110,13 @@ public Camunda7UserTaskEventHandler userTaskEventHandler() {

@Bean
public Camunda7TaskWiring taskWiring(
final SpringBeanUtil springBeanUtil,
final ProcessEntityAwareExpressionManager processEntityAwareExpressionManager,
final Camunda7UserTaskEventHandler userTaskEventHandler) {

return new Camunda7TaskWiring(
applicationContext,
springBeanUtil,
processEntityAwareExpressionManager,
userTaskEventHandler,
getConnectableServices());
Expand Down Expand Up @@ -219,4 +223,13 @@ public StartProcessJobHandler startProcessJobHandler() {
return new StartProcessJobHandler();
}

@Bean
@ConditionalOnMissingBean
public SpringBeanUtil vanillabpSpringBeanUtil(
final ApplicationContext applicationContext) {

return new SpringBeanUtil(applicationContext);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.vanillabp.camunda7.service.Camunda7ProcessService;
import io.vanillabp.spi.process.ProcessService;
import io.vanillabp.spi.service.WorkflowTask;
import io.vanillabp.springboot.adapter.SpringBeanUtil;
import io.vanillabp.springboot.adapter.TaskWiringBase;
import io.vanillabp.springboot.parameters.MethodParameter;
import io.vanillabp.springboot.parameters.MethodParameterFactory;
Expand All @@ -25,11 +26,12 @@ public class Camunda7TaskWiring extends TaskWiringBase<Camunda7Connectable, Camu

public Camunda7TaskWiring(
final ApplicationContext applicationContext,
final SpringBeanUtil springBeanUtil,
final ProcessEntityAwareExpressionManager processEntityAwareExpressionManager,
final Camunda7UserTaskEventHandler userTaskEventHandler,
final Collection<Camunda7ProcessService<?>> connectableServices) {

super(applicationContext);
super(applicationContext, springBeanUtil);
this.processEntityAwareExpressionManager = processEntityAwareExpressionManager;
this.userTaskEventHandler = userTaskEventHandler;
this.connectableServices = connectableServices;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package io.vanillabp.camunda7.wiring;

import java.util.HashMap;
import java.util.Map;

import org.camunda.bpm.engine.delegate.DelegateTask;
import org.camunda.bpm.engine.delegate.TaskListener;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
import org.camunda.bpm.model.bpmn.instance.UserTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

public class Camunda7UserTaskEventHandler implements TaskListener {

private static final Logger logger = LoggerFactory
Expand Down Expand Up @@ -61,7 +61,7 @@ public void notify(
.filter(entry -> entry.getValue().eventApplies(delegateTask.getEventName()))
// found handler-reference
.findFirst()
.map(entry -> entry.getValue())
.map(Map.Entry::getValue)
.ifPresentOrElse(
handler -> handler.notify(delegateTask),
() -> logger.debug(
Expand Down

0 comments on commit 967ef84

Please sign in to comment.