2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
22 package org.openecomp.policy.sim.vfw;
24 import org.openecomp.policy.appc.Request;
26 import org.openecomp.policy.controlloop.ControlLoopEventStatus;
27 import org.openecomp.policy.controlloop.ControlLoopTargetType;
28 import org.openecomp.policy.controlloop.VirtualControlLoopEvent;
30 import org.openecomp.policy.drools.system.PolicyEngine;
36 String WHERE = drools.getRule().getPackage() + "." + drools.getRule().getName();
39 System.out.println(WHERE + ": " + "DCAE[ONSET|" + $onset.requestID + "|" +
40 $onset.dcaeTopic + "] -> PDP-D" );
41 PolicyEngine.manager.deliver($onset.dcaeTopic, $onset.toDcaeOnset());
42 insert(new AppcResponseEvent($onset.requestID.toString(), $onset.appcTopic, $onset.appcResponseCode));
43 } catch (Exception e) {
50 rule "vFWsim.APPC.RESPONSE"
52 $appcResponse : AppcResponseEvent( code > 0 )
53 $request : Request( getCommonHeader().RequestID.toString() == $appcResponse.requestID )
55 String WHERE = drools.getRule().getPackage() + "." + drools.getRule().getName();
58 System.out.println(WHERE + ": " + "APPC[" + $appcResponse.code + "|" + $appcResponse.requestID + "|" +
59 $appcResponse.appcTopic + "] -> PDP-D" );
61 PolicyEngine.manager.deliver($appcResponse.appcTopic,
62 AppcResponseEvent.toResponse($appcResponse.requestID, $appcResponse.code));
63 } catch (Exception e) {
66 retract($appcResponse);