Page 1 of 1

Document Retention

PostPosted:Sun Aug 22, 2010 4:42 am
by surajaya
Hello,

I'm planing to implement retention policy (implemented as a workflow process). So here is my plan :
- User must choose a date.
- Perform a query to find all Document that's older than those date
- Delete all document that match those criteria

So far, I have no problem with deleting or moving Document to other place, but I have difficulty in searching the Document. Is there any sample code on using AdvancedSearch in openKM ?. Here is snipet of my planned code (action handler for the retention policy) :
Code: Select all
DirectDocumentModule MyDocument = null;
AdvancedSearchQuery FoundDocs = null;
FoundDocs = new AdvancedSearchQuery();
MyDocument = new DirectDocumentModule();
...
...
...
...
/*Repeat an delete all Document that match the Search key */
...
...
MyDocument.delete(...., .....);
...
...
...

Re: Document Retention

PostPosted:Sun Aug 22, 2010 8:46 am
by jllort
Depending if you planning wiht version 4.x or 5.x have several options, I recommend 5.x as a OpenKM extension ... that for my point of view the best option, but you need waiting until september for it, now only some of our clients have accesing to 5.X community might be waiting until we release at september.

I could suggest using weservices ( version 4.x or 5.x ) or extension ( only for 5.x )

We'll some extra information is need for what I understand.
1- Some users makes a query and any result of that query it's a document to be deleted ... there's some user validation for each document or not ? That could be dangerous ... if users makes a bad query could delete some documents that must not be deleted.
2- Anybody can execute that purge action or only administrators ?
3- You talk about it as a part of a workflow ... could you provide here more explained example.

Re: Document Retention

PostPosted:Mon Aug 23, 2010 12:12 am
by surajaya
jllort wrote:Depending if you planning wiht version 4.x or 5.x have several options, I recommend 5.x as a OpenKM extension ... that for my point of view the best option, but you need waiting until september for it, now only some of our clients have accesing to 5.X community might be waiting until we release at september.

I could suggest using weservices ( version 4.x or 5.x ) or extension ( only for 5.x )
Version 4.1 at the moment.
We'll some extra information is need for what I understand.
1- Some users makes a query and any result of that query it's a document to be deleted ... there's some user validation for each document or not ? That could be dangerous ... if users makes a bad query could delete some documents that must not be deleted.
The user will not make the query, they just need to input the desired date. Any document having revision time older than that date will be deleted / moved somewhere.
2- Anybody can execute that purge action or only administrators ?
This workflow is supposed to be run only by Administrator.
3- You talk about it as a part of a workflow ... could you provide here more explained example.
Actually I just testing workflow with version 4.1. It's a simple workflow : Start --> Enter the date (this is human task) --> Automated Process to delete / move the document --> End

Re: Document Retention

PostPosted:Mon Aug 23, 2010 10:16 am
by jllort
The best solution is making a scheduled process ( running each day ) with webservices, really it's easy
1- make a query ( in 4.x date must be set in a input type, in 5.x we've got date input type ) filtered by metadata , filter -> date='some date'
2- delete or make some operation on query results