Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  Custom Sweep Results Not populating in ACCE

    Posted 25 days ago
    Edited by Kiran Aithagani 25 days ago

    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
    ------------------------------



  • 2.  RE: Custom Sweep Results Not populating in ACCE

    Posted 25 days ago

    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
    ------------------------------



  • 3.  RE: Custom Sweep Results Not populating in ACCE

    Posted 25 days ago
    Edited by Kiran Aithagani 25 days ago

    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
    ------------------------------



  • 4.  RE: Custom Sweep Results Not populating in ACCE

    Posted 22 days ago

    Hello Krian,
    I agree with Ruth here.
    So far I have had no problems copying annotations to other SAs using the OOTB move sweep. Just recently we used it to merge all annotations on a single SA for a customer.

    I would work with two MoveSweeps here.
    Sweep One to move the documents from Storage A to C and the second sweep job to move the annotation from B to D.

    As Ruth has already mentioned, the document does not care where the annotations are stored

    Regards
    Michael



    ------------------------------
    Michael Pressler
    ------------------------------



  • 5.  RE: Custom Sweep Results Not populating in ACCE

    Posted 22 days ago
    Edited by Kiran Aithagani 22 days ago

     I understand that and agree with both you, when we delete a document it deletes the annotations as well, I expected the same would happen for move too but it does not appear to be the case, also I am not moving all the document classes from A to C and neither all Annotations from B to D at once, I pick one document class (business unit) at a time switch the storage policy the same time so that that business area has nothing to do with the old storage area as far as both documents and their annotations are concerned, the requirement here is, move the documents in a particular document class and annotations on only those documents to new storage areas, the other document classes still be using storage area A for documents and storage area B for Annotations



    ------------------------------
    Kiran Aithagani
    ------------------------------



  • 6.  RE: Custom Sweep Results Not populating in ACCE

    Posted 21 days ago
    Edited by Stephen Weckesser 21 days ago

    ----> the annotatedContentElement was not found in the properties collection

    Be sure to import the Annotations class, put it in names and the pf. 

    ------------------------------
    Stephen Weckesser
    ------------------------------



  • 7.  RE: Custom Sweep Results Not populating in ACCE

    Posted 21 days ago
    Edited by Stephen Weckesser 21 days ago

    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
    ------------------------------



  • 8.  RE: Custom Sweep Results Not populating in ACCE

    Posted 21 days ago

    @Stephen  thank you for confirming that the Annotation move is independent of document migration , I am logging the messages in the custom sweep action anyway so, ACCE results are optional , I was just curious why the successful cases were not writing anything in ACCE, but I appreciate your time



    ------------------------------
    Kiran Aithagani
    ------------------------------



  • 9.  RE: Custom Sweep Results Not populating in ACCE

    Posted 21 days ago

    Yes , I got that and was able to fix that error, but the question was, the results show in ACCE only when there is error, if the Sweep Item gets processed successfully I am not seeing anything and I am wondering if I can force it to print something since I am using a custom sweep action anyway. 



    ------------------------------
    Kiran Aithagani
    ------------------------------