SQL query before displaying a form

1
0
-1

Hi, I have a process where I need to fill a form with data from my database. This process is initiated by another user and can be done a long time after. I want to load data only when the human task begins.

At the moment, in my process it loads data when the process start. And if I do the human task 2-3 days after, the data are not up to date.

Here is the process : process

Is it possible to do that and how ?

1 answer

1
+1
-1
This one is the BEST answer!

The simplest would be to use form transient data (click on your human task, go to Pageflow-Transient Data). Then you can use a connector for data initialization, and it would be triggered when form is being open, retrieving the up-to-date data. Hope this helps, Haris

Comments

Submitted by yannick.lombardi on Tue, 08/05/2014 - 15:31

Thanks, it seems to be exactly what I need. I will try this.

Submitted by yannick.lombardi on Tue, 08/05/2014 - 17:22

It works fine but I have a strange error each time I begin my human task.

2014-08-05 17:10:07 org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl
GRAVE: Username<YLombardi> Form<Cycle de vie d'un sujet SS--1.01--Valider le sujet$entry> Submitted Fields<Description (java.lang.String) => dfssf ; EditableGrid1 (java.util.Collection) => [] ; Checkbox1 (java.lang.Boolean) => true ; TextArea1 (java.lang.String) => fg ; Select1 (java.lang.String) => Dev en cours ; > Task<Valider le sujet>
java.lang.Exception
        at org.bonitasoft.forms.server.util.FormLogger.log(FormLogger.java:47)
        at org.bonitasoft.forms.server.util.FormLogger.logWithoutContext(FormLogger.java:41)
        at org.bonitasoft.forms.server.util.FormLogger.log(FormLogger.java:24)
        at org.bonitasoft.forms.server.provider.impl.FormServiceProviderExtImpl.executeConnector(FormServiceProviderExtImpl.java:87)
        at org.bonitasoft.forms.server.FormsServletExt.getFormFirstPage(FormsServletExt.java:145)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        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:111)
        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)

Everything works fine so I don't know why there is this.

Submitted by haris.subasic on Tue, 08/05/2014 - 17:40

I don't find anything in the log extract that would help pont you out to a solution... Does it happen when you open a form or when you submit it?

Submitted by yannick.lombardi on Wed, 08/06/2014 - 08:37

It happens when I open a form.

Submitted by haris.subasic on Wed, 08/06/2014 - 10:37

It seems to me that it is just a logging issue, so I wouldn't worry about it as long as everything works fine. It may be related to the single quote in the name of your form. You can try to remove it and check if this is the issue.

Submitted by yannick.lombardi on Wed, 08/06/2014 - 10:42

I try with a process with only 2 task (without quote in their names) and I have the same error in the log. I open a case on the customer portail to know what cause this.

Notifications