Class not found exception with Java delegate classes

Hi,

I am new to flowable, I am facing an issue with Java Delegate classes.

I am using flowable-modeler to create and deploy the workflows and I have created a REST API application to to perform different operations on workflow like start, complete etc.
Also i have created separate java application for Java Delegate classes and converting it into jar file and adding as dependency to my REST API application. Now when i call my custom REST api service to start the process, it is starting and picking the delegate class and executing properly.
If i make the service task as Asynchronous, then it is not picking the delegate class and throwing class not found exception.
If i place that jar file in Flowable-task WEB-INF/lib folder , then it is picking java class in both the scenarios. But some times when i change the flow, publish and start the process, then it is throwing class not found exception again.

Can some one please help me, how to avoid placing jar file 2 places every time i change it and also help me to resolve class not found exception.

Thank you,
Srikanth

Hi Srikanth,

Do you run 2 flowable engines? That could be reason why you need to place jar into 2 places.
I would recommend to use only one engine instance in this case.

Regards
Martin

Hi,

Thank you for your response.

I am creating a process engine in my REST API application. Will flowable-task or any other apps will creates process engine? If that is the case 2 process engines are getting created.

Now my question is, If i don’t create process engine in my REST API, how to access the engine services?

Kindly help me.

Thank you,
Srikanth

Hi,

yes flowable-task app starts it’s own flowable engine. Both of them points to the same DB, that’s why they share case/process… instances.
It is fine for ordinary operations, but in the case when both engines have async executor enabled, the first one (the first who executes job query) takes async job from the DB and executes it.
Solution proposals:

  1. enable async executor only on one engine instance.
  2. use only one of the engines

Regards
Martin

Hi,

Sure. Can you please tell me how to use the process engine which is created with flowable-task in my REST API application. with that i can avoid creating 2 process engines and 2 async executors.

Thank you,
Srikanth

Hi,

You could extend flowable-task app and add your rest endpoints there if you want to.

Martin

Hi,

Can you please provide me the sample if you have any on how to extend flowable-task app and creating custom REST-API?

Thank you,
Srikanth

Hi,

e.g. https://github.com/flowable/flowable-engine/blob/8d338e43a70441c8aa2b6b5663d5ff7d68797f56/modules/flowable-ui-task/flowable-ui-task-rest/src/main/java/org/flowable/ui/task/rest/runtime/ProcessInstanceResource.java

Hi Martin,

Thanks for your help,

I made changes based on your suggestions. When i am trying to call my custom rest api from postman or rest client with basic authentication, it is redirecting to flowable-idm application login page. But when i invoke default flowable rest api with basic authentication, it is working fine. Do i need to make any specific changes to my custom rest controller to work properly with basic authentication.

When i hit custom service URL from post man, it is showing below redirect URL and call is not going to my custom service.

http://localhost:8080/flowable-idm/#/login?redirectOnAuthSuccess=true&redirectUrl=http://localhost:8080/flowable-task/FlowableWrapper/ping

please help me how to make this work.

Thank you,
Srikanth

Hi,

Can some one please help me on this.

Thank you,
Srikanth

Hi Srikanth,

I have no idea. The best would be to put break point into spring dispatcher to find out what is going on in your project.

Regards
Martin

Hi Martin,

There is no dispatcher implemented in my project. My project is having only REST Controller java class.
I think default flowable-task dispatcher is getting executed. I just want to know is there any other configuration required to redirect to custom REST API after successful authentication.

Thank you,
Srikanth

Hi,

Can some one please help me on this. I couldn’t find any fix for this.

Thank you,
Srikanth

Hey Srikanth,

The reason why you are getting redirected is because you are getting hit by the default security configuration. I would suggest to you to provide configuration (that would kick in before the flowable-task one) and you would configure the authentication for it in there. You can find the flowable-task SecurityConfiguration here

Cheers,
Filip

1 Like