cancel
Showing results for 
Search instead for 
Did you mean: 

detect activiti standalone / embedded in Alfresco

begunrom1
Champ in-the-making
Champ in-the-making
For a project i need to make a bunch of service tasks that call a java class.
I need them to work standalone (in an activiti instance) and within Alfresco (embedded activiti).
As there are some minor differences i have to take into account, what would be the best way to detect if the service task runs embedded or standalone?
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Both service-tasks should implement JavaDelegate and work in both environments… Only if you're using alfresco-specific services, this won't work in activiti-standalong off course.

begunrom1
Champ in-the-making
Champ in-the-making
Yes, but in my case one of the service tasks create a pdf file. If run into Alfresco, i need to use Alfresco logic to add it to the repository, while run standalone, i can just drop it into the file system.

frederikherema1
Star Contributor
Star Contributor
You can, for example, us a spring-configured bean for this (with an interface). Let your service-task use this bean to write the PDF to. in the activiti-context, this bean implementation (wired in the spring-context) writes to the filesystem. In case of alfresco-context, have an implementation that writes to the repository, using the node/contentService.