How to count instances of a variable in a group or Assembled Job

Post Reply
RichardStemp
Newbie
Posts: 17
Joined: Tue Jul 21, 2015 2:58 pm

How to count instances of a variable in a group or Assembled Job

Post by RichardStemp »

Workflow example:
Folders containing varying numbers of PDFs are dropped in to workflow and the number of PDFs in the folders are counted.
During flow a suffix of either _OddPages or _EvenPages is added to PDFs. The Odd Pages from each original folder are then grouped and emailed to someone, listing how many there are.

Issue:
I want to be able to have an Assemble Job that waits for X number of '_OddPages' (minus the even pages), before sending an email.
This is quite a large workflow, so don't want to have a time-out to Assemble the Odd Pages, as some PDFs may be left behind. Plus it adds an unnecessary delay in the flow.

Tried numerous different solutions, but always come back to not knowing how many files it's waiting for?
Counting the number of _OddPages and _EvenPages before Ungrouping would solve this. Job.FileCount could be used, but that doesn't include any search variables.

We have the Scripting Module, but not sure how to script for this?

Any suggestions would be very welcome.
Thanks in advance.
Richard
RichardStemp
Newbie
Posts: 17
Joined: Tue Jul 21, 2015 2:58 pm

Re: How to count instances of a variable in a group or Assembled Job

Post by RichardStemp »

Thanks, will download the demo version and give it a try.
Was hoping for a solution that wouldn't cost anything ;)
r.zegwaard
Member
Posts: 93
Joined: Fri Jul 08, 2011 10:31 am
Location: The Netherlands

Re: How to count instances of a variable in a group or Assembled Job

Post by r.zegwaard »

You could write a script which looks at the incomming folder-job.
The script could than iterate over the files in the folder, and using the FileStatistics determine if it's an odd or even document.
Count the odd an even files, and store the values in the private-data of the folder-job.
Then send out the folder-job add use the private-data to wait for the correct number of files.
RichardStemp
Newbie
Posts: 17
Joined: Tue Jul 21, 2015 2:58 pm

Re: How to count instances of a variable in a group or Assembled Job

Post by RichardStemp »

Many thanks for your reply r.zedwaard
Counting odds and evens in a group, then writing to a private data key is exactly what I'm after, but I've not written scripts before.
Richard
Post Reply