Reciprocal Evidence Implementations

When evidence is inserted, modified or removed a hook point is invoked, that by default triggers the reciprocal evidence handler functionality. This new evidence hook point is called the GlobalEvidenceHook and can be found in the curam.core.sl.infrastructure.impl package. The GlobalEvidenceHook Interface allows custom processing to occur after evidence operations have completed.

GlobalEvidenceHook Interface

The GlobalEvidenceHook interface contains the following methods:

postInsertEvidence is invoked after evidence is inserted and accepts two parameters:

postModifyEvidence is invoked after evidence is modified and accepts two parameters:

postRemoveEvidence is invoked after evidence is removed and accepts two parameters:

postDiscardPendingUpdate is invoked after a pending update of evidence is discarded and accepts two parameters:

postDiscardPendingRemove is invoked after a pending remove of evidence is discarded and accepts two parameters:

Reciprocal Evidence Handler

The default implementation for the GlobalEvidenceHook invokes the reciprocal evidence handler functionality. The reciprocal evidence handler is responsible for all common reciprocal evidence processing. It locates reciprocal evidence and if found performs the same changes on it that were performed on the original evidence. If the reciprocal evidence is not found, and the original evidence was inserted, then it will insert the corresponding reciprocal evidence. As the reciprocal evidence handler is core to the reciprocal evidence processing it cannot be customized directly, but can be customized by way of the GlobalEvidenceHook, if necessary.

Reciprocal Evidence Conversion Interface

The ReciprocalEvidenceConversion interface is responsible for reciprocal and original evidence comparison, participant retrieval and for creating new and modified reciprocal evidence from original evidence. In order to make custom evidence reciprocal, a ReciprocalEvidenceConversion interface implementation must be provided. While the handler is not aware of the internal evidence structure, the conversion interface implementation is, as a result this is where the main customization point lies. The ReciprocalEvidenceConversion interface can be found in the curam.core.sl.infrastructure.impl package and contains the following methods:

The following section demonstrates how to implement reciprocal evidence.