bonitasoft find and remove document code example

Example: bonitasoft find and remove document

ProcessAPI processApi = apiAccessor.getProcessAPI();
SearchOptionsBuilder builder = new SearchOptionsBuilder(0,100);
builder.filter(ArchivedDocumentsSearchDescriptor.PROCESSINSTANCE_ID, processInstanceId).and().
filter(ArchivedDocumentsSearchDescriptor.DOCUMENT_NAME, "your_document_name");

SearchResult<ArchivedDocument> results = apiAccessor.getProcessAPI().searchArchivedDocuments(builder.done());

for (ArchivedDocument doc : results.getResult()){
    processApi.deleteContentOfArchivedDocument(doc.id);
}

Tags:

Misc Example