08-20-2012 05:39 AM
/**
* @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;
}
<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 && var.longValue == null && 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 && var.textValue2 == null && var.longValue == null && 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>
08-21-2012 02:14 AM
08-21-2012 09:59 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.