cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit alfresco content through Activiti BPM

gets_sanket_pat
Confirmed Champ
Confirmed Champ

Hi

I want to use Activiti to edit the text content and it's metadata which is present in alfresco repository/alfresco share. What is the best way to do it?

My approach is kind of goes this way. But I feel I am making it complicated. 

1. Create the form in activiti to choose the alfresco share document 

2. get the node reference from the chosen path

3. call the alfresco webscript endpoint task which can get the JSON response using this GET  method

       e.g. GET /alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/1b10bd64-e22f-458c-8632-468b53174266

4. DO the response mapping and get all the properties that the file is having in variables

5. load that in the form in which user can edit.

6. complete the editing process by publishing the same document.

Do you have any other approach ? This is kind of a lot of work for a simple editing the document.

Activiti version 1.6.0

Alfresco 5.0.2

11 REPLIES 11

Got it. 

One of the options is to get the nodeId on the server side using relatedContent JAVA APIs of Alfresco Process Services and set filePath variable on server side. I have attached an example app where I put the logic in a groovy script task.

Second option is to get it using the REST APIs and populate your filePath using javascript in the formFieldContentUploaded() extension Start and task form customization | Alfresco Documentation.

Hopefully the first option will suffice!

The example app worked.Awesome. Thanks.