增加配置文件
This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.lanyuanxiaoyao.flowable.jpa;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
import lombok.ToString;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 配置类
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250103
|
||||
*/
|
||||
@ToString(callSuper = true)
|
||||
@Configuration
|
||||
@ConfigurationProperties("flowable")
|
||||
public class SpringFlowableConfiguration extends FlowableConfiguration {
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lanyuanxiaoyao.flowable.jpa;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableManager;
|
||||
import com.lanyuanxiaoyao.flowable.core.repository.FlowableRepository;
|
||||
import java.util.UUID;
|
||||
@@ -17,8 +18,9 @@ import org.springframework.stereotype.Service;
|
||||
public class SpringFlowableManager extends FlowableManager {
|
||||
private final ApplicationContext applicationContext;
|
||||
|
||||
public SpringFlowableManager(FlowableRepository flowableRepository, ApplicationContext applicationContext) {
|
||||
super(flowableRepository, () -> UUID.randomUUID().toString());
|
||||
public SpringFlowableManager(FlowableConfiguration configuration, FlowableRepository repository, ApplicationContext applicationContext) {
|
||||
super(configuration, repository);
|
||||
log.info("Configuration: {}", configuration);
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
@@ -38,4 +40,9 @@ public class SpringFlowableManager extends FlowableManager {
|
||||
}
|
||||
return targetObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String createId() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user