How to use a custom application to generate the BPMN XML and use applications user/groups?

The question(s) is about embedding Flowable to a standalone java application. There are many questions/answers on this forum about this but I was still not very clear on how to go about it. I could not see any reference implementation of the same. I have checked the standalone program , but this uses a prebuilt process XML.

Context: I am working on a spring based application (calling it the main application) with possibly a angular based frontend. This application will have some business processes and the plan is to use the flowable workflow engine for this. The question is how do we embed Flowable into an existing java application to do the following

  1. To have a user interface that helps a Manager create workflows. This should then be saved in the BPMN format like the samples shown in the documentation. The question is are there flowable APIs available that can write out BPMN XML. Is the recommendation to build our own frontend to design the workflow or to use code from one the flowable UI apps? \

  2. Our application will have users with 2-3 different roles (employee, manager etc). How do we get flowable to use these users during the design and execution of the workflow. Since Flowable has its own tables where it maintains users (act_id_user), how is this to be synced with the users of the main application. What is to be done to see that each of these users (of my java application) have a tasklist where they see flowable tasks pending against them?

I have read articles like (Using Flowable as an embedded workflow), Use of Flowable UI Task with own flowable engine and also a camel example but not sure of how to generate the process XML and in them user the applications users/groups for the tasks.

Hi, Can somebody answer the second part of the question. How does one integrate the users/groups from a custom application into an embedded Flowable Modeler so that the tasks are listed against the custom applications users/groups.

Normally, you’d create the model with a tool like Flowable Modeler that produces the XML.

If you want to programmatically create processes, you can use the BpmnModel api. A simple example is here: flowable-engine/ at main · flowable/flowable-engine · GitHub

That’s up to your choice. Note that to support all of the BPMN elements, that would be quite a bit of work.

Typically, you’d use something like Spring Security to connect your application with your own user/group store. In the process, you use the ‘candidateGroups’ on a user task. The Flowable engine does not check these values, so you can put the ids of whatever user store you’re using in there and do the lookup against it in the logic you’re writing on top of the Flowable API calls.

1 Like

Thanks @joram. I dont think we want to generate the model programmatically for now at least, and we need a tool like the Flowable Modeler. We will also not need all the BPMN elements available in the Modeler & we might want to change the overall look/feel, theme a bit to make it consistent with the rest of our application. So you think taking the Flowable Modeler code and making these changes is the best approach and the least painful?

On the other question above, to create our applications user/groups in Flowable are there any REST APIs available for the same? any documenation ? I don’t seem to find any REST API documentation while I do see several examples that use them (to instantiate process, check pending tasks etc).

I will have to use the flowable-idm application along with the flowable-modeler to achieve both of the above, right ?

1 Like

I’m trying to do a similar approach. How did you solve this?