Hi,
I am trying to filter the tasks based on the property filtration using the below code taken from TaskInstancesGet class. I was able to fetch all the properties whose values are Strings but couldn't fetch the values which are numbers or dates.
if (list_1 != null)
{
for (Object list_2 : list_1)
{
int propQNameEnd = list_2.toString().indexOf('/');
if (propQNameEnd < 1)
{
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("Ignoring invalid property filter:" + list_2.toString());
}
break;
}
String propValue = list_2.toString().substring(propQNameEnd + 1);
if (propValue.isEmpty())
{
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("Ignoring empty property value filter [" + propValue + "]");
}
break;
}
String propQNameStr = list_2.toString().substring(0, propQNameEnd);
QName propertyQName;
try
{
propertyQName = QName.createQName(propQNameStr, namespaceService);
}
catch (Exception ex)
{
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("Ignoring invalid QName property filter [" + propQNameStr + "]");
}
break;
}
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("Filtering with property [" + propertyQName.toPrefixString(namespaceService) + "=" + propValue + "]");
}
propertyFilter.put(propertyQName, propValue);
taskQuery.setProcessCustomProps(propertyFilter);
}
}
Please do check the code and let me know if there are any changes in the above so that i can filter the properties whose values are numbers or dates.
Any help would be appreciated..Thank you!