Comments (7)
我是单独给它配数据源的
@DaTa
@configuration
public class FlowableEngineConfig implements EngineConfigurationConfigurer {
/**
* jdbc 驱动类
/
@value("${spring.datasource.driver-class-name}")
private String jdbcDriver;
/*
* jdbc url
/
@value("${spring.datasource.url}")
private String jdbcUrl;
/*
* jdbc 用户名
/
@value("${spring.datasource.username}")
private String jdbcUsername;
/*
* jdbc 密码
*/
@value("${spring.datasource.password}")
private String jdbcPassword;
。。。
@OverRide
public void configure(SpringProcessEngineConfiguration engineConfiguration) {
engineConfiguration.setActivityFontName("宋体");
engineConfiguration.setLabelFontName("宋体");
engineConfiguration.setAnnotationFontName("宋体");
engineConfiguration.setJdbcDriver(this.jdbcDriver);
engineConfiguration.setJdbcUrl(this.jdbcUrl);
engineConfiguration.setJdbcUsername(this.jdbcUsername);
engineConfiguration.setJdbcPassword(this.jdbcPassword);
engineConfiguration.setDatabaseSchemaUpdate(this.databaseSchemaUpdate);
engineConfiguration.setAsyncExecutorActivate(this.asyncExecutorActivate);
}
。。。
from flowable-engine.
我是单独给它配数据源的 @DaTa @configuration public class FlowableEngineConfig implements EngineConfigurationConfigurer { /** * jdbc 驱动类 / @value("${spring.datasource.driver-class-name}") private String jdbcDriver; /* * jdbc url / @value("${spring.datasource.url}") private String jdbcUrl; /* * jdbc 用户名 / @value("${spring.datasource.username}") private String jdbcUsername; /* * jdbc 密码 */ @value("${spring.datasource.password}") private String jdbcPassword; 。。。 @OverRide public void configure(SpringProcessEngineConfiguration engineConfiguration) { engineConfiguration.setActivityFontName("宋体"); engineConfiguration.setLabelFontName("宋体"); engineConfiguration.setAnnotationFontName("宋体"); engineConfiguration.setJdbcDriver(this.jdbcDriver); engineConfiguration.setJdbcUrl(this.jdbcUrl); engineConfiguration.setJdbcUsername(this.jdbcUsername); engineConfiguration.setJdbcPassword(this.jdbcPassword); engineConfiguration.setDatabaseSchemaUpdate(this.databaseSchemaUpdate); engineConfiguration.setAsyncExecutorActivate(this.asyncExecutorActivate); } 。。。
你这边是整合的flowable-spring-boot-starter 还是只是engine呢
from flowable-engine.
我是单独给它配数据源的 @DaTa @configuration public class FlowableEngineConfig implements EngineConfigurationConfigurer { /** * jdbc 驱动类 / @value("${spring.datasource.driver-class-name}") private String jdbcDriver; /* * jdbc url / @value("${spring.datasource.url}") private String jdbcUrl; /* * jdbc 用户名 / @value("${spring.datasource.username}") private String jdbcUsername; /* * jdbc 密码 */ @value("${spring.datasource.password}") private String jdbcPassword; 。。。 @OverRide public void configure(SpringProcessEngineConfiguration engineConfiguration) { engineConfiguration.setActivityFontName("宋体"); engineConfiguration.setLabelFontName("宋体"); engineConfiguration.setAnnotationFontName("宋体"); engineConfiguration.setJdbcDriver(this.jdbcDriver); engineConfiguration.setJdbcUrl(this.jdbcUrl); engineConfiguration.setJdbcUsername(this.jdbcUsername); engineConfiguration.setJdbcPassword(this.jdbcPassword); engineConfiguration.setDatabaseSchemaUpdate(this.databaseSchemaUpdate); engineConfiguration.setAsyncExecutorActivate(this.asyncExecutorActivate); } 。。。
还有就是请问下,你是如何处理 业务库和flowable数据库 的事务管理的?一起会滚或者一起提交的呢
from flowable-engine.
兄弟,问题解决了吗?切换+事务
from flowable-engine.
整合的flowable-spring-boot-starter,我用的切面解决的数据源问题
from flowable-engine.
package xxxx.flowable.config;
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.impl.AbstractEngineConfiguration;
import org.flowable.common.engine.impl.EngineConfigurator;
import org.flowable.engine.ProcessEngine;
import org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
@slf4j
@configuration
public class FlowableConfig {
@Autowired
private DynamicRoutingDataSource dynamicRoutingDataSource;
@Bean
public EngineConfigurator customEngineConfigurator() {
return new EngineConfigurator() {
@Override
public void beforeInit(AbstractEngineConfiguration engineConfiguration) {
DataSource dataSource = dynamicRoutingDataSource.getDataSource("flowable");
engineConfiguration.setDataSource(dataSource);
}
@Override
public int getPriority() {
// 返回的值越小,优先级越高。这里返回0,表示最高优先级。
return 0;
}
@Override
public void configure(AbstractEngineConfiguration processEngineConfiguration) {
// 在这里添加你的自定义配置逻辑
// 例如,可以设置自定义的表单类型解析器或自定义的脚本任务执行器
System.out.println("Custom Engine Configurator with highest priority is being applied.");
}
};
}
@Bean
public SpringEventRegistryConfigurator customEventEngineConfigurator() {
return new SpringEventRegistryConfigurator() {
@Override
public void beforeInit(AbstractEngineConfiguration engineConfiguration) {
DataSource dataSource = dynamicRoutingDataSource.getDataSource("tenant");
engineConfiguration.setDataSource(dataSource);
}
@Override
public int getPriority() {
// 返回的值越小,优先级越高。这里返回0,表示最高优先级。
return 0;
}
@Override
public void configure(AbstractEngineConfiguration processEngineConfiguration) {
// 在这里添加你的自定义配置逻辑
System.out.println("Custom Engine Configurator with highest priority is being applied.");
}
};
}
@Bean
public ProcessEngine processEngine(SpringProcessEngineConfiguration configuration) {
// 将自定义的EngineConfigurator添加到SpringProcessEngineConfiguration
configuration.getProcessEngineConfiguration().addConfigurator(customEngineConfigurator());
configuration.getProcessEngineConfiguration().addConfigurator(customEventEngineConfigurator());
// 构建并返回流程引擎
return configuration.buildProcessEngine();
}
}
from flowable-engine.
整合的flowable-spring-boot-starter,我用的切面解决的数据源问题
package xxx.flowable.config;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
/**
-
切面方式
-
flowable:6.8.0,spring boot v2.2.2.RELEASE
*/
@slf4j
@component
@aspect
public class DbAspect {@pointcut("execution(* org.flowable.app.engine.AppEngineConfiguration.buildAppEngine())")
public void buildEngine() {}@pointcut("execution(* org.flowable.eventregistry.spring.SpringEventRegistryEngineConfiguration.start())")
public void startRegistry() {}@around("buildEngine()")
public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
log.info("初始化flowable-engine之前切换到工作流数据源");
DynamicDataSourceContextHolder.push("flowable");
Object result = proceedingJoinPoint.proceed();
log.info("初始化flowable-engine之后停用工作流数据源");
DynamicDataSourceContextHolder.poll();
return result;
}
@around("startRegistry()")
public Object doAroundStartRegistry(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
log.info("初始化flowable-event-registry之前切换到工作流数据源");
DynamicDataSourceContextHolder.push("flowable");
Object result = proceedingJoinPoint.proceed();
log.info("初始化flowable-event-registry之后停用工作流数据源");
DynamicDataSourceContextHolder.poll();
return result;
}
}
from flowable-engine.
Related Issues (20)
- Delay in seconds before script condition executed HOT 6
- task complete before report NoSuchMethodError: org.flowable.bpmn.model.UserTask.getTaskCompleterVariableName() , flowable version: 7.0.1 HOT 2
- Flowable 7.0.1 not getting installed in ecliupse HOT 1
- Conditions should support more than JUEL expressions
- suspendProcessInstanceById question
- BpmnXMLUtil.parseExtensionElement setElementText has bug of Line wrap cover HOT 1
- Process migration cannot migrate processes HOT 1
- Process definition id of an async external worker service task job is not updated after direct migration HOT 2
- 是否有审批人驳回到上级,上级修改后在发起继续审批流程 HOT 1
- Invalid SQL upgrade scripts for HSQL database (7.0.0 -> 7.0.1)
- The DefaultIdentityLinkIterceptor.java creates duplicate identityLinks on ProcessInstance
- AsyncTaskInvokerTaskExecutor supplied by Spring Boot autoconfiguration is not started
- Not possible to exclude the `flowable-event-registry` JAR even if EventRegistry disabled
- startProcessInstanceByKey does not always trigger the process HOT 3
- Liquibase first up does not work with JtaProcessEngineConfiguration HOT 1
- Timer job never unlocked after an exception
- Query the sorting exception of HistoricActivityInstance
- After running runtimeService().deleteProcessInstance(processInstance.getId()) to delete the parent process instance, the CallActivity subprocessInstance query is null HOT 1
- Flowable Open Source Documentation should support dark mode
- 数据量过大以后,flowable有相关的归档功能吗?或者是否支持集成其他分库分表的框架,如 sharding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flowable-engine.