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." :

Mai 01, 2014 10:51:01 PM org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl resolveExpressions
SEVERE: Error while communicating with the engine.
org.bonitasoft.console.common.server.utils.BPMEngineException: Error when evaluating expressions on process definition 5333649691513201181
        at org.bonitasoft.forms.server.accessor.api.ExpressionEvaluatorEngineClient.evaluateExpressionsOnProcessDefinition(ExpressionEvaluatorEngineClient.java:62)
        at org.bonitasoft.forms.server.api.impl.FormExpressionsAPIImpl.evaluateProcessExpressions(FormExpressionsAPIImpl.java:1077)
        at org.bonitasoft.forms.server.api.impl.FormWorkflowAPIImpl.getProcessFieldsValues(FormWorkflowAPIImpl.java:897)
        at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.resolveExpressions(FormServiceProviderImpl.java:917)
        at org.bonitasoft.forms.server.api.impl.util.FormFieldValuesUtil.setFormWidgetsValues(FormFieldValuesUtil.java:877)
        at org.bonitasoft.forms.server.FormsServlet.getFormFirstPage(FormsServlet.java:218)
        at sun.reflect.GeneratedMethodAccessor171.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: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.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)
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
        at org.bonitasoft.engine.api.impl.ProcessAPIImpl.evaluateExpressionsOnProcessDefinition(ProcessAPIImpl.java:5338)
        at sun.reflect.GeneratedMethodAccessor86.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:294)
        at org.bonitasoft.engine.api.impl.ServerAPIImpl.access$000(ServerAPIImpl.java:65)
        at org.bonitasoft.engine.api.impl.ServerAPIImpl$1.call(ServerAPIImpl.java:263)
        at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:257)
        at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:270)
        at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:221)
        at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:107)
        at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:88)
        at com.sun.proxy.$Proxy13.evaluateExpressionsOnProcessDefinition(Unknown Source)
        at org.bonitasoft.forms.server.accessor.api.ExpressionEvaluatorEngineClient.evaluateExpressionsOnProcessDefinition(ExpressionEvaluatorEngineClient.java:60)
        ... 31 more
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
        at org.bonitasoft.engine.expression.impl.ExpressionServiceImpl.checkReturnType(ExpressionServiceImpl.java:157)
        at org.bonitasoft.engine.expression.impl.ExpressionServiceImpl.evaluate(ExpressionServiceImpl.java:132)
        at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionsOfKind(ExpressionResolverServiceImpl.java:162)
        at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionsFlatten(ExpressionResolverServiceImpl.java:105)
        at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluate(ExpressionResolverServiceImpl.java:73)
        at org.bonitasoft.engine.api.impl.transaction.expression.EvaluateExpressionsDefinitionLevel.execute(EvaluateExpressionsDefinitionLevel.java:74)
        at org.bonitasoft.engine.api.impl.ProcessAPIImpl.evaluateExpressionsDefinitionLevel(ProcessAPIImpl.java:5381)
        at org.bonitasoft.engine.api.impl.ProcessAPIImpl.evaluateExpressionsOnProcessDefinition(ProcessAPIImpl.java:5334)
        ... 44 more

Mai 01, 2014 10:51:01 PM org.bonitasoft.forms.server.FormsServlet getFormFirstPage
SEVERE: Error while getting the first page for application Validação em 3 fases--1.0$entry
org.bonitasoft.forms.server.exception.FormNotFoundException: Error while communicating with the engine.
        at org.bonitasoft.forms.server.provider.impl.FormServiceProviderImpl.resolveExpressions(FormServiceProviderImpl.java:939)
        at org.bonitasoft.forms.server.api.impl.util.FormFieldValuesUtil.setFormWidgetsValues(FormFieldValuesUtil.java:877)
        at org.bonitasoft.forms.server.FormsServlet.getFormFirstPage(FormsServlet.java:218)
        at sun.reflect.GeneratedMethodAccessor171.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: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.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)
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:

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