Hello Himasha, Thank for your answer but the documentation says that transient variables are not persisted in the history. And I used variables to filter on the historic-* tables. And another problem with transient variables is that I am using the REST API to instanciate new processes and not the Java API.
However, I found a workaround to my problem and I don't know if we can say that it is clean or not. I am using the description field of the user task to add the information I need. So, the variables are located in the process instances, and in the description field of the task under the pattern: var1=value1|var2=value2|var3=... That way, I can filter on the variables via the query API without asking for the returning of all of them because for each task I receive, I will be able to extract them from the description field. I suspect the return takes a very long time because it may have to make a request of the variables for each returned historic-task-instance. So if we have 10 variables for 10 task instances, we will have 10 * 10 requests? That is just a theory. Regards, Thomas 2017-11-02 4:36 GMT+01:00 Himasha Guruge <himas...@wso2.com>: > Hi Thomas, > > Could you try using TransientVariables[1] for your use-case? REST api > provided through WSO2 BPS is actually wrapping the REST API provided by > Activiti.In [2] it suggests that transient variables might be better for > performance. > > [1] https://www.activiti.org/userguide/#apiTransientVariables > [2] http://www.jorambarrez.be/blog/2016/09/01/how-to-use- > transient-variables-in-activiti/ > > Thanks > Himasha > > On Wed, Nov 1, 2017 at 12:33 AM, Thomas LEGRAND < > thomas.legr...@versusmind.eu> wrote: > >> Hello everybody, >> >> I am creating an interface to display the list of the current user tasks >> waiting for approval. In this list, I display some information provided by >> the variables inside the process instances. For example, it can be the id >> of an object that I defined during the creation of the instance of the >> process. >> >> To retrieve the information for the list, I am using the REST API. But, >> because I would like the user to be able to filter the list with criteria, >> I am using the query endpoint for the tasks to be able to filter by the >> values of the variables in the instances. >> >> However, I have a problem because it seems that I have huge >> responsiveness lag when I want the REST API to return the current state of >> the variables of the instances. Actually, when I send a query request, it >> takes around 40 seconds for the server to respond, if it does not time out. >> The problem disappears when I don't set the attribute to retrieve the list >> of the variables in my query request. >> >> For example, this one causes problems: >> >> { >> "includeProcessVariables": true >> "variables": [ >> { >> "name": "group", >> "operation": "equals", >> "value": "MyGroupName >> } >> ] >> } >> >> whereas this one causes no problems: >> { >> "variables": [ >> { >> "name": "group", >> "operation": "equals", >> "value": "MyGroupName >> } >> ] >> } >> >> I don't see other way to retrieve "custom" informations from a process >> instance except by using the variables. And because this is a list I want >> to display, it is really overkill to retrieve the list of the instances to >> loop on each one of them to retrieve their variables. >> >> Of course, in this example, I try to retrieve the current pending >> instances because one of their user task is waiting to be unblocked by a >> user. But I am doing the same thing to retrieve a list of already finished >> tasks/process instances (so by using the historic-task-instances endpoint). >> And I have exactly the same problem. Too much time to respond or time out. >> >> So, here are my questions: >> >> - Do you have any idea from where those "latency" problems could come >> from? >> - Do you know if I can use the Activiti Java API with the embedded >> Activiti in the WSO2 Business Process Server? >> >> I am using WSO2 Enterprise Integrator 6.0.0. >> >> Regards, >> >> Thomas >> >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Himasha Guruge > Senior Software Engineer > WS*O2* *Inc.* > Mobile: +94 777459299 <+94%2077%20745%209299> > himas...@wso2.com >
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev