Download document from overview form when process instance is archived

Hello Everybody:

There is a problem when I try to download a document from overview form when process instance is archived. The steps are:
“Cases” ->“My cases” ->“archived”->“OVERVIEW”, the form show all information and documents link, however when I try to download a document, a page error appears whit the next message: 500 “org.bonitasoft.engine.bpm.document.ArchivedDocumentNotFoundException”. Message in the stack trace: “Error while retrieving the document with ID 22 from the engine”.

I understand that when cases are archived, the documents ID change and in this case the new ID is 16 but application is trying to get with document ID 22 which correspond to old ID before case was archived.

Please, I appreciate your help. I like to know how to enable documents download from overview form when cases are archived.

Bonita version: 6.5.1
Java version: 1.7

Stack trace:
2015-05-16 15:21:07 org.bonitasoft.forms.server.DocumentDownloadServlet
SEVERE: Error while retrieving the document with ID 22 from the engine.
org.bonitasoft.engine.bpm.document.ArchivedDocumentNotFoundException: USERNAME=P018619 | org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException: Document not found with identifier: 22
at org.bonitasoft.engine.api.impl.DocumentAPIImpl.getArchivedProcessDocument(DocumentAPIImpl.java:390)
at org.bonitasoft.engine.api.impl.ProcessAPIImpl.getArchivedProcessDocument(ProcessAPIImpl.java:5014)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:363)
at org.bonitasoft.engine.api.impl.ServerAPIImpl$1.call(ServerAPIImpl.java:332)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:288)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:339)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:274)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:128)
at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88)
at com.sun.proxy.$Proxy14.getArchivedProcessDocument(Unknown Source)
at org.bonitasoft.forms.server.DocumentDownloadServlet.doGet(DocumentDownloadServlet.java:163)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.isAuthorized(AuthenticationFilter.java:149)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doAuthenticationFiltering(AuthenticationFilter.java:132)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException: Document not found with identifier: 22
at org.bonitasoft.engine.core.document.api.impl.DocumentServiceImpl.getArchivedDocument(DocumentServiceImpl.java:196)
at org.bonitasoft.engine.api.impl.DocumentAPIImpl.getArchivedProcessDocument(DocumentAPIImpl.java:388)
… 44 more