0

I am new to Flowable and exploring its features by using Flowable JAVA API.

Have managed to design a bpmn flow and execute it using ProcessEngine of flowable-engine java library from Flowable.

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

Later, I managed to create a Decision table(.dmn.xml) and also referenced it to a business process flow(.bpmn.xml) file by following reference link mentioned below

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

Please let me know how do I use dmn with bpmn using Flowable JAVA API.

Samy
  • 2,387
  • 2
  • 17
  • 31

2 Answers2

0

You can first deploy the dmn into the dmn engine. Then you can have a bpmn with a Decision Task(a service task with type as dmn). This will internally call the dmn engine to evaluate the result. You can refer this Flowable BPMN DmnActivityBehavior to check the java api calling from bpmn to dmn.

Vamshi
  • 11
  • 4
0

All we got to do is to make process engine aware of the DMN resource xml and DMNEngineConfigurator. Below snippet for reference

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()));
Samy
  • 2,387
  • 2
  • 17
  • 31