Armed with the knowledge that
getFilteredJobs() exists, I decided to go back to other parts of our application to use that function instead of the custom resource, which has lead me to encounter a new issue.
In this usage, I only want to retrieve workflow jobs which have a certain attribute (
_parentJobID) set to
null. I expected the following to get me that result, however as you can see from the code & log example below, it's displaying both jobs currently in the system, even though only one of them has
_parentJobID ==
null.
Does setting a process attribute filter to a null value just cancel it, like it does for other filters? Does that mean it's impossible to use
procAttrs in the way I'm trying to below, which is to look for jobs that have a certain process attribute set to
null?
Code: Select all
var procAttrs = {"_parentJobID" : null};
var jobs = api.getFilteredJobs(null, null, null, null, finishedJobs, null, null, null, null, procAttrs, true, false, form.language, system.securityManager.getUserName());
for each (var job in jobs) {
log('Job ID: '+ job.getIdentifier());
log('Parent ID: '+ api.getProcessAttributeValue(job.getIdentifier(), '_parentJobID', ''));
log('Comparison: '+ (api.getProcessAttributeValue(job.getIdentifier(), '_parentJobID', '') === procAttrs._parentJobID));
Code: Select all
Thu Apr 20 15:52:05: INFO Job ID: JOB:SSA_GeneralFormProcess_Comp:1:523
Thu Apr 20 15:52:05: INFO Parent ID: null
Thu Apr 20 15:52:05: INFO Comparison: true
Thu Apr 20 15:52:05: INFO -------
Thu Apr 20 15:52:05: INFO Job ID: JOB:SSA_doorITsysJob:1:254
Thu Apr 20 15:52:05: INFO Parent ID: JOB:SSA_doorITsysApprovals:1:495
Thu Apr 20 15:52:05: INFO Comparison: false
Thu Apr 20 15:52:05: INFO -------