cancel
Showing results for 
Search instead for 
Did you mean: 

full text search in variables

elsarfhem
Champ in-the-making
Champ in-the-making
I think that actually there's a big limitation in Activiti framework. I want to search a string with contains criteria in variables stored by engine… But there's no method in api that expose this functionality!
I would like to do something like

historyService.createHistoricDetailQuery()
.variableUpdates()
.variableNameLike("%varname%")     //missing api method
.variableValueLike("%varvuale%")      //missing api method
.list();

So the only alternative is to retry every variable update and cycle them?! And if I have 2 millions variable updates?! There will be an OutofMemory error for sure!
Any other way to accomplish this requirements?
9 REPLIES 9

michal_warecki
Champ in-the-making
Champ in-the-making
I don't know very well Activiti API but there is always possibility to search directly in database table with 'like' sql statement.
Meanwhile you can send JIRA request for that functionality (if it is not implemented).

elsarfhem
Champ in-the-making
Champ in-the-making
I know I could to an home-made search but it's not the same thing, architecturally speaking… I choose a bpm engine to be aware of all things related to the process (like process variables).
I think it should be a fundamental operation of the historical engine.
I hope that the activiti staff explain us how to deal with this requirements.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
There is a difference between process variables and all you domain data. We always clearly separated them and use a best of breed solution for each. E.g. Alfresco with all it's full text search options or just use you own database with jpa and use references. This works great.

elsarfhem
Champ in-the-making
Champ in-the-making
ok, so why do you define this method?
runtimeService.createProcessInstanceQuery().variableValueLike(arg0, arg1)
and not

historicalService.createProcessInstanceQuery().variableValueLike(arg0, arg1)
or

historicalService.createHistoricDetailQuery().variableValueLike(arg0, arg1)
sorry, but it seems not coeherent.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
1: I did not define that
2: I never mentioned everything was coherent
3: The fact that something is possible does mean it is optimal (try driving in a screw with a hammer)

elsarfhem
Champ in-the-making
Champ in-the-making
but how can you say that would be optimal search ALL process variable (not domain data… I use JPA for that) in memory rather than having a service that retrieve only those of interests!?

Critics help project growth of project. I thought it would be nice to point out this lacks in functionality… maybe I was wrong.

Thank you anyway

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Sorry, my comment was not meant to sound harsh. Criticism helps indeed, but often people are looking for one-solution-fits-all in a bpm engine and they want to have it do everything. That is never a good way to start.

4: I never said it was optimal to search ALL process variables. 🙂

We (I) never search ALL process variables. They are only used in the process instance/engine. If I want/need to search things, I search in the domain model (and/or something like Alfresco ECM) and find the corresponding entries in the bpm engine if necessary

The next question could be: 'I want to search in a pdf as well, can that be done?', or something similar. Sure it can, but that is what a content management solution is good at.

elsarfhem
Champ in-the-making
Champ in-the-making
Sorry, my comment was not meant to sound harsh. Criticism helps indeed, but often people are looking for one-solution-fits-all in a bpm engine and they want to have it do everything. That is never a good way to start.

4: I never said it was optimal to search ALL process variables. 🙂

We (I) never search ALL process variables. They are only used in the process instance/engine. If I want/need to search things, I search in the domain model (and/or something like Alfresco ECM) and find the corresponding entries in the bpm engine if necessary

The next question could be: 'I want to search in a pdf as well, can that be done?', or something similar. Sure it can, but that is what a content management solution is good at.

I'm not looking for one-framework-to-rule'em-all, I agree with you but I think that variable search should be a process engine responsability. I think that engine will have a great usability boost with this feature.

You never said it was optimal, but it's the only kind of search that process engine expose for historical variables…

If you never search for process variable means that you are modeling some data as domain data and as process data.
It sounds me quite redundant (at least), don't you?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
retrieving variables is a engine responsibility, finding them based on substrings (or even full values) can be debated. I've never used it. Searching in a domain model or something like alfresco works better imo. And no, we do not store them twice, we store references using jpa if needed and even better is that we use expressions that retrieve values from beans in the context (cdi), so we almost do not store anything in the process engine…