How to remove duplicates from a document

Hi all,

can anyone please tell if there is any built-in service to remove duplicates from a document or from a string.

For example, I have a document list which I have to convert it to flatfile.

But I need to remove the duplicates before converting it to flatfile.

Eg: 1, 2, 1, 2, 1, 3 the result string must be 1,2,3

Can anyone has any logic…Can anyone tell me step by step procedure. If not, any Java program.

Please help…Its really urgent.

Thanks,
David

http://www.kodejava.org/examples/194.html

wm.prt.duplicate:checkDuplicates

Regards!

wm.prt.duplicate:checkDuplicates is for detecting duplicate documents deliver to the process engine, I doubt it will help in detecting duplictae values inside a document.

Afaik there is no build in service for this. Depending on the requirements a Java service like the posted example may help. There could also be a resolution in using xslt or the pub.xml:queryXMLNode service, but I have no working example for that.

A way the pre may help: If the single entries are posted as single documents using a procees with a correlation may be a solution, as documents with a correlation id matchig an existing processed are joined into this or rejected if the process is already finished.

Interesting … This is the first thing off the top of my head, so it may not be the most elegant solution:

1 - sort the DocList with: IDataUtil.sortIDataArrayByKey
2 - LOOP over the sortedDocList and copy to a new sortedUniqueDocList with a copy condition that only copies that document if the newValue is not equal to oldValue.