Deleting an Association Link

From within a process, use a Global Data Operations service task to delete an existing association link between two case objects. Association links allow you to navigate from one case object to another, from any process that has access to the case references of the source and destination case objects.

You cannot delete a case object that has an association link to another case object.

Prerequisites

An association link must exist between the source and destination case objects. Local data fields containing case references to the source and destination case objects must already exist.

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 Global Data Operations.
  3. Select Change or Delete Case Object(s) Using Case Reference Field.
  4. In the Case Reference Field, enter the name of the data field that references the source case object from which you want to add the link.
  5. In the Operation field, select Remove Link(s) To Other Case Object(s).
  6. In the Case Class Association field, enter the name of the association link that connects the source case class to the destination case class.
    Content assist displays the association links that are available from the case class referenced in the Case Reference Field.
  7. In the Case Object Reference(s) field, enter the name of the data field that references the destination case object for the specified Case Class Association field.

What to do next

  1. (Optional) Add appropriate error handling to the service task boundary to deal with the following specific errors that may be returned by the Remove Link(s) To Other Case Object(s) operation.
    Error (Error Code) Description Possible solutions
    CaseOutOfSyncError (CaseOutOfSyncError) The source 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.

    1. Re-read the case object.
    2. If necssary, examine the case data to check that no significant changes have occurred.
    3. Retry the Remove Link(s) To Other Case Object(s) operation.
    UserApplicationError (CaseNotFoundError) The source case object referenced from the Case Reference Field does not exist.
    UserApplicationError (NotLinkedError) The link to the destination case object cannot be deleted because it does not exist.
    UserApplicationError (NoTargetsError) The link cannot be deleted because the case reference specified in the Case Object Reference(s) field has a null value.
  2. (Optional) Modify any process that may need to do something if this association link is deleted:
    1. Add a case data signal event to the process, so that the process will be notified when the association link is deleted.
    2. Add suitable business logic to perform any actions that the process needs to take as a result of the association link being deleted.