如何在 jBPM 中生成用于流程定义部署的 SQL 脚本?

发布于 2024-07-07 16:27:45 字数 400 浏览 6 评论 0原文

我正在考虑将 jBPM 与我当前的项目集成,到目前为止一切顺利,只需将 jpdl jar 包含在我的耳朵中并使用 spring 模块 0.8 jbpm 模块,但是我必须有一个合理的方法来从我的更改到设计器中的流程定义到生产中的部署。

该路径必须在多种环境(开发、许多测试、登台,然后是生产)中可重复,并且理想情况下应该在系统本身未运行时完成。

理想情况下,我会将整个定义打包为 SQL 脚本,但是我还没有看到任何工具可以将 processdefinition.xml 转换为 sql,并且手动组装它似乎太繁琐且容易出错。

还有其他人有过这里的经历吗?

该系统在 websphere 6.1 上运行,我倾向于避免在迁移时执行 java 代码(不过,运行 java 代码来生成可以在迁移期间使用的工件是可以的)

I'm looking into integrating jBPM with my current project, so far so good just including the jpdl jar in my ear and using the spring modules 0.8 jbpm module, however I've got to have a reasonable way of going from my changes to to the process definition in the designer to deployment in production.

The path has to be repeatable in a number of environments (dev, many test, staging and then prod) and ideally should be done while the system itself is not running.

I'd Ideally package the entire definition as an SQL script, however I haven't seen any tool to translate from processdefinition.xml to sql and assembling it all manually seems too fiddly and error prone.

Has anyone else out there had any experiences here?

The system is running on websphere 6.1 and it's my preference to avoid executing java code at migration time (running java code to generate artifacts that can then be used during migration is ok though)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

时光瘦了 2024-07-14 16:27:45

如果您想避免走 .par 路线,可以轻松编写一些简单的 Java 代码来将新的流程定义版本部署到数据库。 您

JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml"));
ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(newPdStream);
JbpmContext context = jbpmConfiguration.createJbpmContext();
context.getGraphSession().deployProcessDefinition(processDefinition);

需要在类路径上拥有相关数据库的 hibernate.propertieshibernate.cfg.xml

这种方式的优点在于所有版本控制工作都会自动为您完成。 我们曾经使用一种修改流程定义的方式(基本上忽略版本控制),但这对于当时处于活动状态的流程实例来说是一个巨大的混乱。

If you want to avoid going down the .par route, it's easy to write some simple Java code to deploy a new process definition version to your database. Something like

JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml"));
ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(newPdStream);
JbpmContext context = jbpmConfiguration.createJbpmContext();
context.getGraphSession().deployProcessDefinition(processDefinition);

You'll need to have the hibernate.properties or hibernate.cfg.xml for the relevant database on the classpath.

What's great about this way is that all of the versioning stuff is done for you automatically. We used to use a hack where we modified the process definition (basically ignoring versioning), but it was a big huge mess for process instances which were active at the time.

被你宠の有点坏 2024-07-14 16:27:45

解决方法建议:
部署和拦截 sql 查询

我还没有尝试过,但我建议尝试使用 jBPM-console 部署 servlet 的部署或

context.getGraphSession().deployProcessDefinition(processDefinition);

按照 shyamsundar 的建议

使用 LogDriver 记录 sql 更新: http://rkbloom.net/logdriver/logdriver.tar.gz

Workaround suggestion:
deploy and intercept sql queries

I haven't tried this but I would suggest to try use the deployment of the jBPM-console deploy servlet or

context.getGraphSession().deployProcessDefinition(processDefinition);

as suggested by shyamsundar

AND

log the sql updates with LogDriver: http://rkbloom.net/logdriver/logdriver.tar.gz

池予 2024-07-14 16:27:45

为什么不专门使用 JBPM 提供的 ant 任务扩展 <代码>DeployProcessTask。 您可以部署到不同的环境,只需一个 .par 文件和用于各种 dev/test/staging/prod 环境的相应 jbpm-cfg.xml。 您可能需要做的唯一更改是将 hibernate 配置配置为直接连接到数据库而不是使用数据源。

Why not use the ant task extensions provided by JBPM specifically DeployProcessTask. You can deploy to different environments having just a single .par file and the corresponding jbpm-cfg.xml for the various dev/test/staging/prod environments. The only change you might have to do is to configure your hibernate config to directly connect to the database instead of using the datasource.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文