How to show user and database info on the first form (Pool pageflow)?

1
0
-1

Hi,

what is the easiest way to show contact information, manager information and e-mail of the logged user and database info on the first form (Pool pageflow)?

I read lot of threads on the forum, saw all the Bonita videos, read the documentation, read a lot of workaround, tried 50 variation to get it work on my Bonita Community 6.2.6, Java 7.0.55, win 7 _ 64 bits, but what I get is the error below on the "...engine log" and the first page shows an error "Error while getting the form page list." :

  1. Mai 01, 2014 10:51:01 PM org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl resolveExpressions
  2. SEVERE: Error while communicating with the engine.
  3. org.bonitasoft.console.common.server.utils.BPMEngineException: Error when evaluating expressions on process definition 5333649691513201181
  4. at org.bonitasoft.forms.server.accessor.api.ExpressionEvaluatorEngineClient.evaluateExpressionsOnProcessDefinition(ExpressionEvaluatorEngineClient.java:62)
  5. at org.bonitasoft.forms.server.api.impl.FormExpressionsAPIImpl.evaluateProcessExpressions(FormExpressionsAPIImpl.java:1077)
  6. at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIImpl.getProcessFieldsValues(FormWorkflowAPIImpl.java:897)
  7. at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.resolveExpressions(FormServiceProviderImpl.java:917)
  8. at org.bonitasoft.forms.server.api.impl.util.FormFieldValuesUtil.setFormWidgetsValues(FormFieldValuesUtil.java:877)
  9. at org.bonitasoft.forms.server.FormsServlet.getFormFirstPage(FormsServlet.java:218)
  10. at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
  11. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  12. at java.lang.reflect.Method.invoke(Unknown Source)
  13. at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
  14. at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
  15. at org.bonitasoft.forms.server.FormsServlet.processCall(FormsServlet.java:130)
  16. at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
  17. at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
  18. at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
  19. at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  20. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  21. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  22. at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
  23. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  24. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  25. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  26. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  27. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  28. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  29. at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77)
  30. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  31. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  32. at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  33. at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  34. at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  35. at java.lang.Thread.run(Unknown Source)
  36. Caused by: org.bonitasoft.engine.expression.ExpressionEvaluationException: org.bonitasoft.engine.expression.exception.SInvalidExpressionException: Declared return type class java.lang.Long is not compatible with evaluated type class java.lang.Integer for expression processInstanceId
  37. at org.bonitasoft.engine.api.impl.ProcessAPIImpl.evaluateExpressionsOnProcessDefinition(ProcessAPIImpl.java:5338)
  38. at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
  39. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  40. at java.lang.reflect.Method.invoke(Unknown Source)
  41. at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:294)
  42. at org.bonitasoft.engine.api.impl.ServerAPIImpl.access$000(ServerAPIImpl.java:65)
  43. at org.bonitasoft.engine.api.impl.ServerAPIImpl$1.call(ServerAPIImpl.java:263)
  44. at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:257)
  45. at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:270)
  46. at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:221)
  47. at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:107)
  48. at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88)
  49. at com.sun.proxy.$Proxy13.evaluateExpressionsOnProcessDefinition(Unknown Source)
  50. at org.bonitasoft.forms.server.accessor.api.ExpressionEvaluatorEngineClient.evaluateExpressionsOnProcessDefinition(ExpressionEvaluatorEngineClient.java:60)
  51. ... 31 more
  52. Caused by: org.bonitasoft.engine.expression.exception.SInvalidExpressionException: Declared return type class java.lang.Long is not compatible with evaluated type class java.lang.Integer for expression processInstanceId
  53. at org.bonitasoft.engine.expression.impl.ExpressionServiceImpl.checkReturnType(ExpressionServiceImpl.java:157)
  54. at org.bonitasoft.engine.expression.impl.ExpressionServiceImpl.evaluate(ExpressionServiceImpl.java:132)
  55. at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionsOfKind(ExpressionResolverServiceImpl.java:162)
  56. at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionsFlatten(ExpressionResolverServiceImpl.java:105)
  57. at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluate(ExpressionResolverServiceImpl.java:73)
  58. at org.bonitasoft.engine.api.impl.transaction.expression.EvaluateExpressionsDefinitionLevel.execute(EvaluateExpressionsDefinitionLevel.java:74)
  59. at org.bonitasoft.engine.api.impl.ProcessAPIImpl.evaluateExpressionsDefinitionLevel(ProcessAPIImpl.java:5381)
  60. at org.bonitasoft.engine.api.impl.ProcessAPIImpl.evaluateExpressionsOnProcessDefinition(ProcessAPIImpl.java:5334)
  61. ... 44 more
  62.  
  63. Mai 01, 2014 10:51:01 PM org.bonitasoft.forms.server.FormsServlet getFormFirstPage
  64. SEVERE: Error while getting the first page for application Validação em 3 fases--1.0$entry
  65. org.bonitasoft.forms.server.exception.FormNotFoundException: Error while communicating with the engine.
  66. at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.resolveExpressions(FormServiceProviderImpl.java:939)
  67. at org.bonitasoft.forms.server.api.impl.util.FormFieldValuesUtil.setFormWidgetsValues(FormFieldValuesUtil.java:877)
  68. at org.bonitasoft.forms.server.FormsServlet.getFormFirstPage(FormsServlet.java:218)
  69. at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
  70. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  71. at java.lang.reflect.Method.invoke(Unknown Source)
  72. at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
  73. at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
  74. at org.bonitasoft.forms.server.FormsServlet.processCall(FormsServlet.java:130)
  75. at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
  76. at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
  77. at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
  78. at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  79. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  80. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  81. at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
  82. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  83. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  84. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  85. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  86. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  87. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  88. at org.bonitasoft.console.security.SessionFixationValve.invoke(SessionFixationValve.java:77)
  89. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  90. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  91. at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  92. at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
  93. at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  94. at java.lang.Thread.run(Unknown Source)
1 answer

1
0
-1

Hello,

From the trace you gave, we can find the root cause of the form loading failure: "return type class java.lang.Long is not compatible with evaluated type class java.lang.Integer for expression processInstanceId". It seems that you are trying to fit a Long typed value when an Integer typed value is requested as return type in one of your expression which is named processInstanceId.

Two cases here: - In many cases, when you are editing an expression from the expression editor dialog, you can define the returned type of the edited expression. If it is the case here and you want the returned type to be Long, change the return type to Long. - Otherwise you will have to cast your Long value to an Integer if it is reliable.

Pierrick

Comments

Submitted by jocafi on Fri, 05/02/2014 - 16:39

Thanks, Pierrick I noticed that, but I tried before to return a Long on a possible solution using a script without sucess.

I noticed that I cannot use the pool data variables in the first form. why ?

In the case above I tried a workaround creating a transient variable on the pool level of type String just to get the username of the process initiator. I could assign this variable to one Text widget on the first form but I get the error above.

If I remove the transient variable it works.

how can I use dynamic data including the Bonita user information to fill the first form?

Thx Joca

Submitted by pierrick.voulet on Fri, 05/02/2014 - 16:47

Hello Jocafi,

I think you are not putting the data variable at the right place. Actually, you should be able to use them in the first form and it is not possible to have transient data on the pool level as you said.

Pierrick

Submitted by jocafi on Fri, 05/02/2014 - 23:32

Yes, you can. See my workarea: http://imgur.com/JwQ9D3g

The variables mBanana1 and mBanana2 contains pure text and it works if I use them on the first form. mUsername contains the script below:

  1. return BonitaUsers.getProcessInstanceInitiator(apiAccessor,processInstanceId).firstName + " " + BonitaUsers.getProcessInstanceInitiator(apiAccessor,processInstanceId).lastName;

Whether I use it or not on the form, the system generates the error above. I have to remove / delete this transient variable in order the system can work again.

Notifications