Currently task variables are stored as content of the task within Content table as serialized blob data. Thus they are not available for any searching to filter tasks based on presence of variables or their values.
This issue is about to provide similar capabilities that Process variables have - VariableInstanceLog although slightly simplified as task variables do not need to have history tracking as part of it.
Task variables are divided to two types:
- input - that is readonly
- output that can be set multiple times and always overrides previous values
output can be either set when task is active or upon completion.
Both input and output task variables should be "indexed" and available for searches in separate table. Must be always kept up to date with actual values stored in Content table so it must be reindexed (recreated) when ever they change - applies only to output variables as input cannot be changed.
Preferably there should be pluggable mechanism for indexing variables where default should simply use toString method of the object it indexes.