Hello all,
I’m trying to get Portal comments into a form task.
For a first try, I want every comments without any other filter than being the current Case.
I don’t know what’s wrong. I’ll appreciate any help you may provide. Thanks.
I coded a groovy expression in a text area widget (General > Data > Initial value):
import org.bonitasoft.engine.api.ProcessAPI; import org.bonitasoft.engine.session.APISession; import org.bonitasoft.engine.search.impl.SearchResultImpl; import org.bonitasoft.engine.search.impl.SearchOptionsImpl; import org.bonitasoft.engine.search.impl.SearchFilter; import org.bonitasoft.engine.search.SearchOptionsBuilder; import org.bonitasoft.engine.bpm.comment.Comment;ProcessAPI proAPI = apiAccessor.getProcessAPI();
SearchOptionsBuilder filtro = SearchOptionsBuilder.filter(‘processInstanceId’, processInstanceId);
List comentarios = proAPI.searchComments(filtro.getFilters());
return comentarios.toArray().toString();
This is what I get at engine log:
2014-09-15 16:02:30 org.bonitasoft.forms.server.FormsServletExt
SEVERE: Error while getting the first page for id Expense Claim–1.3–1st Approval$entry
org.bonitasoft.forms.server.exception.FormInitializationException: Error when evaluating expressions on activity instance 60107. Error on expression evaluation for the attribute [initial-value] of object [additionalNotes1].
at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.resolveExpressions(FormServiceProviderImpl.java:910)
at org.bonitasoft.forms.server.FormsServletExt.resolveFormFieldExpressions(FormsServletExt.java:401)
at org.bonitasoft.forms.server.FormsServletExt.setFormFieldValues(FormsServletExt.java:354)
at org.bonitasoft.forms.server.FormsServletExt.setFormFieldValues(FormsServletExt.java:323)
at org.bonitasoft.forms.server.FormsServletExt.getFormFirstPage(FormsServletExt.java:167)
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 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(Unknown Source)