Creating an Association Link

From within a process, use a Global Data Operations service task to link one case object to another. 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.

Prerequisites

An association relationship must exist between the source and destination case classes. 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 Add 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 Add 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 necessary, examine the case data to check that no significant changes have occurred.
    3. Retry the Add Link(s) To Other Case Object(s) operation.
    UserApplicationError (CaseNotFoundError) The source case object referenced from the Case Reference Field does not exist.
    UserApplicationError (AlreadyLinkedError) The link to the destination case object cannot be created because it already exists.
    UserApplicationError (NoTargetsError) The link cannot be created 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 created:
    1. Add a case data signal event to the process, so that the process will be notified when the association link is created.
    2. Add suitable business logic to perform any actions that the process needs to take as a result of the association link being created.