Content Management and Capture

 View Only
Expand all | Collapse all

Datacap- Modify the Batch's status to Hold or Cancelled Programmatically

  • 1.  Datacap- Modify the Batch's status to Hold or Cancelled Programmatically

    Posted Wed February 05, 2025 02:39 PM
    Edited by Danny Mann Wed February 05, 2025 02:41 PM

    There is an action in the rrunner library named rr_AbortBatch.  This works great if I want to set the batch to aborted.  However, I need to set a batch to hold or cancelled at times.  Is there an action I can utilize to set a batch to those statuses?  Or do I have to execute a SQL statement and update it in the database from within my code?  Any guidance is greatly appreciated. 

    I have tried using things like SetDCOStatus, SetTaskStatus, etc and I either do not know what value to se tthem to or they do not accomplish my goal.



    ------------------------------
    Danny Mann
    ------------------------------



  • 2.  RE: Datacap- Modify the Batch's status to Hold or Cancelled Programmatically

    Posted Thu February 06, 2025 09:12 AM

    I use the Action - SetTaskStatus - If you look at the help/information:

    Method SetTaskStatus : Overrides the final status of the task.

    Syntax:

    bool SetTaskStatus (string TaskStatus)

    Parameters:

    string TaskStatus

    Parameters:

    TaskStatus: An integer value representing the status that the task is to return to User Application. The task statuses are:

    0 : Abort. The batch has encountered a serious error and will not proceed with the next task until it has been reviewed and reset. Subsequent actions will not be run.
    1 : Cancelled. The batch has finished and will not proceed with the next task. Cancelled status can automatically delete the entire batch directory.
    2 : Finished. The batch has finished successfully.
    4 : Hold. The batch is not complete and needs further processing.
    8 : Pending. The batch will stay in the same task and be rerun again from the start of the task.
    Here's a snapshot of how I use it to hold a batch if I have exported the data:


    ------------------------------
    Francis Kuhn
    ------------------------------



  • 3.  RE: Datacap- Modify the Batch's status to Hold or Cancelled Programmatically

    Posted Thu February 06, 2025 09:38 AM

    I like the description that you system gave for it.  Mine for 9.1.5 did not give as much detail.  From your information you put here, I can see why I thought it was not working.  I was setting it to canceled and it was removing the batch from job monitor completely.  I now see why.  That is an undesired result, but I am happy to know the action works.  I didn't want to use hold status, but it does work and it does not delete the batch from job monitor.  Thank you very much



    ------------------------------
    Danny Mann
    ------------------------------