【问题标题】:Flowable BPMN with DMN using Java API使用 Java API 和 DMN 的 Flowable BPMN
【发布时间】:2021-10-04 07:41:25
【问题描述】:

我是 Flowable 的新手,并通过使用 Flowable JAVA API 探索其功能。

已经设法设计了一个 bpmn 流程并使用 Flowable 中的 flowable-engine java 库的 ProcessEngine 执行它。

  <groupId>org.flowable</groupId>
  <artifactId>flowable-engine</artifactId>
  <version>6.7.0</version>

后来,我设法创建了一个决策表(.dmn.xml),并通过下面提到的参考链接将其引用到业务流程(.bpmn.xml)文件

https://flowable.com/open-source/docs/dmn/ch06-DMN-Introduction/

请告诉我如何使用 Flowable JAVA API 将 dmn 与 bpmn 一起使用。

【问题讨论】:

    标签: java flowable


    【解决方案1】:

    您可以先将 dmn 部署到 dmn 引擎中。 然后你可以有一个带有决策任务的 bpmn(一个类型为 dmn 的服务任务)。 这将在内部调用 dmn 引擎来评估结果。 你可以参考这个Flowable BPMN DmnActivityBehavior来检查从bpmn到dmn的java api调用。

    【讨论】:

      【解决方案2】:

      我们要做的就是让流程引擎知道 DMN 资源 xml 和 DMNEngineConfigurator。下面sn-p供参考

      private static void deployProcess(ProcessEngine processEngine) {
          RepositoryService repositoryService = processEngine.getRepositoryService();
          Deployment deployment = repositoryService.createDeployment()
                  .addClasspathResource("LoanRequest.bpmn20.xml")
                  .addClasspathResource("EvaluateLoanCreate.dmn.xml")
                  .deploy();
      }
      
          private static DmnEngineConfigurator getDMNEngineConfigurator(){
          DmnEngineConfiguration dmnEngineConfiguration = new DmnEngineConfiguration()
                  .setJdbcUrl("jdbc:h2:tcp://localhost/C:/user/Program Files/h2-2019-03-13/test;SCHEMA=flowabledemo;DB_CLOSE_DELAY=-1")
                  .setJdbcUsername("user")
                  .setJdbcPassword("Password")
                  .setJdbcDriver("org.h2.Driver")
                  .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
          DmnEngineConfigurator dmnEngineConfigurator = new DmnEngineConfigurator()
                  .setDmnEngineConfiguration(dmnEngineConfiguration);
      
      
          return dmnEngineConfigurator;
      }
      
      ProcessEngineConfiguration cfg = (ProcessEngineConfiguration) new StandaloneProcessEngineConfiguration().setConfigurators(Arrays.asList(getDMNEngineConfigurator()));
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-11-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-19
        相关资源
        最近更新 更多