cancel
Showing results for 
Search instead for 
Did you mean: 

Replace a file/content in a space during simple-workflow in Alfresco

janardhan1982
Champ in-the-making
Champ in-the-making
Hi ,

I am using Alfresco 4.0.e version, and i am facing a problem in simple workflow.

Problem Description:

I created a Folders "Draft" and "Approved" and added "simple-workflow" to Draft folder in Rule. First time file was copying to Approved folder based on user approval and second time if user edited existing file in Draft folder again workflow will create for file and if user approved, it was giving error "File already exists". Please suggest how to resolve this problem. This was very urgent for my project

Regards,
Janardhan
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
So your requirement is it should replace the existing file right?
Check out this thread
https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/duplicate-files-and-update-061...

HI Mitpatoliya,

I gone through this https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/duplicate-files-and-update-061...

and i identified the below comments.

Well if you want to do with the behavior you can bind the behavior to oncontentupdate policy.and place the logic of replacing the duplicate copy.

If you want to go for the alternate approach one way is via rule.
Create a rule which will create a copy of the any new document at specific location.
Create one more rule which will be invoked on the content update and will execute a script.
That script will search in for the duplicate copy of the document which is going to be updated delete the copy and place the new copy over there.


Could you please send java script code for deleting existing file in alfresco space

Janardhan