07-23-2021 05:26 AM
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!
08-05-2021 10:00 AM
@Wilbert1542 Posting spam is not allowed in the forum
08-06-2021 12:07 AM
You can add like this:
propertyFilter.put(WorkflowModel.PROP_START_DATE, "dateValue");
propertyFilter.put(WorkflowModel.PROP_PRIORITY, "1");
08-31-2021 01:25 AM
Thanks for your reply!
But this can be used to filter out the date of a Workflow
I want to filter the tasks by their start date (Task Start Date)
So, if there's any solution please do provide it.
08-13-2021 02:38 AM
Glad you like it. We have been using this for several weeks now and it seems to be going nicely.
Explore our Alfresco products with the links below. Use labels to filter content by product module.