cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating Alfresco with a long running external service

adrianblakey
Champ in-the-making
Champ in-the-making
Please could someone advise on how to integrate Alfresco with another callable service.

Here's the use case:

1. Client of Alfresco shall call Alfresco to create a document on its behalf passing various parameters that shall be used to create the document and complete various values in it.
2. Alfresco shall call out to a document creation service passing on some of the values it has been passed and retaining some that shall be written into an aspect for the rendered document.
3. The document creation service schedules the document to be created which shall be run asynchronously.
4. Once the document is rendered it shall return the created document to Alfresco with an associated aspect and values passed in the originating call.
5. Alfresco shall then notify various interested parties of its availability so they can say review the document, email it etc …

I presume I'll need to extend the REST api to provide a way for the client to call in. How can I save passed values? Does this involve extending the data model?

How do I extend Alfresco to call out to another service? What should I implement and or configure? Is this an Action? and do I extend Alfresco or do I create some sort of extension to Activiti?

Once the document is composed, I shall write it back to Alfresco using the CMIS api from the document creation service. I shall need a filter to perform various actions, or I'll need to attach some specific workflow on arrival of the document - how do I implement custom workflow?

2 REPLIES 2

marco_altieri
Star Contributor
Star Contributor
The easiest solution is to use a webscript and a custom action.

http://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html
http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html

The webscript can be implemented in javascript or Java. It depends on how complex it is: javascript is ok if you do not need too much logic.

The webscript will collect the passed parameters and configure the action.
The action will be executed asynchronously. It can use all the libraries you want to access the remote server. Usually apache HttpClient is enough or you can use other libraries (for example an implementation of JAXRS).

Because it is a long running service, if you have a big throughput, it can be necessary to carefully configure a connection pool for HttpClient