AnsweredAssumed Answered

HistoricProcessInstanceQueryImpl processVariableEquals

Question asked by mitziuro on Aug 20, 2012
Latest reply on Aug 21, 2012 by mitziuro
You once had (december 2011):


/**
* @author Tom Baeyens
* @author Falko Menge
* @author Bernd Ruecker
*/
public class HistoricProcessInstanceQueryImpl extends AbstractVariableQueryImpl<HistoricProcessInstanceQuery, HistoricProcessInstance> implements HistoricProcessInstanceQuery {



public HistoricProcessInstanceQuery processVariableEquals(String variableName, Object variableValue) {
   variables.add(new QueryVariableValue(variableName, variableValue, QueryOperator.EQUALS));
   return this;
}

but now it's gone:

3095 14.12.2011 13:33:48, by trademak
Rollback process variable equals query for history process instances


In HistoricProcessInstance.xml you still have:


     <foreach collection="variables" index="index" item="var">
        and exists (
          select HD.ID_
          from ${prefix}ACT_HI_DETAIL HD
          where
            HD.TYPE_ = 'VariableUpdate'
            and HD.NAME_ =  #{var.name}
            and HD.PROC_INST_ID_ = HPI.PROC_INST_ID_ and HD.TASK_ID_ is null
            and HD.REV_ = (select max(HDM.REV_) from ${prefix}ACT_HI_DETAIL HDM where HDM.PROC_INST_ID_ = HPI.PROC_INST_ID_ and HDM.TASK_ID_ is null and HDM.VAR_TYPE_ = #{var.type} and HDM.NAME_ = #{var.name} and HDM.TYPE_ = 'VariableUpdate')
            and HD.TIME_ = (select max(HDM.TIME_) from ${prefix}ACT_HI_DETAIL HDM where HDM.PROC_INST_ID_ = HPI.PROC_INST_ID_ and HDM.TASK_ID_ is null and HDM.VAR_TYPE_ = #{var.type} and HDM.NAME_ = #{var.name} and HDM.TYPE_ = 'VariableUpdate')

            <if test="!var.type.equals('null')">
              and HD.VAR_TYPE_ = #{var.type}
            </if>
            <!– Variable value –>
            <if test="var.textValue != null &amp;&amp; var.longValue == null &amp;&amp; var.doubleValue == null">
              and HD.TEXT_ =  #{var.textValue}
            </if>
            <if test="var.textValue2 != null">
              and HD.TEXT2_ = #{var.textValue2}
            </if>
            <if test="var.longValue != null">
              and HD.LONG_ = #{var.longValue}
            </if>
            <if test="var.doubleValue != null">
              and HD.DOUBLE_ = #{var.doubleValue}
            </if>
            <!– Null variable type –>
            <if test="var.textValue == null &amp;&amp; var.textValue2 == null &amp;&amp; var.longValue == null &amp;&amp; var.doubleValue == null">
              and HD.TEXT_ is null and HD.TEXT2_ is null and HD.LONG_ is null and HD.DOUBLE_ is null and HD.BYTEARRAY_ID_ is null
            </if>
        )
      </foreach>

so you've just removed the query support.

Is there any particular reason for removing this feature?
We are planning(in our application) to reactivate it(the variable search support), so we were curious if there are any problems with this kind of approach.

Outcomes