SeviceTask and java class


#1

Hi. I am new in Flowable and all Alfresco stuff.
I want to use ServiceTask to get out data from Alfresco (document properties, person name…).
Where have I put my java class to be able to call if from Flowable?

Thanks in advance.


#2

You have to create a implementation of a JavaDelegate which contains your custom logic and then reference it in your process definition (class attribute of a service task): http://www.flowable.org/docs/userguide/index.html#getting.started.delegate


#3

Thank you Joram for response.
But I am sorry you haven’t posted information which I didn’t know.
I implemented Java ServiceTask in Alfresco Activiti project using Eclipse. But in Flowable things is a bit more complicated, I think. There is no project in Eclipse with process definition, service context and java classes.
I can only create process in Flowable modeler, put it into app and deploy it.
I know that I have to create java class in Eclipse and make that class implement the org.flowable.engine.delegate.JavaDelegate interface and implement the execute method.
But what next? I can build JAR file. And what I have to do with it? Upload it somewhere? Register it somewhere?
I have found in documentation this:

Java classes present in the business archive will not be added to the classpath. All custom classes used in process definitions in the business archive (for example, Java service tasks or event listener implementations) must be made available on the Flowable engine classpath in order to run the processes.

I still have lack of information. :frowning:


#4

did you get any solution on this? I am also kinda stuck on this.


#5

We have created REST service at Alfresco side to get information out. Flowable then just makes http callout.