Original Message:
Sent: Mon April 28, 2025 08:16 PM
From: Stephen Weckesser
Subject: Custom Sweep Results Not populating in ACCE
I created a doc then added a sticky note, Both with different storage areas. I did a programmatic search and moved the doc first, then annotations,. This might be easier than trying to do it in multiple sweeps. This does show that the doc move and the anno moves are independent. The storage for annotations is normally static and points to the db by default.
SearchSQL sqlObject = new SearchSQL();
sqlObject.setSelectList( sql_select );
sqlObject.setFromClauseInitialValue( sql_from, SQL_ALIAS, sql_subclass);
sqlObject.setWhereClause(sql_where);
sqlObject.setOrderByClause( "DateCreated");
SearchScope search = new SearchScope(objStore);
DocumentSet objset = (DocumentSet) search.fetchObjects(sqlObject, (int) SQL_PAGESIZE, myFilter, true);
// This can happen if the query times out
PageIterator pageIter= objset.pageIterator();
while (pageIter.nextPage())
{
...
Object[] pageObjects = pageIter.getCurrentPage();
for (int index=0; index < pageObjects.length; index++)
{
....
try {
document.moveContent( targetArea );
if (storePolicy != null)
document.set_StoragePolicy( storePolicy );
document.save( RefreshMode.NO_REFRESH );
AnnotationSet as = document.get_Annotations();
StorageArea AnnoStoreArea = Factory.StorageArea.fetchInstance(objStore, new Id("{863724F2-47C3-C6AB-86C0-967DCCE00000}") , null);
@SuppressWarnings("rawtypes")
Iterator iter2 = as.iterator();
while (iter2.hasNext() )
{
Annotation annObject = (Annotation)iter2.next();
annObject.moveContent( AnnoStoreArea );
annObject.save(RefreshMode.NO_REFRESH); //<-- annotation gets moved to new storage area here
}
}
If you want to do it in the custom sweep be sure to import the anno class.
I haven't tried moving annos with the doc myself yet as they usually live in the db.
importPackage(Packages.com.filenet.api.core,Annotation);
Make sure to add the annotations to the GetRequiredProperties function
public String [] getRequiredProperties() {
String [] names = {PropertyNames.ID};
Object [] annos = {PropertyNames.ANNOTATIONS}; <-- see we don't get API not in cache
return names;
}
And, after you get the ID from the sweep array, add it to the property filter for the doc you're fetching.
You're missing one of those steps so the anno is not in the fetch results. Post the steps from the custom sweep after you get the doc object from the sweep array. try and get the anno from the first element to migrate first before worrying about the report details or multiple content elements. You may have to iterate through the content elements there are multiples.
------------------------------
Stephen Weckesser
Original Message:
Sent: Mon April 28, 2025 02:50 PM
From: Stephen Weckesser
Subject: Custom Sweep Results Not populating in ACCE
Sorry, no answer for you but just thinking it through...
I am not sure you can log a success event.
Are you doing this in the filter event of a job sweep or calling moveContent on a doc object (which gets schedueld and happens
aysnchronously?)
Out of box Sweeps process items (e.g.. docs) sequentially by object_id. There is no sweep jobs that work based on storage area. (this should be a 'enhancement request' since there is good reason to do this (e.g. if you have a local storage area and archive
cloud object store for cool/cold docs).
Anyway. By default annotations use a db store. I am not sure highlights or arrows but annotations can be stored as content elements in named storage areas per the documentation (e.g. the sample uses comments in a text file - think pharmacist notes). Annotations have a many to one relationship to the document. In the document sweep event, you must be enumerating and calling moveContent on the individual annotations. Given the following pseudo logic:
For each annotation in <source doc>.GetAnnotations
annotation.moveContent( NewAnnoStorageArea )
If you call moveContent on a document via the API, it does not happen synchronously but gets queued and executed by the server later. ASSUMING the same happens with annotations, it may not be part of the same doc sweep job and/or there may not have an associated "annotation change" event as there is for documents. If not, you cannot log it (success or not) because there's no event from which to call it. A sweep can take several days dependingon the number of rows in docversion. Sweeps are blocking operations so perhaps the annotation gets moved some time after the document sweep completes? I am just wondering if maybe they do move a few days later.
If I get chance, I will try it.
------------------------------
Stephen Weckesser
Original Message:
Sent: Fri April 25, 2025 10:19 AM
From: Kiran Aithagani
Subject: Custom Sweep Results Not populating in ACCE
RUTH , thank you for writing back, today docs are in storage area A and annotations are in B, wanted to move the docs to C and annotations to D , when I used the out of the box sweep job for documents, it was moving them from A to C, but annotations are still in B. So I had to go with custom sweep.
------------------------------
Kiran Aithagani
Original Message:
Sent: Fri April 25, 2025 10:01 AM
From: RUTH Hildebrand-Lund
Subject: Custom Sweep Results Not populating in ACCE
I'm a little curious about why you are trying to do what you are doing.
There is an OOTB Move sweep that will move the document content to a new/different storage area. The annotations associated with the document do not need to be moved as CPE will automatically know that the annotations belong to a specific document, irrespective of where the document content is.
Where are you storing the annotations today?
------------------------------
RUTH Hildebrand-Lund
Original Message:
Sent: Thu April 24, 2025 01:35 PM
From: Kiran Aithagani
Subject: Custom Sweep Results Not populating in ACCE
I have custom sweep job and action configured to move the documents and annotations on the document together from on storage area to other , as there is no out of box sweep job for doing that, everything works as expected, however ACCE shows Sweep Results if the sweep action handler fails , like the description in the screen shot, but nothing getting populated when it is successful, I have the below code snippet in the custom sweep handler , what do I need to print a message show the line item with the description even when the action handler is successful moving the docs and annotations.
1. When Sweep Handler fails on an item

2. When Sweep Handler is successful

try{
..........
................
System.out.printls(((Long) Thread.currentThread().getId()).toString()+"....Contents moved successfully...");
sweepItems[i].setOutcome(SweepItemOutcome.PROCESSED,"item processed by " + this.getClass().getSimpleName());
}catch (EngineRuntimeException e)
System.out.printls(((Long) Thread.currentThread().getId()).toString()+"....Contents move failed...");
sweepItems[i].setOutcome(SweepItemOutcome.FAILED,"CustomSweepHandler: " + e.getMessage());
}
------------------------------
Kiran Aithagani
------------------------------