Configure flowable-modeler with spring boot applicaation

Hi, I have created a basic flow, comprising of a start event, user task, service task and end event using xml in my workspace.
In user task there will be variable holding the decision.
Decision value is passed by rest call.
In the end, service task just prints the decision value in console.
So, everything works fine, now I thought of doing the same thing but in a different way, not using xml but by using flowabl-modeler.
So, I have to change the default database from h2 to postgresql, i know about the application side but not so sure about the flowable side.
I made the changes in flowable-default.properties file in

\apache-tomcat-9.0.21\webapps\flowable-modeler\WEB-INF\classes

I made below changes in aflowable-default.properties

application.properties:

DATABASE

spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/flowablemodeler
spring.datasource.username=postgres
spring.datasource.password=
spring.datasource.hikari.connection-test-query=select 1

I get errors-> database “flowable” does not exist, plus cannot load driver class: org.postgresql.Driver

Please help me on this!!!

In addition to changing the configuration, make sure the database driver is available on the classpath. Again, you could do this for every web application separately by adding the driver JAR file to the WEB-INF/lib folder, but you can also copy the JAR file once to the Tomcat lib folder.

https://www.flowable.org/docs/userguide/index.html#uiAppInstallation

1 Like

thanks @wwitt, that solved the driver problem, however I am still getting database ‘flowableadmin’, ‘flowable’ does not exist, I believe there are some default tables which are in place and during startup some crucial information is fetched from them. Is my understanding right?
I could not find a place where i can set it up to create the missing tables in DB

@akki, flowable.database-schema-update will set the auto-creation strategy, but the WARs ship with auto-creation enabled. Are you certain you commented out the h2 datasource (some of them have example entries)? Did you make the change in every one of the app you have deployed to tomcat?

Except flowable-rest, I commented out h2 configuration in all flowable-default.properties.

In flowable-rest app, there was no configuration for postgresql commented out for datasource-url.
Hence, i left it as it is.

Okay, somethings were missing from my end and I have corrected them, now everything looks fine.
Now, my application and flowable are going to use local DB.

Now, I created a basic model like given here.
Next, I created the app and added the model created previously.
Published the app.
Tried to start the process from spring-boot application using below line of code

ProcessInstance instance = mRuntimeService.startProcessInstanceByKey(“gigplan”, variables);

However, I got the exception,

“No process definition found for key ‘gigplan’”

I know the way to do with xml, but I’m looking for some other way to achieve it.

Second question I have in mind, without using xml configuration, if I have created a model comprising of Service tasks using flowable-modeler, how do I wire that Service task with my java code.

I know, with xml it’s pretty easy, but in the application which I am working, xml is not an option for now at least!!

Please let me know if any leads are there, thanks in advance

1 Like

After publishing, if you do repositoryService.createProcessDefinitionQuery().list(), does it return a process definition with key ‘gigplan’?

In your service task you typically reference a class or a spring bean. Those classes or beans need to be on the classpath of your spring boot application. When the process instance is executed, the class/bean reference will be used to look up the correct implementation.

1 Like

Okay I found this link, which shows 4 ways to configure Service Tasks.
I used the Delegate expression option and populated Delegate expression attribute in my process with name of the bean which I have defined in my spring-boot application, but for some reason it is not catching it up because i get the exception saying
Delegate expression FirstServiceTask did neither resolve to an implementation of interface org.flowable.engine.impl.delegate.ActivityBehavior nor interface org.flowable.engine.delegate.JavaDelegate
Attaching the screenshot

Looks like there was a syntax error in what I was putting in delegate expression field.
Correct expression should be like ${firstServiceTask}
Here firstServiceTask is a method in my main class which is used to define bean of FirstServiceTask

@akki, This is more a question than a reply. In your note, when you say ‘I created a basic model’ and "I created app’ etc, did you do this from your main application or did you leverage the flowable UI apps? I needed to create a application (spring or another) which need functionalities of workflow (design and subsequent runs) with several manual steps. I was looking to see if there are any reference implementations of the same.

This whole trail was very useful, thanks for the same

I have tried both ways, flowable UI apps way and main application way.
this is the main application way which I have used.

I believe the functionalities of workflow and other manual things can be done in .bpm20.xml file, which you will see in the tutorial of the link above.

1 Like

Thanks. I have checked and tried the sample program in the mentioned link earlier. In the example they use a ready BPMN XML, in your case of standalone app did have an custom interface where you could draw the model and convert it into the XML. If yes, how was that achieved?

You can use flowable-modeler API to make the process, download it, i think by default it is downloaded as xml only.

I am also looking for some information, it’s not related to this topic, related to flowable forms, do you know if there is a table in database that stores the submitted form values ?

Not sure, but can you check act_fo_form_resource. It seems to have some values that I choose when I did [flowable-6-instant-gratification] (https://paulhh.wordpress.com/2017/01/31/flowable-6-instant-gratification/) .

The other form tables I see are

   act_fo_databasechangelog 
  act_fo_databasechangeloglock   
  act_fo_form_definition         
  act_fo_form_deployment         
 act_fo_form_instance            
 act_fo_form_resource

Do you have a link to this modeler-api ?

If you have installed flowable apps, you should be able to use it by localhost:<portnumber>/flowable-modeler/

Not a link to the modeler, but any link to the api documentation of the modeler (flowable-modeler API ) that I can use in my custom UI.

I’m not sure, what information are you looking, I don’t want to give too many documentation links just to increase the confusion