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!
@Wilbert1542 Posting spam is not allowed in the forum
You can add like this:
propertyFilter.put(WorkflowModel.PROP_START_DATE, "dateValue");
propertyFilter.put(WorkflowModel.PROP_PRIORITY, "1");
Glad you like it. We have been using this for several weeks now and it seems to be going nicely.
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.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.