import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.policy.controlloop.drl.legacy.ControlLoopParams;
+import org.onap.policy.controlloop.CanonicalOnset;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.ControlLoopEventStatus;
rule "EVENT"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
not ( ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() ) )
then
// Retract it from memory
//
retract($event);
- } else if ($event.getClosedLoopEventStatus() != ControlLoopEventStatus.ONSET) {
- throw new ControlLoopException($event.getClosedLoopEventStatus() + " received with no prior onset");
} else {
//
// Create an EventManager
rule "GUARD.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName,
- closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(),
rule "APPC.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName,
- closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(),
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
$response : Response($id : getCommonHeader().RequestId )
- not ( VirtualControlLoopEvent( requestId == $id, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) )
+ not ( CanonicalOnset( requestId == $id ) )
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
rule "APPC.LCM.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName,
- closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(),
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
$response : AppcLcmDmaapWrapper($id : getBody().getOutput().getCommonHeader().getRequestId() )
- not ( VirtualControlLoopEvent( requestId == $id, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) )
+ not ( CanonicalOnset( requestId == $id ) )
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
rule "SO.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName,
- closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(),
rule "VFC.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName,
- closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(),
rule "SDNC.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() )
$opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(),
rule "${policyName}.CDS.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(),
- closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $params.getClosedLoopControlName() )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(),
rule "SDNR.RESPONSE"
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
- $event : VirtualControlLoopEvent( closedLoopControlName == $clName,
- closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+ $event : CanonicalOnset( closedLoopControlName == $clName )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(),
requestId == $event.getRequestId() )
$operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(),
when
$params : ControlLoopParams( $clName : getClosedLoopControlName() )
$response : PciResponseWrapper($id : getBody().getCommonHeader().getRequestId )
- not ( VirtualControlLoopEvent( requestId == $id, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) )
+ not ( CanonicalOnset( requestId == $id ) )
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());