Hello,
With v.5.* we used to handle attachment of multiple files to a process and multi instanciatite an activity based on the resulting list of documents.
To achieve this we had to use a variable with the type attachment set to be multiple, and then save the output of multiple file widget in this list.
So far so good.
It happens that, with v. 6, the document abstraction provided in replacement to attachment type does not expose multiplicity.
How to get that feature working with v6 ? That is the question.
Thank you,
Hello,
you should now use a variable of type java.util.List, into which you will be able to store multiple files. You will still mark your file widget as being multiple, and save its output to your list variable (same works if you want to show documents already stored in a list variable).
Cheers,
Haris
Thank you Haris,
I’ve tried this allready but I get an error submiting the form with the following trace:
SEVERE: A error occured while executing the command.
org.bonitasoft.engine.command.CommandExecutionException: USERNAME=walter.bates | org.bonitasoft.engine.command.SCommandExecutionException: Error executing command 'Map ExecuteActionsAndTerminateTaskExt(Map<Operation, Map> operationsMap, long activityInstanceId)'
at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:214)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:184)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:173)
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:368)
at org.bonitasoft.engine.api.impl.ServerAPIImpl$1.call(ServerAPIImpl.java:337)
at com.bonitasoft.engine.transaction.JTATransactionServiceExt.executeInTransaction(JTATransactionServiceExt.java:55)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:344)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:286)
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.$Proxy46.execute(Unknown Source)
at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:186)
at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIExtImpl.executeActionsAndTerminate(FormWorkflowAPIExtImpl.java:138)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:985)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl.executeActions(FormServiceProviderExtImpl.java:74)
at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:849)
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:138)
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.bonitasoft.console.common.server.sso.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:745)
Caused by: org.bonitasoft.engine.command.SCommandExecutionException: Error executing command 'Map ExecuteActionsAndTerminateTaskExt(Map<Operation, Map> operationsMap, long activityInstanceId)'
at com.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTaskExt.execute(ExecuteActionsAndTerminateTaskExt.java:77)
at com.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTaskExt.execute(ExecuteActionsAndTerminateTaskExt.java:44)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:212)
... 48 more
Caused by: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: Incompatible assignment operation type: Left operand class java.util.HashMap is not compatible with right operand class java.util.ArrayList for expression with name 'context [containerId=220019, containerType=ACTIVITY_INSTANCE, processDefinitionId=8870472107032300263]'
at org.bonitasoft.engine.core.operation.impl.AssignmentOperationExecutorStrategy.checkReturnType(AssignmentOperationExecutorStrategy.java:69)
at org.bonitasoft.engine.core.operation.impl.AssignmentOperationExecutorStrategy.computeNewValueForLeftOperand(AssignmentOperationExecutorStrategy.java:50)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.executeOperators(OperationServiceImpl.java:105)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:89)
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.updateActivityInstanceVariables(ExecuteActionsAndTerminateTask.java:130)
at com.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTaskExt.execute(ExecuteActionsAndTerminateTaskExt.java:70)
... 50 more
2014-07-29 14:40:58 org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl
SEVERE: Username<walter.bates> Form<ECM_SubProcess–1.0–Import documents$entry> Submitted Fields<File1 (java.lang.String) => > Task
org.bonitasoft.console.common.server.utils.BPMEngineException: A error occured while executing the command.
at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:204)
at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIExtImpl.executeActionsAndTerminate(FormWorkflowAPIExtImpl.java:138)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:985)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl.executeActions(FormServiceProviderExtImpl.java:74)
at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:849)
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:138)
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.bonitasoft.console.common.server.sso.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:745)
What i’ve done is exactly what you mentioned ie creating a java.util.list object at the pool level and then affect form field (list) to my vairable (list). I’m digging this and let you know
leading trace was from an attempt with no file attached and following results from another with 3 files
2014-07-29 14:49:24 org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil
SEVERE: A error occured while executing the command.
org.bonitasoft.engine.command.CommandExecutionException: USERNAME=walter.bates | org.bonitasoft.engine.command.SCommandExecutionException: Error executing command 'Map ExecuteActionsAndTerminateTaskExt(Map<Operation, Map> operationsMap, long activityInstanceId)'
at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:214)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:184)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.execute(CommandAPIImpl.java:173)
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:368)
at org.bonitasoft.engine.api.impl.ServerAPIImpl$1.call(ServerAPIImpl.java:337)
at com.bonitasoft.engine.transaction.JTATransactionServiceExt.executeInTransaction(JTATransactionServiceExt.java:55)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:344)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:286)
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.$Proxy46.execute(Unknown Source)
at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:186)
at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIExtImpl.executeActionsAndTerminate(FormWorkflowAPIExtImpl.java:138)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:985)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl.executeActions(FormServiceProviderExtImpl.java:74)
at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:849)
at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
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:138)
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.bonitasoft.console.common.server.sso.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:745)
Caused by: org.bonitasoft.engine.command.SCommandExecutionException: Error executing command 'Map ExecuteActionsAndTerminateTaskExt(Map<Operation, Map> operationsMap, long activityInstanceId)'
at com.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTaskExt.execute(ExecuteActionsAndTerminateTaskExt.java:77)
at com.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTaskExt.execute(ExecuteActionsAndTerminateTaskExt.java:44)
at org.bonitasoft.engine.api.impl.CommandAPIImpl.executeCommand(CommandAPIImpl.java:212)
... 47 more
Caused by: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: Incompatible assignment operation type: Left operand class java.util.HashMap is not compatible with right operand class java.util.ArrayList for expression with name 'context [containerId=220025, containerType=ACTIVITY_INSTANCE, processDefinitionId=8855292472548470911]'
at org.bonitasoft.engine.core.operation.impl.AssignmentOperationExecutorStrategy.checkReturnType(AssignmentOperationExecutorStrategy.java:69)
at org.bonitasoft.engine.core.operation.impl.AssignmentOperationExecutorStrategy.computeNewValueForLeftOperand(AssignmentOperationExecutorStrategy.java:50)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.executeOperators(OperationServiceImpl.java:105)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:89)
at org.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTask.updateActivityInstanceVariables(ExecuteActionsAndTerminateTask.java:130)
at com.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTaskExt.execute(ExecuteActionsAndTerminateTaskExt.java:70)
... 49 more
2014-07-29 14:49:24 org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl
SEVERE: Username<walter.bates> Form<ECM_SubProcess–1.0–Import documents$entry> Submitted Fields<File1 (java.io.File) => /home/acordier/BonitaBPMSubscription-6.3.2/workspace/tomcat/bonita/client/tenants/1/tmp/tmp_8591975628088608160.zip ; File1 (java.io.File) => /home/acordier/BonitaBPMSubscription-6.3.2/workspace/tomcat/bonita/client/tenants/1/tmp/tmp_8318467537700512269.zip ; > Task
org.bonitasoft.console.common.server.utils.BPMEngineException: A error occured while executing the command.
at org.bonitasoft.console.common.server.utils.BPMEngineAPIUtil.executeCommand(BPMEngineAPIUtil.java:204)
at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIExtImpl.executeActionsAndTerminate(FormWorkflowAPIExtImpl.java:138)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.executeActions(FormServiceProviderImpl.java:985)
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl.executeActions(FormServiceProviderExtImpl.java:74)
at org.bonitasoft.forms.server.FormsServlet.executeActions(FormsServlet.java:849)
at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
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:138)
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.bonitasoft.console.common.server.sso.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:745)
In the log, we can see:
Left operand class java.util.HashMap is not compatible with right operand class java.util.ArrayList
Please, double check your operation on the Data tab of your file widget, you should make sure that you use your widget output (something like file_File1 that is of type java.util.List) and that you map to a variable of the same type. From the error message, it seems that this is currently not the case.
Just double checked it, and it works fine on my side…
Yes, i’ve noticed this and doublechecked, and well my variable is definitly a java.util.List object, while I can as you said, view that field_File1 is of type java.util.List too
Look,
I works with creating another variable, named “anotherList” (same type, triple checked, well, a list)
My first variable was called “attachments” … can that be kind of a “namespace” issue ?
Though that was the right answer, thank you