Delete activeWorkflows attached before delating a document

cancel
Showing results for 
Search instead for 
Did you mean: 
seif
Active Member

Delete activeWorkflows attached before delating a document

Hello,

I try to define a rule to a folder that delete all activeWorkflows attached to a document when the document it's self is deleted or deplaced. I use this script in the rule:

for(var i=0;i<document.activeWorkflows.length ;i++){
document.activeWorkflows[i].cancel();
}

When i deplaced the document all attached woekflows are cancelled but when i try to delete this document an error occure:

Could not delete 'file_name'.

help plz.

8 Replies
afaust
Master

Re: Delete activeWorkflows attached before delating a document

You need to provide more details about the error, e.g. any log output from alfresco.log - otherwise we will not be able to help you (errors can't be explained by looking into a magic 8-ball).

seif
Active Member

Re: Delete activeWorkflows attached before delating a document

thanks for your response

I delete all old messages in the log files (alfresco.log and share.log), i try to delete a document  this msg is shown 

Could not delete 'file_name'

but i have no indication in the log files (they still empty :/ )
afaust
Master

Re: Delete activeWorkflows attached before delating a document

Then please look closely into the HTTP packet for any additional details (use developer tools of your browser to monitor network packets for the web page).

seif
Active Member

Re: Delete activeWorkflows attached before delating a document

I have this error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)   http://127.0.0.1:7777/share/proxy/alfresco/slingshot/doclib/action/file/node/workspace/SpacesStore/f... 

‌ pleaze have any idea what this mean.

afaust
Master

Re: Delete activeWorkflows attached before delating a document

That just means that an error occurred. Any detail should be inside the HTTP packet as content - typically this is a JSON structure that contains a message and a callstack.

seif
Active Member

Re: Delete activeWorkflows attached before delating a document

  1. {status: {code: 500, name: "Internal Error",…},…}
    1. callstack:[]
    2. exception:""
    3. message:"JavaException: org.springframework.dao.ConcurrencyFailureException: Child association not found: 1771. A concurrency violation is likely.↵This can also occur if code reacts to 'beforeDelete' callbacks and pre-emptively deletes associations ↵that are about to be cascade-deleted. The 'onDelete' phase then fails to delete the association.↵See links on issue ALF-12358."
    4. server:"Community v5.2.0 (r125711-b6) schema 10 001"
    5. status:{code: 500, name: "Internal Error",…}
    6. time:"13 janv. 2017 12:02:53"
afaust
Master

Re: Delete activeWorkflows attached before delating a document

There you have your issue - some code seems to be misbehaving. Do you have any customisations / addons installed?

seif
Active Member

Re: Delete activeWorkflows attached before delating a document

yes. I have install an AMP