I have a simple process that creates a document using a "Content Integration Task" into the IBM BPM Document Store.
"before" this task, I need to "delete" all the previous versions of the document created (created from the already concluded instances of this process). If i run the process 10 times, I will have 10 documents (the same document with different version number). What i need to do is delete all versions of the same document before the new document created.
Below, the mapping of my "document creation" task (the image below can be more descriptive).
Data mapping:
"IBM_BPM_Document" ==> Object type ID (ECMID)
"/" ==> Folder ID (ECMID)
"elencoarticoli" ==> Name (String)
"major" ==> Versioning state (String)
tw.local.prop ==> Properties (List of ECMProperty)
Below, the image that depicts the whole process:
Any suggestion?
You will need to have the previous document IDs before starting to delete.
Maybe you could try to persist the output value of your "document creation" task, then all you have to do is to create a new instance of the same "Content Integration Task" but with "Delete document" as the operation name instead of "Create document".
If persist the IDs is not a option, maybe you could search for the previous IDs using a "Content Integration Task" setting with "Search", passing the documents properties for it. This will work if those properties unique indentify those documents.