SOAP API - doPurgeAudit

The table summarizes the SOAP API - doPurgeAudit.

Request Uses the doPurgeAuditRequest element (from the EventCollectorManagementService schema).
Parameter notes options: The only parameter for this request is a list of options, none of which are themselves mandatory.
  • batchSize: the number of process instances to be deleted before the transaction is committed. This defaults to 100 if not specified.
  • processTemplates: You can specify the process templates to be considered for purging by specifying either their IDs or their names. You can combine both forms of template identification in the same request.

    With either method of identification, each repetition specifies a process template. All data relating to eligible process instances of a specified template is deleted. Which instances are eligible for deletion depends on the setting of threshold.

    If neither form of template identifier is specified, the operation defaults to all templates.

    • processTemplateIdIdentifier: The process template IDs, corresponding to a unique process template name, module name, and module version, can be obtained from proc_tpl_pk in the ec_pe_status database table or from proc_tpl_name in the ec_proc_template table.
    • processTemplateIdName: The name of the process template. If the name is unique throughout the system, it is sufficient identification by itself. If not, you can specify the moduleName and the version of the template to complete a unique identification. You can obtain naming information by calling listProcessTemplates .

      Note that if a process includes sub-processes, you must specify only the main process. Specifying a sub-process name or template ID, either alone or together with the main process, may cause an error.

  • runInBackground: If this option is set to true, the purge takes place in background and the service returns immediately. If false, the service waits for the purge to complete before returning. Defaults to true.
  • threshold: The threshold date before which process instances must have been completed, cancelled, or failed if they are to be eligible to be purged. If this parameter is not specified, the data for all completed, cancelled, and failed process instances will be deleted. The date and time must be in the format defined in Using DateTime Literals.
    2013-02-10T11:34:22.222Z
  • advancedOption: Not used at present.
  • requiredExtendedData: (optional) Use the purgeStatus object. See Purge Audit Status for details
Response Returns a doPurgeAuditResponse element (from the EventCollectorManagementService schema).
 
  • statusMessage: Expands on the status code to provide data about the purge, such as the number of instances deleted. See Purge Audit Status.
  • status: Indicates the status of the purge.
    • If doPurgeAudit is running in background (runInBackground set to true), it immediately returns the status PURGE_IN_PROGRESS, with a message indicating the number of process instances to be purged.
    • If doPurgeAudit is not running in background (runInBackground set to false), it returns one of these statuses:

      PURGE_COMPLETED: The purge has completed successfully.

      PURGE_STOPPED: The purge was stopped manually (typically by the stopPurgeAudit operation) before it completed.

      PURGE_FAILED: The purge has failed because it encountered an error. The stack trace for the failure is reported in the checkPurgeAuditResponse and you can check the BPM.log for more information.

      PURGE_IN_PROGRESS: A purge operation is already in progress. This may because an earlier doPurgeAudit operation is still running in the background.

Example Request:
<soapenv:Body>
  <api:doPurgeAuditRequest>
     <options>
        <batchSize>50</batchSize>
        <runInBackground>true</runInBackground>
        <threshold>2014-02-10T11:34:22.222Z</threshold>
        <processTemplates>
           <processTemplateNameIdentifier>
              <processTemplateName>WelcomeUsers</processTemplateName>
           </processTemplateNameIdentifier>
        </processTemplates>
            <requiredExtendedData>
               <requireAllExtendedData>true</requireAllExtendedData>
            </requiredExtendedData>
     </options>
  </api:doPurgeAuditRequest>
   </soapenv:Body>
Response:
<SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <doPurgeAuditResponse xmlns="http://api.ec.n2.tibco.com">
         <status xmlns="">
            <statusMessage>3 instances matched! Purge operation [EC-PURGE-1375969467578] started successfully! Check BPM Logs for progress!</statusMessage>
            <totalInstanceCount>3</totalInstanceCount>
       <purgeOperationName>EC-PURGE-1375969467578</purgeOperationName>
            <status>PURGE_IN_PROGRESS</status>
         </status>
      </doPurgeAuditResponse>
</SOAP-ENV:Body>