cancel
Showing results for 
Search instead for 
Did you mean: 

Invoke OSGi Service from Workflow

timo_rohrberg
Champ in-the-making
Champ in-the-making
Hello everybody,

I'm currently investigating possible solutions for invoking OSGi services directly from workflow definitions. I'm working with an Eclipse Equinox based OSGi environment and my OSGi services are registered declaratively via the Equinos Declarative Services framework. I would now like to be able to specify for example the interface of such a registered service within my workflow definition XML and have the Activit Engine to load and execute that service.

The central motivation behind that is that I would like to keep the actual implementation of Java Service Tasks in a different bundle than the workflow engine instantiation, execution, and so on. However, with that I would have to import the bundle with the Java Service Tasks into the bundle with the Activiti workflow engine via Import-Package statements in the MANIFEST.MF in order to load task classes with the activiti:class attribute of a service task declaration. And it's exactly that dependency that I would like to avoid.

Researching the web, I found the following discussion - however, it is already a couple of years old and I wondered if there is another solution in the meantime. I also played around a bit and managed to implement my own ELResolver, but somehow that way does not completely feel good. Also, I would like to avoid to integrate the Apache Aries Blueprint into my project - I would rather like to stick with the Equinox Declarative Services framework.

https://forums.activiti.org/content/osgi-service-task

Do you guys have any further hints?
3 REPLIES 3

trademak
Star Contributor
Star Contributor
That's a very old post indeed 🙂
It would be good to don't depend on Apache Aries Blueprint and make it your own choice which services framework you want to use. Is this something that you would be willing to investigate and develop together with the Activiti development team? Preventing a dependency on the service task implementation is related to this I think, because when you would use an expression or delegate expression this prevents the requirement to define a class name in the BPMN XML file.

Best regards,

Hello Tijs,

thank you for your reply.

That's is in fact an appealing offer :-). I would actually really like to contribute to the Activiti project on that topic if that is desired. In the meantime, I solved the problem in a quite simple way implementing and attaching my own RLResolver implementation. The idea is based on what has been described in the mentioned topic and it works for us. However, I think I would have to go through the solution with other members of the Activiti development team to check if my solution could be improved and made more general.

So what would be the next steps towards a contribution?

I am looking forward to your reply.

Best regards
Timo Rohrberg

trademak
Star Contributor
Star Contributor
Hi Timo,

Ok great, if you can drop me a message on twitter or on email then we can discuss this further.

Best regards,