Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# Deleting Case Objects by Case Reference

Within a process, you can delete one or more case objects for which you have the identifying case reference(s).

Before you begin

The process must already contain a data field containing either:

- a single case reference to the case object that you want to delete.
- an array of case references to a set of case objects that you want to delete.

If a case object that you want to delete has any association links to other case objects, you must delete those association links before attempting to delete that case object. If any case object has any active links to other case objects, the entire delete operation fails - no case objects is deleted.

Note: Best practice is to avoid deleting case objects at all, but if you must do so, to delete only a single case object using a single case reference. For more information, see Reasons to Avoid Deleting Case Objects.

Procedure
1. Add a service task at an appropriate point in the process.
2. On the General tab of the Properties view, set Service Type to Case Data Operations.
3. Select Change or Delete Case Object(s) Using Case Reference Field.
4. In the Case Reference field, select the data field that contains the case reference(s) that you want to delete.
5. In the Operation field, select Delete Case Object(s).

What to do next

1. (Optional) Add appropriate error handling to the service task boundary to deal with the following specific errors that might be returned by the Delete Case Object(s) operation.

   Error (Error Code) | Description | Possible solutions
   --- | --- | ---
   CaseOutOfSyncError (CaseOutOfSyncError) | A case object referenced from the Case Reference Field has been modified in some way since the field was last populated. That is, the case reference is stale. This could be either a change to the data held in the case object, and/or a change in the object's internal version number. | Re-read the case object. If necessary, examine the case data to check that no significant changes have occurred. Retry the Delete Case Object(s) operation.
   UnsafeToDeleteCaseError (UnsafeToDeleteCaseError) | The case object is referenced by processes other than the one that is attempting to delete the case object, therefore it is unsafe to delete the object. (This error is catchable only if you have specified a single case reference, not an array of case references.) | Do not delete the case object.

2. (Optional) Modify any process that might need to do something if this case object is deleted:
   1. Add a case data signal event to the process, so that the process is notified if the case object is deleted.
   2. Add suitable business logic to perform any actions that the process needs to take as a result of the case object being deleted.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.