Operation Details
Description: Counts the number of service delivery evaluations either successful or not successful to arrive at the actual value of a custom performance measure for the contract for a particular service. @deprecated since 7.0.0.0, This functionality forms part of a feature that is no longer relevant to the product strategy and will not be replaced.
Sterotype: ns
SQL
SELECT
COUNT(SDEvaluationOutcome.sdEvaluationOutcomeID)
INTO
  :count
FROM  
ContractVersion,
SDEvaluationOutcome,
ContractPOLink,
ProviderOffering

WHERE
 ContractVersion.contractVersionID = :resourceID
 AND ContractVersion.contractVersionID = ContractPOLink.contractVersionID
 AND ProviderOffering.providerOfferingID = ContractPOLink.providerOfferingID
 AND ProviderOffering.serviceOfferingID = :serviceOfferingID
 AND SDEvaluationOutcome.serviceDeliveryEvaluationID
IN
(SELECT ServiceDelivery.serviceDeliveryEvaluationID  from   ServiceDelivery,ContractVersion
 WHERE  ServiceDelivery.serviceOfferingID =:serviceOfferingID
AND
ServiceDelivery.providerID IN(SELECT  ContractVersion.concernRoleID
FROM ContractVersion WHERE  ContractVersion.contractVersionID= :resourceID)

AND
 (
    ServiceDelivery.coverperiodstartdate BETWEEN ContractVersion.startDate 
    AND ContractVersion.endDate
    OR ServiceDelivery.coverperiodenddate BETWEEN ContractVersion.startDate
    AND ContractVersion.endDate
    OR ContractVersion.startDate BETWEEN ServiceDelivery.coverperiodstartdate
    AND  ServiceDelivery.coverperiodenddate
    OR ContractVersion.endDate  BETWEEN ServiceDelivery.coverperiodstartdate
    AND   ServiceDelivery.coverperiodenddate

)
)

AND SDEvaluationOutcome.outcome = :serviceDeliveryEvaluationOutcome
AND SDEvaluationOutcome.recordstatus =  :recordStatusOfSDEvaluationOutcome