The Broadcast Evidence hook is used to route the processing for specific evidence types to their respective create business processes. Here is a sample implementation of the Broadcast Evidence hook which includes comments to clearly describe what needs to be done:
/** * Sample implementation of the Broadcast Evidence hook. */ public abstract class CustomBroadcastEvidence extends custom.evidencebroker.sl.base.CustomBroadcastEvidence { //_____________________________________________________________ /** * Delegates the evidence broadcast through the custom service * layer processing. * * @param sourceDescriptor The source evidence descriptor * @param targetCase The case the evidence is being broadcast * to * @return The evidence descriptor of the broadcast record on * the target case */ public EvidenceDescriptorDtls processBroadcast( EvidenceDescriptorDtls sourceDescriptor, CaseHeaderDtls targetCase) throws AppException, InformationalException { if (sourceDescriptor.evidenceType.equals( CASEEVIDENCE.ALIEN)) { // Read the Alien evidence details (through the service // layer) AlienKey alienKey = new AlienKey(); alienKey.alienID = sourceDescriptor.relatedID; ReturnAlienDetails alienDetails = AlienFactory.newInstance().readAlienDetails(alienKey); // Assign these details to the alien creation struct, // e.g. // Note: a number of assignments may be required here // depending on the number of aggregated structs // within ReturnAlienDetails and CreateAlienDetails CreateAlienDetails createAlienDetails = new CreateAlienDetails(); createAlienDetails.assign(alienDetails); ReturnCreateAlien returnCreateAlien = AlienFactory.newInstance().createAlienEvidence( createAlienDetails, sourceDescriptor, targetCase, true); RelatedIDAndEvidenceTypeKey key = new RelatedIDAndEvidenceTypeKey(); key.relatedID = returnCreateAlien.alienID; key.evidenceType = CASEEVIDENCE.ALIEN; // Read the EvidenceDescriptor and return the details EvidenceDescriptor evidenceDescriptorObj = EvidenceDescriptorFactory.newInstance(); return evidenceDescriptorObj.readByRelatedIDAndType(key); } // null will be returned for all other evidence types return null; } } /** * Delegates the external evidence broadcast through the * custom service layer processing. * * @param descriptorDetails Contains the evidence descriptor * details received from remote system. * @param targetCase Contains the case the evidence is being * broadcast to. * * @return The evidence descriptor of the broadcast record on * the target case. */ public EvidenceDescriptorDtls processExternalBroadcast( SharedEvidenceDescriptorDetails descriptorDetails, CaseHeaderDtls targetCase) throws AppException, InformationalException { if (descriptorDetails.details.evidenceType. equals(CASEEVIDENCE.ALIEN)) { EvidenceDescriptorDtls evidenceDescriptorDtls = EvidenceControllerFactory.newInstance(). shareExternalEvidence(descriptorDetails, targetCase); // Perform Alien evidence specific processing here // . . . // . . . return evidenceDescriptorDtls; } // null will be returned for all other evidence types return null; } /** * Returns the structure with a true value set if the evidence being * passed has been auto accepted onto the target case else false would * be returned. * * @param sourceDescriptor * Contains source evidence descriptor details. * @param targetCase * Contains the case identifier of the evidence is being * broadcast to. * * @return True would be returned if the evidence being passed has * been auto accepted onto the target case else false. */ public EvidenceAutoAcceptanceInd isAutoAccepted( EvidenceDescriptorDtls sourceDescriptor, CaseHeaderDtls targetCase) throws AppException, InformationalException { return null; }