Hi,
I put an input file field in the form of my task. The file is successfully downloaded.
But when I try to get the file in the next task, i have the exception :
SEVERE: Error while getting the first page for application Pool1–1.0–Reponse commande$entry
java.lang.ClassCastException: org.bonitasoft.engine.bpm.document.DocumentValue cannot be cast to java.lang.String
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.getAttachmentFormFieldValue(FormServiceProviderImpl.java:1827)
at org.bonitasoft.forms.server.api.impl.util.FormFieldValuesUtil.setFormWidgetValues(FormFieldValuesUtil.java:604)
at org.bonitasoft.forms.server.api.impl.util.FormFieldValuesUtil.setFormWidgetsValues(FormFieldValuesUtil.java:883)
at org.bonitasoft.forms.server.FormsServlet.getFormFirstPage(FormsServlet.java:218)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at org.bonitasoft.forms.server.FormsServlet.processCall(FormsServlet.java:130)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
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:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:744)
Someone can explain me ?
I think that you have the document variable in a text field and the casting is not possible. Otherwise you are storing the document in a text variable.
I suggest you to use a document, this way you can control the versions and make search using the API.
Select a pool (or a lane) and choose the General tab. In this tab, go to the last option “documents” and create a new one.
To change the file load go to your load form and change the output operation of the file widget to this new document. Then click at “Takes value of” and select “Set document”.
To change the file download go to your download form and simply change the initial value of the file widget to the document variable.
I just test it and it works perfectly ;).
Thanks ruben, that works !
Once again, thanks for your help.
Hello Fabien, can you please highlight the answer that solved your issue by clicking the related “Resolved by this answer” Button ?
First, thanks for the answer.
My document variable is in an Object Java (org.bonitasoft.engine.bpm.document.DocumentValue)
And I’m trying to store the document in a File field.
Any idea ?