diff --git a/ONAP-PDP-REST/src/test/resources/client.properties b/ONAP-PDP-REST/src/test/resources/client.properties
new file mode 100644
index 0000000..13aa106
--- /dev/null
+++ b/ONAP-PDP-REST/src/test/resources/client.properties
@@ -0,0 +1,2 @@
+#Don't Change this
+python=test,MASTER
\ No newline at end of file
diff --git a/ONAP-PDP-REST/src/test/resources/fail.xacml.pdp.properties b/ONAP-PDP-REST/src/test/resources/fail.xacml.pdp.properties
new file mode 100644
index 0000000..a16b422
--- /dev/null
+++ b/ONAP-PDP-REST/src/test/resources/fail.xacml.pdp.properties
@@ -0,0 +1,171 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP-PDP-REST
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+# Default XACML Properties File for PDP RESTful servlet
+#
+# Standard API Factories
+#
+xacml.dataTypeFactory=com.att.research.xacml.std.StdDataTypeFactory
+xacml.pdpEngineFactory=com.att.research.xacmlatt.pdp.ATTPDPEngineFactory
+xacml.pepEngineFactory=com.att.research.xacml.std.pep.StdEngineFactory
+# NOT USED SEE BELOW xacml.pipFinderFactory=org.onap.policy.xacml.std.pip.StdPIPFinderFactory
+xacml.traceEngineFactory=com.att.research.xacml.std.trace.LoggingTraceEngineFactory
+#
+# AT&T PDP Implementation Factories
+#
+xacml.att.evaluationContextFactory=com.att.research.xacmlatt.pdp.std.StdEvaluationContextFactory
+xacml.att.combiningAlgorithmFactory=com.att.research.xacmlatt.pdp.std.StdCombiningAlgorithmFactory
+xacml.att.functionDefinitionFactory=org.onap.policy.xacml.custom.OnapFunctionDefinitionFactory
+# NOT USED SEE BELOW xacml.att.policyFinderFactory=org.onap.policy.pdp.std.StdPolicyFinderFactory
+# creteUpdate Policy Implementation Class details. 
+createUpdatePolicy.impl.className=org.onap.policy.pdp.rest.api.services.CreateUpdatePolicyServiceImpl
+# AAF Implementation class details
+aafClient.impl.className=org.onap.policy.utils.AAFPolicyClientImpl
+#
+# AT&T RESTful PDP Implementation Factories
+#
+xacml.pipFinderFactory=org.onap.policy.pdp.rest.impl.XACMLPdpPIPFinderFactory
+xacml.att.policyFinderFactory=org.onap.policy.pdp.rest.XACMLPdpPolicyFinderFactory
+#
+# When set to true, this flag tells the StdPolicyFinderFactory to combined all the root policy files into
+# into one PolicySet and use the given Policy Algorithm.
+#
+xacml.att.policyFinderFactory.combineRootPolicies=urn:com:att:xacml:3.0:policy-combining-algorithm:combined-permit-overrides
+#
+# PDP RESTful API properties
+# 
+# Set this to the address where the XACML-PAP-REST servlet is running
+xacml.rest.pap.url=http://localhost:8070/pap/
+
+#if multiple paps exist, the xacml.rest.pap.url can be removed and they can be defined like this:
+#xacml.rest.pap.urls=http://localhost:9090/pap/,http://localhost:9091/pap/
+
+#
+# Give the running PDP an ID for the PAP. The url that its running as is a good choice.
+# The PAP identifies PDP's using the URL of the PDP.
+#
+xacml.rest.pdp.id=http://localhost:8082/pdp/
+
+# Give the port number used for the PDP
+
+xacml.jmx.port=0
+
+
+# Notification Properties
+# Notifcation type: websocket, ueb or dmaap... if left blank websocket is the default
+NOTIFICATION_TYPE=websocket
+NOTIFICATION_SERVERS=
+NOTIFICATION_TOPIC=
+NOTIFICATION_DELAY=500
+UEB_API_KEY=
+UEB_API_SECRET=
+DMAAP_AAF_LOGIN=test
+DMAAP_AAF_PASSWORD=test
+
+#
+# Set the directory where the PDP holds its Policy Cache and PIP Configuration
+#
+xacml.rest.pdp.config=config
+
+xacml.rest.pdp.webapps=/home/users/PolicyEngine/webapps/ConfigPAP/
+#
+# Initialize register with PAP servlet
+#
+xacml.rest.pdp.register=true
+#
+# Sleep period in seconds between register attempts
+#
+xacml.rest.pdp.register.sleep=15
+#
+# number of attempts to register. -1 means keep trying forever.
+#
+xacml.rest.pdp.register.retries=-1
+#
+# max number of bytes in a POST of a XML/JSON request
+# old value #32767
+xacml.rest.pdp.maxcontent=99999999 
+#
+# Set UserID here
+xacml.rest.pdp.userid=testpdp
+# Set Password here
+xacml.rest.pdp.password=alpha456
+
+# id PAP
+xacml.rest.pap.userid=testpap
+#if multiple paps have different logins, they can be defined like this:
+#http\://localhost\:9090/pap/.xacml.rest.pap.userid=testpap
+
+# pass PAP
+xacml.rest.pap.password=alpha123
+#http\://localhost\:9090/pap/.xacml.rest.pap.password=alpha123
+
+# Delay for Notifications Don't change this. Value in milliSec.  
+xacml.rest.notification.delay=30
+# Buffer Size. 
+REQUEST_BUFFER_SIZE=15
+
+#properties for MySql xacml database:  PLEASE DO NOT REMOVE... NEEDED FOR APIs
+javax.persistence.jdbc.driver=com.mysql.jdbc.Driver
+javax.persistence.jdbc.url=jdbc:mysql://localhost:3306/xacml
+javax.persistence.jdbc.user=policy_user
+javax.persistence.jdbc.password=policy_user
+
+
+#***Properties for IntegrityMonitor integration defined in XACMLRestProperties.java***
+
+#The name of the PDP.  Must be unique across the system
+xacml.rest.pdp.resource.name=site_1.pdp_1
+
+#***Properties for IntegrityMonitor integration defined in IntegrityMonitorProperties.java***
+
+#Interval between forward progress counter updates in seconds
+fp_monitor_interval=30
+
+#Number of forward progress counter failures before failover
+failed_counter_threshold=3
+
+#Interval in seconds between test transactions if there is no other traffic
+test_trans_interval=10
+
+#Interval in seconds between updates of the forward progress counter in the DB
+write_fpc_interval=5
+
+#Name of the site
+site_name=site_1
+
+#Node type
+node_type=pdp_xacml
+
+#Dependency groups are groups of resources upon which a node operational state is dependent upon). 
+#Each group is a comma-separated list of resource names and groups are separated by a semicolon.
+#A group may contain one or more members. Resource names must match the resource names defined
+#in the respective servers' properties files
+dependency_groups=site_1.pdplp_1;site_1.astragw_1;site_1.brmsgw_1
+
+# this can be DEVL, TEST, PROD 
+ENVIRONMENT=DEVL
+xacml.rest.pep.idfile = src/test/resources/client.properties
+
+#AAF Policy Name space
+#Not Mandatory for Open Onap
+policy.aaf.namespace = 
+policy.aaf.resource = 
+#
+DMAAP_AAF_LOGIN =
diff --git a/ONAP-PDP-REST/src/test/resources/pass.xacml.pdp.properties b/ONAP-PDP-REST/src/test/resources/pass.xacml.pdp.properties
new file mode 100644
index 0000000..c9a1110
--- /dev/null
+++ b/ONAP-PDP-REST/src/test/resources/pass.xacml.pdp.properties
@@ -0,0 +1,171 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP-PDP-REST
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+# Default XACML Properties File for PDP RESTful servlet
+#
+# Standard API Factories
+#
+xacml.dataTypeFactory=com.att.research.xacml.std.StdDataTypeFactory
+xacml.pdpEngineFactory=com.att.research.xacmlatt.pdp.ATTPDPEngineFactory
+xacml.pepEngineFactory=com.att.research.xacml.std.pep.StdEngineFactory
+# NOT USED SEE BELOW xacml.pipFinderFactory=org.onap.policy.xacml.std.pip.StdPIPFinderFactory
+xacml.traceEngineFactory=com.att.research.xacml.std.trace.LoggingTraceEngineFactory
+#
+# AT&T PDP Implementation Factories
+#
+xacml.att.evaluationContextFactory=com.att.research.xacmlatt.pdp.std.StdEvaluationContextFactory
+xacml.att.combiningAlgorithmFactory=com.att.research.xacmlatt.pdp.std.StdCombiningAlgorithmFactory
+xacml.att.functionDefinitionFactory=org.onap.policy.xacml.custom.OnapFunctionDefinitionFactory
+# NOT USED SEE BELOW xacml.att.policyFinderFactory=org.onap.policy.pdp.std.StdPolicyFinderFactory
+# creteUpdate Policy Implementation Class details. 
+createUpdatePolicy.impl.className=org.onap.policy.pdp.rest.api.services.CreateUpdatePolicyServiceImpl
+# AAF Implementation class details
+aafClient.impl.className=org.onap.policy.utils.AAFPolicyClientImpl
+#
+# AT&T RESTful PDP Implementation Factories
+#
+xacml.pipFinderFactory=org.onap.policy.pdp.rest.impl.XACMLPdpPIPFinderFactory
+xacml.att.policyFinderFactory=org.onap.policy.pdp.rest.XACMLPdpPolicyFinderFactory
+#
+# When set to true, this flag tells the StdPolicyFinderFactory to combined all the root policy files into
+# into one PolicySet and use the given Policy Algorithm.
+#
+xacml.att.policyFinderFactory.combineRootPolicies=urn:com:att:xacml:3.0:policy-combining-algorithm:combined-permit-overrides
+#
+# PDP RESTful API properties
+# 
+# Set this to the address where the XACML-PAP-REST servlet is running
+xacml.rest.pap.url=http://localhost:8070/pap/
+
+#if multiple paps exist, the xacml.rest.pap.url can be removed and they can be defined like this:
+#xacml.rest.pap.urls=http://localhost:9090/pap/,http://localhost:9091/pap/
+
+#
+# Give the running PDP an ID for the PAP. The url that its running as is a good choice.
+# The PAP identifies PDP's using the URL of the PDP.
+#
+xacml.rest.pdp.id=http://localhost:8082/pdp/
+
+# Give the port number used for the PDP
+
+xacml.jmx.port=0
+
+
+# Notification Properties
+# Notifcation type: websocket, ueb or dmaap... if left blank websocket is the default
+NOTIFICATION_TYPE=websocket
+NOTIFICATION_SERVERS=test
+NOTIFICATION_TOPIC=test
+NOTIFICATION_DELAY=500
+UEB_API_KEY=
+UEB_API_SECRET=
+DMAAP_AAF_LOGIN=test
+DMAAP_AAF_PASSWORD=test
+
+#
+# Set the directory where the PDP holds its Policy Cache and PIP Configuration
+#
+xacml.rest.pdp.config=config
+
+xacml.rest.pdp.webapps=/home/users/PolicyEngine/webapps/ConfigPAP/
+#
+# Initialize register with PAP servlet
+#
+xacml.rest.pdp.register=true
+#
+# Sleep period in seconds between register attempts
+#
+xacml.rest.pdp.register.sleep=15
+#
+# number of attempts to register. -1 means keep trying forever.
+#
+xacml.rest.pdp.register.retries=-1
+#
+# max number of bytes in a POST of a XML/JSON request
+# old value #32767
+xacml.rest.pdp.maxcontent=99999999 
+#
+# Set UserID here
+xacml.rest.pdp.userid=testpdp
+# Set Password here
+xacml.rest.pdp.password=alpha456
+
+# id PAP
+xacml.rest.pap.userid=testpap
+#if multiple paps have different logins, they can be defined like this:
+#http\://localhost\:9090/pap/.xacml.rest.pap.userid=testpap
+
+# pass PAP
+xacml.rest.pap.password=alpha123
+#http\://localhost\:9090/pap/.xacml.rest.pap.password=alpha123
+
+# Delay for Notifications Don't change this. Value in milliSec.  
+xacml.rest.notification.delay=30
+# Buffer Size. 
+REQUEST_BUFFER_SIZE=15
+
+#properties for MySql xacml database:  PLEASE DO NOT REMOVE... NEEDED FOR APIs
+javax.persistence.jdbc.driver=com.mysql.jdbc.Driver
+javax.persistence.jdbc.url=jdbc:mysql://localhost:3306/xacml
+javax.persistence.jdbc.user=policy_user
+javax.persistence.jdbc.password=policy_user
+
+
+#***Properties for IntegrityMonitor integration defined in XACMLRestProperties.java***
+
+#The name of the PDP.  Must be unique across the system
+xacml.rest.pdp.resource.name=site_1.pdp_1
+
+#***Properties for IntegrityMonitor integration defined in IntegrityMonitorProperties.java***
+
+#Interval between forward progress counter updates in seconds
+fp_monitor_interval=30
+
+#Number of forward progress counter failures before failover
+failed_counter_threshold=3
+
+#Interval in seconds between test transactions if there is no other traffic
+test_trans_interval=10
+
+#Interval in seconds between updates of the forward progress counter in the DB
+write_fpc_interval=5
+
+#Name of the site
+site_name=site_1
+
+#Node type
+node_type=pdp_xacml
+
+#Dependency groups are groups of resources upon which a node operational state is dependent upon). 
+#Each group is a comma-separated list of resource names and groups are separated by a semicolon.
+#A group may contain one or more members. Resource names must match the resource names defined
+#in the respective servers' properties files
+dependency_groups=site_1.pdplp_1;site_1.astragw_1;site_1.brmsgw_1
+
+# this can be DEVL, TEST, PROD 
+ENVIRONMENT=DEVL
+xacml.rest.pep.idfile = src/test/resources/client.properties
+
+#AAF Policy Name space
+#Not Mandatory for Open Onap
+policy.aaf.namespace = 
+policy.aaf.resource = 
+#
+DMAAP_AAF_LOGIN =
diff --git a/ONAP-PDP-REST/src/test/resources/test.drl b/ONAP-PDP-REST/src/test/resources/test.drl
new file mode 100644
index 0000000..7accc63
--- /dev/null
+++ b/ONAP-PDP-REST/src/test/resources/test.drl
@@ -0,0 +1,1121 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * archetype-closed-loop-demo-rules
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.controlloop;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.UUID;
+
+import org.onap.policy.controlloop.VirtualControlLoopEvent;
+import org.onap.policy.controlloop.ControlLoopEventStatus;
+import org.onap.policy.controlloop.VirtualControlLoopNotification;
+import org.onap.policy.controlloop.ControlLoopNotificationType;
+import org.onap.policy.controlloop.ControlLoopOperation;
+import org.onap.policy.controlloop.ControlLoopOperationWrapper;
+import org.onap.policy.template.demo.ControlLoopException;
+
+import org.onap.policy.aai.AAINQF199.AAINQF199CloudRegion;
+import org.onap.policy.aai.AAINQF199.AAINQF199ExtraProperties;
+import org.onap.policy.aai.AAINQF199.AAINQF199ExtraProperty;
+import org.onap.policy.aai.AAINQF199.AAINQF199GenericVNF;
+import org.onap.policy.aai.AAINQF199.AAINQF199InstanceFilters;
+import org.onap.policy.aai.AAINQF199.AAINQF199InventoryResponseItem;
+import org.onap.policy.aai.AAINQF199.AAINQF199InventoryResponseItems;
+import org.onap.policy.aai.AAINQF199.AAINQF199Manager;
+import org.onap.policy.aai.AAINQF199.AAINQF199NamedQuery;
+import org.onap.policy.aai.AAINQF199.AAINQF199QueryParameters;
+import org.onap.policy.aai.AAINQF199.AAINQF199Request;
+import org.onap.policy.aai.AAINQF199.AAINQF199RequestWrapper;
+import org.onap.policy.aai.AAINQF199.AAINQF199Response;
+import org.onap.policy.aai.AAINQF199.AAINQF199ResponseWrapper;
+import org.onap.policy.aai.AAINQF199.AAINQF199ServiceInstance;
+import org.onap.policy.aai.AAINQF199.AAINQF199Tenant;
+import org.onap.policy.aai.AAINQF199.AAINQF199VfModule;
+import org.onap.policy.aai.AAINQF199.AAINQF199VServer;
+import org.onap.policy.aai.util.Serialization;
+
+import org.onap.policy.appc.CommonHeader;
+import org.onap.policy.appc.Request;
+import org.onap.policy.appc.Response;
+import org.onap.policy.appc.ResponseCode;
+import org.onap.policy.appc.ResponseStatus;
+import org.onap.policy.appc.ResponseValue;
+
+import org.onap.policy.template.demo.EventManager;
+import org.onap.policy.vnf.trafficgenerator.PGRequest;
+import org.onap.policy.vnf.trafficgenerator.PGStream;
+import org.onap.policy.vnf.trafficgenerator.PGStreams;
+
+import org.onap.policy.mso.MSOManager;
+import org.onap.policy.mso.MSORequest;
+import org.onap.policy.mso.MSORequestStatus;
+import org.onap.policy.mso.MSORequestDetails;
+import org.onap.policy.mso.MSOModelInfo;
+import org.onap.policy.mso.MSOCloudConfiguration;
+import org.onap.policy.mso.MSORequestInfo;
+import org.onap.policy.mso.MSORequestParameters;
+import org.onap.policy.mso.MSORelatedInstanceListElement;
+import org.onap.policy.mso.MSORelatedInstance;
+import org.onap.policy.mso.MSOResponse;
+
+import org.onap.policy.drools.system.PolicyEngine;
+
+//
+// These parameters are required to build the runtime policy
+//
+declare Params
+    closedLoopControlName : String
+    actor : String
+    aaiURL : String
+    aaiUsername : String
+    aaiPassword : String
+    msoURL : String
+    msoUsername : String
+    msoPassword : String
+    aaiNamedQueryUUID : String
+    aaiPatternMatch : int 
+    notificationTopic : String
+    appcTopic : String
+end
+
+/*
+*
+* Called once and only once to insert the parameters into working memory for this Closed Loop policy.
+* (Comment SETUP rule out for the first ONAP opensource release since policy BRMS_GW already puts a Params fact in there)
+*
+*
+*rule "${policyName}.SETUP"
+*	when
+*	then
+*		System.out.println("rule SETUP is triggered.");
+*		Params params = new Params();
+*		params.setClosedLoopControlName("${closedLoopControlName}");
+*		params.setActor("${actor}");
+*		params.setAaiURL("${aaiURL}");
+*		params.setAaiUsername("${aaiUsername}");
+*		params.setAaiPassword("${aaiPassword}");
+*		params.setMsoURL("${msoURL}");
+*		params.setMsoUsername("${msoUsername}");
+*		params.setMsoPassword("${msoPassword}");
+*		params.setAaiNamedQueryUUID("${aaiNamedQueryUUID}");
+*		params.setAaiPatternMatch(${aaiPatternMatch});
+*		params.setNotificationTopic("${notificationTopic}");
+*		params.setAppcTopic("${appcTopic}");
+*		//
+*		// This stays in memory as long as the rule is alive and running
+*		//
+*		insert(params);
+*end
+*/
+/*
+*
+* This rule responds to DCAE Events
+*
+*/
+rule "${policyName}.EVENT"
+	when
+        $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
+        $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+        not ( EventManager( closedLoopControlName == $event.closedLoopControlName ))
+	then
+		System.out.println("rule EVENT is triggered.");
+		try {
+			// 
+			// Check the requestID in the event to make sure it is not null before we create the EventManager. 
+			// The EventManager will do extra syntax checking as well check if the closed loop is disabled/
+			//
+			if ($event.requestID == null) {
+				VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+				notification.notification = ControlLoopNotificationType.REJECTED;
+				notification.from = "policy";
+				notification.message = "Missing requestID from DCAE event";
+				notification.policyName = drools.getRule().getName();
+				notification.policyScope = "${policyScope}";
+				notification.policyVersion = "${policyVersion}";
+				//
+				// Let interested parties know
+				//
+				try {
+					System.out.println(Serialization.gsonPretty.toJson(notification));
+					PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+				} catch (Exception e) {
+					e.printStackTrace();
+					System.out.println("Can't deliver notification: " + notification);
+				}
+				//
+				// Retract it from memory
+				//
+				retract($event);
+				System.out.println("Event with requestID=null has been retracted.");
+			} else {
+				//
+				// Create an EventManager
+				//
+				EventManager manager = new EventManager($params.getClosedLoopControlName(), $event.requestID, $event.target);
+				//
+				// Determine if EventManager can actively process the event (i.e. syntax)
+				//
+				VirtualControlLoopNotification notification = manager.activate($event);
+				notification.from = "policy"; 
+				notification.policyName = drools.getRule().getName();
+				notification.policyScope = "${policyScope}";
+				notification.policyVersion = "${policyVersion}";
+				//
+				// Are we actively pursuing this event?
+				//
+				if (notification.notification == ControlLoopNotificationType.ACTIVE) {
+					//
+					// Insert Event Manager into memory, this will now kick off processing.
+					//
+					insert(manager);
+					//
+					// Let interested parties know
+					//
+					try {
+						System.out.println(Serialization.gsonPretty.toJson(notification));
+						PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+					} catch (Exception e) {
+						e.printStackTrace();
+						System.out.println("Can't deliver notification: " + notification);
+					}		
+				} else {
+					//
+					// Let interested parties know
+					//
+					try {
+						System.out.println(Serialization.gsonPretty.toJson(notification));
+						PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+					} catch (Exception e) {
+						e.printStackTrace();
+						System.out.println("Can't deliver notification: " + notification);
+					}
+					//
+					// Retract it from memory
+					//
+					retract($event);
+				}
+				//
+				// Now that the manager is inserted into Drools working memory, we'll wait for
+				// another rule to fire in order to continue processing. This way we can also
+				// then screen for additional ONSET and ABATED events for this same RequestIDs 
+				// and for different RequestIDs but with the same closedLoopControlName and target.
+				//
+			}
+		//
+		} catch (Exception e) {
+			e.printStackTrace();
+			VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+			notification.notification = ControlLoopNotificationType.REJECTED;
+			notification.message = "Exception occurred " + e.getMessage();
+			notification.policyName = drools.getRule().getName();
+			notification.policyScope = "${policyScope}";
+			notification.policyVersion = "${policyVersion}";
+			//
+			//
+			//
+			try {
+				System.out.println(Serialization.gsonPretty.toJson(notification));
+				PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+			} catch (Exception e1) {
+				System.out.println("Can't deliver notification: " + notification);
+				e1.printStackTrace();
+			}
+			//
+			// Retract the event
+			//
+			retract($event);
+		}
+end
+
+/*
+*
+* This rule happens when we got a valid ONSET, closed loop is enabled and an Event Manager
+* is created. We can start the operations for this closed loop.
+*
+*/
+rule "${policyName}.EVENT.MANAGER"
+	when
+		$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
+		$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+		$manager : EventManager( closedLoopControlName == $event.closedLoopControlName, controlLoopResult == null)
+	then
+		System.out.println("rule EVENT.MANAGER is triggered.");
+		//
+		// Check which event this is.
+		//
+		EventManager.NEW_EVENT_STATUS eventStatus = $manager.onNewEvent($event);
+		//
+		// We only want the initial ONSET event in memory,
+		// all the other events need to be retracted to support
+		// cleanup and avoid the other rules being fired for this event.
+		//
+		if (eventStatus != EventManager.NEW_EVENT_STATUS.FIRST_ONSET) {
+			System.out.println("Retracting "+eventStatus+" Event.");
+			retract($event);
+			return;
+		}
+		//
+		// Now the event in memory is first onset event
+		//
+		try {
+			//
+			// Pull the known AAI field from the Event
+			//
+			// generic-vnf is needed for vFirewall case
+			// vserver-name is needed for vLoadBalancer case
+			//
+			String genericVNF = $event.AAI.get("generic-vnf.vnf-id");
+			String vserver = $event.AAI.get("vserver.vserver-name");
+			//
+			// Check if we are implementing a simple pattern match.
+			//
+			if ($params.getAaiPatternMatch() == 1) {
+				//
+				// Yes
+				//
+				//Basic naming characteristics:
+				//VF Name (9 char)+VM name (13 char total)+VFC (19 char total)
+				//Example: 
+				//VF Name (9 characters):    cscf0001v
+				//VM Name(13 characters): cscf0001vm001
+				//VFC name(19 characters): cscf0001vm001cfg001
+				//
+				// zdfw1fwl01fwl02 or zdfw1fwl01fwl01  
+				// replaced with
+				// zdfw1fwl01pgn02 or zdfw1fwl01pgn01
+				//
+				int index = genericVNF.lastIndexOf("fwl");
+				if (index == -1) {
+					System.err.println("The generic-vnf.vnf-id from DCAE Event is not valid.");
+				} else {
+					genericVNF = genericVNF.substring(0, index) + "pgn" + genericVNF.substring(index+"fwl".length());
+				}
+				//
+				// Construct an APPC request
+				//
+				ControlLoopOperation operation = new ControlLoopOperation();
+				operation.actor = $params.getActor();
+				operation.operation = "ModifyConfig";
+				operation.target = $event.target;
+				//
+				// Create operationWrapper
+				//
+				ControlLoopOperationWrapper operationWrapper = new ControlLoopOperationWrapper($event.requestID, operation);
+				//
+				// insert operationWrapper into memory
+				//
+				insert(operationWrapper);
+				//
+				Request request = new Request();
+				request.CommonHeader = new CommonHeader();
+				request.CommonHeader.RequestID = $event.requestID;
+				request.Action = operation.operation;
+				request.Payload = new HashMap<String, Object>();
+				//
+				// Fill in the payload
+				//
+				request.Payload.put("generic-vnf.vnf-id", genericVNF);
+				//
+				PGRequest pgRequest = new PGRequest();
+				pgRequest.pgStreams = new PGStreams();
+				
+				PGStream pgStream;
+				for(int i = 0; i < 5; i++){
+					pgStream = new PGStream();
+					pgStream.streamId = "fw_udp"+(i+1);
+					pgStream.isEnabled = "true";
+					pgRequest.pgStreams.pgStream.add(pgStream);
+				}
+				request.Payload.put("pg-streams", pgRequest.pgStreams);
+				
+				if (request != null) {
+					//
+					// Insert request into memory
+					//
+					insert(request);
+					//
+					// Tell interested parties we are performing this Operation
+					//
+					VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+					notification.notification = ControlLoopNotificationType.OPERATION;
+					// message and history ??
+					notification.from = "policy";
+					notification.policyName = drools.getRule().getName();
+					notification.policyScope = "${policyScope}";
+					notification.policyVersion = "${policyVersion}";
+					try {
+						System.out.println(Serialization.gsonPretty.toJson(notification));
+						PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+					} catch (Exception e) {
+						System.out.println("Can't deliver notification: " + notification);
+						e.printStackTrace();
+					}
+					//
+					// Now send the operation request
+					//
+					if (request instanceof Request) {
+						try {
+							System.out.println("APPC request sent:");
+							System.out.println(Serialization.gsonPretty.toJson(request));
+							PolicyEngine.manager.deliver($params.getAppcTopic(), request);
+						} catch (Exception e) {
+							e.printStackTrace();
+							System.out.println("Can't deliver request: " + request);
+						}
+					}
+				} else {
+					//
+					// what happens if it is null
+					//
+				}
+				//
+			} else {
+				//
+				// create AAI named-query request with UUID started with "F199"
+				//
+				AAINQF199Request aainqf199request = new AAINQF199Request();
+				AAINQF199QueryParameters aainqf199queryparam = new AAINQF199QueryParameters();
+				AAINQF199NamedQuery aainqf199namedquery = new AAINQF199NamedQuery();
+				AAINQF199InstanceFilters aainqf199instancefilter = new AAINQF199InstanceFilters();
+				//
+				// queryParameters
+				//
+				aainqf199namedquery.namedQueryUUID = UUID.fromString($params.getAaiNamedQueryUUID()); 
+				aainqf199queryparam.namedQuery = aainqf199namedquery;
+				aainqf199request.queryParameters = aainqf199queryparam;
+				//
+				// instanceFilters
+				//
+				Map aainqf199instancefiltermap = new HashMap();
+				Map aainqf199instancefiltermapitem = new HashMap();
+				aainqf199instancefiltermapitem.put("vserver-name", vserver); 
+				aainqf199instancefiltermap.put("vserver", aainqf199instancefiltermapitem);
+				aainqf199instancefilter.instanceFilter.add(aainqf199instancefiltermap);
+				aainqf199request.instanceFilters = aainqf199instancefilter;
+				//
+				// print aainqf199request for debug
+				//
+				System.out.println("AAI Request sent:");
+				System.out.println(Serialization.gsonPretty.toJson(aainqf199request));
+				//
+				// Create AAINQF199RequestWrapper
+				//
+				AAINQF199RequestWrapper aainqf199RequestWrapper = new AAINQF199RequestWrapper($event.requestID, aainqf199request);
+				//
+				// insert aainqf199request into memory
+				//
+				insert(aainqf199RequestWrapper);
+			}
+			//
+		} catch (Exception e) {
+		 e.printStackTrace();
+		}
+end
+
+/*
+*
+* This rule happens when we got a valid ONSET, closed loop is enabled, an Event Manager
+* is created, AAI Manager and AAI Request are ready in memory. We can start sending query to AAI and then wait for response.
+*
+*/
+rule "${policyName}.EVENT.MANAGER.AAINQF199REQUEST"
+	when
+		$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
+		$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+		$manager : EventManager( closedLoopControlName == $event.closedLoopControlName )
+		$aainqf199RequestWrapper : AAINQF199RequestWrapper(requestID == $event.requestID)
+	then
+		System.out.println("rule EVENT.MANAGER.AAINQF199REQUEST is triggered.");
+		//
+		// send the request
+		//
+		AAINQF199Response aainqf199response = AAINQF199Manager.postQuery($params.getAaiURL(), $params.getAaiUsername(), $params.getAaiPassword(),
+													   $aainqf199RequestWrapper.aainqf199request, $event.requestID);
+		//
+		// Check AAI response
+		//
+		if (aainqf199response == null) {
+			System.err.println("Failed to get AAI response");
+			//
+			// Fail and retract everything
+			//
+			retract($event);
+			retract($manager);
+			retract($aainqf199RequestWrapper);
+		} else {
+			//
+			// Create AAINQF199ResponseWrapper
+			//
+			AAINQF199ResponseWrapper aainqf199ResponseWrapper = new AAINQF199ResponseWrapper($event.requestID, aainqf199response);
+			//
+			// insert aainqf199ResponseWrapper to memeory
+			//
+			insert(aainqf199ResponseWrapper);
+		}
+end
+
+/*
+*
+* This rule happens when we got a valid AAI response. We can start sending request to APPC or MSO now.
+*
+*/
+rule "${policyName}.EVENT.MANAGER.AAINQF199RESPONSE"
+	when 
+		$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
+		$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+		$manager : EventManager( closedLoopControlName == $event.closedLoopControlName )
+		$aainqf199RequestWrapper : AAINQF199RequestWrapper(requestID == $event.requestID)
+		$aainqf199ResponseWrapper : AAINQF199ResponseWrapper(requestID == $event.requestID)
+	then
+		System.out.println("rule EVENT.MANAGER.AAINQF199RESPONSE is triggered.");
+		//
+		// Extract related fields out of AAINQF199RESPONSE
+		//
+		String vnfItemVnfId, vnfItemVnfType, vnfItemPersonaModelId, vnfItemPersonaModelVersion, vnfItemModelName, 
+		       vnfItemModelVersion, vnfItemModelNameVersionId, serviceItemServiceInstanceId, serviceItemPersonaModelId,
+		       serviceItemModelName, serviceItemModelType, serviceItemModelVersion, serviceItemModelNameVersionId,
+		       vfModuleItemVfModuleName, vfModuleItemPersonaModelId, vfModuleItemPersonaModelVersion, vfModuleItemModelName, 
+		       vfModuleItemModelNameVersionId, tenantItemTenantId, cloudRegionItemCloudRegionId;
+		try {
+			//
+			// vnfItem
+			//
+			vnfItemVnfId = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).genericVNF.vnfID;
+			vnfItemVnfType = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).genericVNF.vnfType;
+			vnfItemVnfType = vnfItemVnfType.substring(vnfItemVnfType.lastIndexOf("/")+1);
+			vnfItemPersonaModelId = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).genericVNF.personaModelId;
+			vnfItemPersonaModelVersion = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).genericVNF.personaModelVersion;
+			vnfItemModelName = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).extraProperties.extraProperty.get(0).propertyValue;
+			vnfItemModelVersion = 		$aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).extraProperties.extraProperty.get(2).propertyValue;
+			vnfItemModelNameVersionId = 	$aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).extraProperties.extraProperty.get(4).propertyValue;
+			//
+			// serviceItem
+			//
+			serviceItemServiceInstanceId = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).serviceInstance.serviceInstanceID;
+			serviceItemPersonaModelId = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).serviceInstance.personaModelId;
+			serviceItemModelName = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).extraProperties.extraProperty.get(0).propertyValue;
+			serviceItemModelType = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).extraProperties.extraProperty.get(1).propertyValue;
+			serviceItemModelVersion = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).serviceInstance.personaModelVersion;
+			serviceItemModelNameVersionId = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).extraProperties.extraProperty.get(4).propertyValue;
+			//
+			// Find the index for base vf module and non-base vf module
+			//
+			int baseIndex = -1;
+			int nonBaseIndex = -1;
+			List<AAINQF199InventoryResponseItem> inventoryItems = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems;
+			for (AAINQF199InventoryResponseItem m : inventoryItems) {
+				if (m.vfModule != null && m.vfModule.isBaseVfModule == true) {
+					baseIndex = inventoryItems.indexOf(m);
+				} else if (m.vfModule != null && m.vfModule.isBaseVfModule == false && m.vfModule.orchestrationStatus == null) {
+					nonBaseIndex = inventoryItems.indexOf(m);
+				}
+				//
+				if (baseIndex != -1 && nonBaseIndex != -1) {
+					break;
+				}
+			}
+			//
+			// Report the error if either base vf module or non-base vf module is not found
+			//
+			if (baseIndex == -1 || nonBaseIndex == -1) {
+				System.err.println("Either base or non-base vf module is not found from AAI response.");
+				retract($aainqf199RequestWrapper);
+				retract($aainqf199ResponseWrapper);
+				retract($manager);
+				retract($event);
+				return;
+			}
+			//
+			// This comes from the base module
+			//
+			vfModuleItemVfModuleName = 			$aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(baseIndex).vfModule.vfModuleName;
+			vfModuleItemVfModuleName = vfModuleItemVfModuleName.replace("Vfmodule", "vDNS");
+			//
+			// vfModuleItem - NOT the base module
+			//
+			vfModuleItemPersonaModelId = 		$aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).vfModule.personaModelId;
+			vfModuleItemPersonaModelVersion = 	$aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).vfModule.personaModelVersion;
+			vfModuleItemModelName = 			$aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).extraProperties.extraProperty.get(0).propertyValue;
+			vfModuleItemModelNameVersionId = 	$aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).extraProperties.extraProperty.get(4).propertyValue;
+			//
+			// tenantItem
+			//
+			tenantItemTenantId = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(1).tenant.tenantId;
+			//
+			// cloudRegionItem
+			//
+			cloudRegionItemCloudRegionId = $aainqf199ResponseWrapper.aainqf199response.inventoryResponseItems.get(0).items.inventoryResponseItems.get(1).items.inventoryResponseItems.get(0).cloudRegion.cloudRegionId;
+			//
+		} catch (Exception e) {
+			e.printStackTrace();
+			VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+			notification.notification = ControlLoopNotificationType.REJECTED;
+			notification.message = "Exception occurred " + e.getMessage();
+			notification.policyName = drools.getRule().getName();
+			notification.policyScope = "${policyScope}";
+			notification.policyVersion = "${policyVersion}";
+			//
+			try {
+				System.out.println(Serialization.gsonPretty.toJson(notification));
+				PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+			} catch (Exception e1) {
+				System.out.println("Can't deliver notification: " + notification);
+				e1.printStackTrace();
+			}
+			//
+			notification.notification = ControlLoopNotificationType.FINAL_FAILURE;
+			notification.message = "Invalid named-query response from AAI";
+            //
+            try {
+            	System.out.println(Serialization.gsonPretty.toJson(notification));
+                PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+            } catch (Exception e1) {
+                System.out.println("Can't deliver notification: " + notification);
+                e1.printStackTrace();
+            }
+			//
+			// Retract everything
+			//
+			retract($aainqf199RequestWrapper);
+			retract($aainqf199ResponseWrapper);
+			retract($manager);
+			retract($event);
+			return;
+		}	
+		//
+		// Extracted fields should not be null
+		//
+		if ((vnfItemVnfId == null) || (vnfItemVnfType == null) ||
+		    (vnfItemPersonaModelId == null) || (vnfItemModelName == null) ||
+		    (vnfItemModelVersion == null) || (vnfItemModelNameVersionId == null) ||
+		    (serviceItemServiceInstanceId == null) || (serviceItemModelName == null) ||
+		    (serviceItemModelType == null) || (serviceItemModelVersion == null) ||
+		    (serviceItemModelNameVersionId == null) || (vfModuleItemVfModuleName == null) ||
+		    (vfModuleItemPersonaModelId == null) || (vfModuleItemPersonaModelVersion == null) ||
+		    (vfModuleItemModelName == null) || (vfModuleItemModelNameVersionId == null) ||
+		    (tenantItemTenantId == null) || (cloudRegionItemCloudRegionId == null)) {
+			//
+			System.err.println("some fields are missing from AAI response.");
+			//
+			// Fail and retract everything
+			//
+			retract($aainqf199RequestWrapper);
+			retract($aainqf199ResponseWrapper);
+			retract($manager);
+			retract($event);
+			return;
+		}
+		//
+		// We don't need them any more
+		//
+		retract($aainqf199ResponseWrapper);
+		retract($aainqf199RequestWrapper);  
+		//
+		// check the actor of this closed loop
+		//
+		switch ($params.getActor()) {
+			case "APPC":
+			{
+				//
+				// Construct an APPC request
+				//
+				ControlLoopOperation operation = new ControlLoopOperation();
+				operation.actor = $params.getActor();
+				operation.operation = "ModifyConfig";
+				operation.target = $event.target;
+				//
+				// Create operationWrapper
+				//
+				ControlLoopOperationWrapper operationWrapper = new ControlLoopOperationWrapper($event.requestID, operation);
+				//
+				// insert operationWrapper into memory
+				//
+				insert(operationWrapper);
+				//
+				Request request = new Request();
+				request.CommonHeader = new CommonHeader();
+				request.CommonHeader.RequestID = $event.requestID;
+				request.Action = operation.operation;
+				request.Payload = new HashMap<String, Object>();
+				//
+				// Fill in the payload
+				// Hardcode genericVNF for now since AAI has not been ready for vFirewall demo case
+				//
+				String genericVNF = "zdfw1fwl01pgn02";
+				request.Payload.put("generic-vnf.vnf-id", genericVNF);
+				//
+				PGRequest pgRequest = new PGRequest();
+				pgRequest.pgStreams = new PGStreams();
+				
+				PGStream pgStream;
+				for(int i = 0; i < 5; i++){
+					pgStream = new PGStream();
+					pgStream.streamId = "fw_udp"+(i+1);
+					pgStream.isEnabled = "true";
+					pgRequest.pgStreams.pgStream.add(pgStream);
+				}
+				request.Payload.put("pg-streams", pgRequest.pgStreams);
+				
+				if (request != null) {
+					//
+					// Insert request into memory
+					//
+					insert(request);
+					//
+					// Tell interested parties we are performing this Operation
+					//
+					VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+					notification.notification = ControlLoopNotificationType.OPERATION;
+					// message and history ??
+					notification.from = "policy";
+					notification.policyName = drools.getRule().getName();
+					notification.policyScope = "${policyScope}";
+					notification.policyVersion = "${policyVersion}";
+					try {
+						System.out.println(Serialization.gsonPretty.toJson(notification));
+						PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+					} catch (Exception e) {
+						System.out.println("Can't deliver notification: " + notification);
+						e.printStackTrace();
+					}
+					//
+					// Now send the operation request
+					//
+					if (request instanceof Request) {
+						try {
+							System.out.println("APPC request sent:");
+							System.out.println(Serialization.gsonPretty.toJson(request));
+							PolicyEngine.manager.deliver($params.getAppcTopic(), request);
+						} catch (Exception e) {
+							e.printStackTrace();
+							System.out.println("Can't deliver request: " + request);
+						}
+					}
+				} else {
+					//
+					// what happens if it is null
+					//
+				}
+			}
+			break;
+			case "MSO":
+			{
+				//
+				// Construct an operation
+				//
+				ControlLoopOperation operation = new ControlLoopOperation();
+				operation.actor = $params.getActor();
+				operation.operation = "createModuleInstance";
+				operation.target = $event.target;
+				//
+				// Create operationWrapper
+				//
+				ControlLoopOperationWrapper operationWrapper = new ControlLoopOperationWrapper($event.requestID, operation);
+				//
+				// Construct an MSO request
+				//
+				MSORequest request = new MSORequest();
+				request.requestDetails = new MSORequestDetails();
+				request.requestDetails.modelInfo = new MSOModelInfo();
+				request.requestDetails.cloudConfiguration = new MSOCloudConfiguration();
+				request.requestDetails.requestInfo = new MSORequestInfo();
+				request.requestDetails.requestParameters = new MSORequestParameters();
+				request.requestDetails.requestParameters.userParams = null;
+				//
+				// cloudConfiguration
+				//
+				request.requestDetails.cloudConfiguration.lcpCloudRegionId = cloudRegionItemCloudRegionId;
+				request.requestDetails.cloudConfiguration.tenantId = tenantItemTenantId;
+				//
+				// modelInfo
+				//
+				request.requestDetails.modelInfo.modelType = "vfModule";
+				request.requestDetails.modelInfo.modelInvariantId = vfModuleItemPersonaModelId;
+				request.requestDetails.modelInfo.modelNameVersionId = vfModuleItemModelNameVersionId;
+				request.requestDetails.modelInfo.modelName = vfModuleItemModelName;
+				request.requestDetails.modelInfo.modelVersion = vfModuleItemPersonaModelVersion;
+				//
+				// requestInfo
+				//
+				request.requestDetails.requestInfo.instanceName = vfModuleItemVfModuleName;
+				request.requestDetails.requestInfo.source = "POLICY";
+				request.requestDetails.requestInfo.suppressRollback = false;
+				//
+				// relatedInstanceList
+				//
+				MSORelatedInstanceListElement relatedInstanceListElement1 = new MSORelatedInstanceListElement();
+				MSORelatedInstanceListElement relatedInstanceListElement2 = new MSORelatedInstanceListElement();
+				relatedInstanceListElement1.relatedInstance = new MSORelatedInstance();
+				relatedInstanceListElement2.relatedInstance = new MSORelatedInstance();
+				//
+				relatedInstanceListElement1.relatedInstance.instanceId = serviceItemServiceInstanceId;
+				relatedInstanceListElement1.relatedInstance.modelInfo = new MSOModelInfo();
+				relatedInstanceListElement1.relatedInstance.modelInfo.modelType = "service";
+				relatedInstanceListElement1.relatedInstance.modelInfo.modelInvariantId = serviceItemPersonaModelId;
+				relatedInstanceListElement1.relatedInstance.modelInfo.modelNameVersionId = serviceItemModelNameVersionId;
+				relatedInstanceListElement1.relatedInstance.modelInfo.modelName = serviceItemModelName;
+				relatedInstanceListElement1.relatedInstance.modelInfo.modelVersion = serviceItemModelVersion;
+				//
+				relatedInstanceListElement2.relatedInstance.instanceId = vnfItemVnfId;
+				relatedInstanceListElement2.relatedInstance.modelInfo = new MSOModelInfo();
+				relatedInstanceListElement2.relatedInstance.modelInfo.modelType = "vnf";
+				relatedInstanceListElement2.relatedInstance.modelInfo.modelInvariantId = vnfItemPersonaModelId;
+				relatedInstanceListElement2.relatedInstance.modelInfo.modelNameVersionId = vnfItemModelNameVersionId;
+				relatedInstanceListElement2.relatedInstance.modelInfo.modelName = vnfItemModelName;
+				relatedInstanceListElement2.relatedInstance.modelInfo.modelVersion = vnfItemModelVersion;
+				relatedInstanceListElement2.relatedInstance.modelInfo.modelCustomizationName = vnfItemVnfType;
+				//	
+				request.requestDetails.relatedInstanceList.add(relatedInstanceListElement1);
+				request.requestDetails.relatedInstanceList.add(relatedInstanceListElement2);
+				//
+				// print MSO request for debug
+				//
+				System.out.println("MSO request sent:");
+				System.out.println(Serialization.gsonPretty.toJson(request));
+				//
+				//
+				//
+				if (request != null) {
+					//
+					// Tell interested parties we are performing this Operation
+					//
+					VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+					notification.notification = ControlLoopNotificationType.OPERATION;
+					notification.from = "policy";
+					notification.policyName = drools.getRule().getName();
+					notification.policyScope = "${policyScope}";
+					notification.policyVersion = "${policyVersion}";
+					try {
+						System.out.println(Serialization.gsonPretty.toJson(notification));
+						PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+					} catch (Exception e) {
+						System.out.println("Can't deliver notification: " + notification);
+						e.printStackTrace();
+					}
+					//
+					// Concatenate serviceItemServiceInstanceId and vnfItemVnfId to msoURL
+					//
+					String MSOUrl = $params.getMsoURL() + "/serviceInstances/v2/" + serviceItemServiceInstanceId + "/vnfs/" + vnfItemVnfId + "/vfModules";
+					//
+					// Call MSO
+					//
+					MSOResponse response = MSOManager.createModuleInstance(MSOUrl, $params.getMsoURL(), $params.getMsoUsername(), $params.getMsoPassword(), request);
+					//
+					if (response != null) {
+						//
+						// Assign requestId
+						//
+						request.requestId = $event.requestID.toString();						
+						response.request.requestId = $event.requestID.toString();
+						//
+						// Insert facts
+						//
+						insert(operationWrapper);
+						insert(request);
+						insert(response);
+					} else {
+						//
+						// MSO request not even accepted
+						//
+						notification.message = operationWrapper.operation.toMessage();
+						operationWrapper.operation.message = operationWrapper.operation.toMessage();
+						operationWrapper.operation.outcome = "FAILURE_EXCEPTION";
+						$manager.setControlLoopResult("FAILURE_EXCEPTION");
+						notification.history.add(operationWrapper.operation);
+						notification.notification = ControlLoopNotificationType.OPERATION_FAILURE;
+						//
+						// Let interested parties know
+						//
+						try {
+							System.out.println(Serialization.gsonPretty.toJson(notification));
+							PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+						} catch (Exception e) {
+							System.out.println("Can't deliver notification: " + notification);
+							e.printStackTrace();
+						}
+	                    notification.notification = ControlLoopNotificationType.FINAL_FAILURE;
+                        try {
+                        	System.out.println(Serialization.gsonPretty.toJson(notification));
+                        	PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+                        } catch (Exception e) {
+                        	System.out.println("Can't deliver notification: " + notification);
+                        	e.printStackTrace();
+                        }
+						//
+						// Retract everything
+						//
+						retract($event);
+						retract($manager);
+					}
+				} else {
+					System.err.println("constructed MSO request is invalid.");
+				}
+			}
+			break; 
+		} 
+end
+		
+/*
+*
+* This rule responds to APPC Response Events
+*
+*/
+rule "${policyName}.APPC.RESPONSE"
+	when
+		$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
+		$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+		$manager : EventManager( closedLoopControlName == $event.closedLoopControlName )
+		$operationWrapper : ControlLoopOperationWrapper( requestID == $event.requestID )
+		$request : Request( getCommonHeader().RequestID == $event.requestID )
+		$response : Response( getCommonHeader().RequestID == $event.requestID )	
+	then
+		System.out.println("rule APPC.RESPONSE is triggered.");
+		if ($response.Status == null) {
+			$operationWrapper.operation.outcome = "FAILURE_EXCEPTION";
+			$manager.setControlLoopResult("FAILURE_EXCEPTION");
+		} 
+		//
+		// Get the Response Code
+		//
+		ResponseCode code = ResponseCode.toResponseCode($response.Status.Code);
+		if (code == null) {
+			$operationWrapper.operation.outcome = "FAILURE_EXCEPTION";
+			$manager.setControlLoopResult("FAILURE_EXCEPTION");
+		}
+		//
+		// Construct notification
+		//
+		VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+		notification.from = "policy";
+		notification.policyName = drools.getRule().getName();
+		notification.policyScope = "${policyScope}";
+		notification.policyVersion = "${policyVersion}";
+		notification.message = $operationWrapper.operation.toMessage();
+		$operationWrapper.operation.message = $operationWrapper.operation.toMessage();
+		//
+		// Ok, let's figure out what APP-C's response is
+		//
+		switch (code) {
+			case ACCEPT:
+				$operationWrapper.operation.outcome = "PROCESSING";
+				break;
+			case ERROR:
+			case REJECT:
+				$operationWrapper.operation.outcome = "FAILURE_EXCEPTION";
+				$manager.setControlLoopResult("FAILURE_EXCEPTION");
+				break;
+			case SUCCESS:
+				$operationWrapper.operation.outcome = "SUCCESS";
+				$manager.setControlLoopResult("SUCCESS");
+				break;
+			case FAILURE:
+				$operationWrapper.operation.outcome = "FAILURE";
+				$manager.setControlLoopResult("FAILURE");
+				break;
+		}
+		if ($operationWrapper.operation.outcome.equals("SUCCESS")) {
+			notification.history.add($operationWrapper.operation);
+			notification.notification = ControlLoopNotificationType.OPERATION_SUCCESS;
+			//
+			// Let interested parties know
+			//
+			try {
+				System.out.println(Serialization.gsonPretty.toJson(notification));
+				PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+			} catch (Exception e) {
+				System.out.println("Can't deliver notification: " + notification);
+				e.printStackTrace();
+			}
+            notification.notification = ControlLoopNotificationType.FINAL_SUCCESS;
+            try {
+            	System.out.println(Serialization.gsonPretty.toJson(notification));
+            	PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+            } catch (Exception e) {
+            	System.out.println("Can't deliver notification: " + notification);
+            	e.printStackTrace();
+            }
+
+			//
+			// We are going to retract these objects from memory
+			//
+			System.out.println("Retracting everything");
+			retract($operationWrapper);
+			retract($request);
+			retract($response);
+			retract($event);
+			retract($manager);
+		} else if ($operationWrapper.operation.outcome.equals("PROCESSING")) {
+			retract($response);
+		} else {
+			notification.history.add($operationWrapper.operation);
+			notification.notification = ControlLoopNotificationType.OPERATION_FAILURE;
+			//
+			// Let interested parties know
+			//
+			try {
+				System.out.println(Serialization.gsonPretty.toJson(notification));
+				PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+			} catch (Exception e) {
+				System.out.println("Can't deliver notification: " + notification);
+				e.printStackTrace();
+			}
+            notification.notification = ControlLoopNotificationType.FINAL_FAILURE;
+            //
+            // Let interested parties know
+            //
+            try {
+            	System.out.println(Serialization.gsonPretty.toJson(notification));
+            	PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+            } catch (Exception e) {
+            	System.out.println("Can't deliver notification: " + notification);
+            	e.printStackTrace();
+            }
+			//
+			// We are going to retract these objects from memory
+			//
+			System.out.println("Retracting everything");
+			retract($operationWrapper);
+			retract($request);
+			retract($response);
+			retract($event);
+			retract($manager);
+		}
+		
+end		
+
+/*
+*
+* This rule is used to clean up APPC response
+*
+*/		
+rule "${policyName}.APPC.RESPONSE.CLEANUP"
+	when
+		$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
+        $response : Response($id : getCommonHeader().RequestID )
+		not ( VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), requestID == $id, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) ) 
+	then
+		System.out.println("rule APPC.RESPONSE.CLEANUP is triggered.");
+		retract($response);
+end
+
+/*
+*
+* This rule responds to MSO Response Events
+*
+*/
+rule "${policyName}.MSO.RESPONSE"
+	when
+		$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
+		$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
+		$manager : EventManager( closedLoopControlName == $event.closedLoopControlName )
+		$operationWrapper : ControlLoopOperationWrapper( requestID == $event.requestID )
+		$request : MSORequest( requestId == $event.requestID.toString() )
+		$response : MSOResponse( request.requestId == $event.requestID.toString() )	
+	then
+		System.out.println("rule MSO.RESPONSE is triggered.");
+		//
+		// Construct notification
+		//
+		VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event);
+		notification.from = "policy";
+		notification.policyName = drools.getRule().getName();
+		notification.policyScope = "${policyScope}";
+		notification.policyVersion = "${policyVersion}";
+		notification.message = $operationWrapper.operation.toMessage();
+		$operationWrapper.operation.message = $operationWrapper.operation.toMessage();
+		//
+		// The operation can either be succeeded or failed
+		// 
+		if($response.request.requestStatus.requestState.equals("Completed")) {
+			$operationWrapper.operation.outcome = "SUCCESS";
+			$manager.setControlLoopResult("SUCCESS");
+			notification.history.add($operationWrapper.operation);
+			notification.notification = ControlLoopNotificationType.OPERATION_SUCCESS;
+			//
+			// Let interested parties know
+			//
+			try {
+				System.out.println(Serialization.gsonPretty.toJson(notification));
+				PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+			} catch (Exception e) {
+				System.out.println("Can't deliver notification: " + notification);
+				e.printStackTrace();
+			}
+			notification.notification = ControlLoopNotificationType.FINAL_SUCCESS;
+            //
+            // Let interested parties know
+            //
+            try {
+            	System.out.println(Serialization.gsonPretty.toJson(notification));
+            	PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+            } catch (Exception e) {
+            	System.out.println("Can't deliver notification: " + notification);
+            	e.printStackTrace();
+            }
+            //
+			// We are going to retract these objects from memory
+			//
+			System.out.println("Retracting everything");
+			retract($operationWrapper);
+			retract($request);
+			retract($response);
+			retract($event);
+			retract($manager);
+		} else {
+			$operationWrapper.operation.outcome = "FAILURE";
+			$manager.setControlLoopResult("FAILURE");
+			notification.history.add($operationWrapper.operation);
+			notification.notification = ControlLoopNotificationType.OPERATION_FAILURE;
+			//
+			// Let interested parties know
+			//
+			try {
+				System.out.println(Serialization.gsonPretty.toJson(notification));
+				PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+			} catch (Exception e) {
+				System.out.println("Can't deliver notification: " + notification);
+				e.printStackTrace();
+			}
+			notification.notification = ControlLoopNotificationType.FINAL_FAILURE;
+            //
+            // Let interested parties know
+            //
+            try {
+            	System.out.println(Serialization.gsonPretty.toJson(notification));
+            	PolicyEngine.manager.deliver($params.getNotificationTopic(), notification);
+            } catch (Exception e) {
+            	System.out.println("Can't deliver notification: " + notification);
+            	e.printStackTrace();
+            }
+            //
+			// We are going to retract these objects from memory
+			//
+			System.out.println("Retracting everything");
+			retract($operationWrapper);
+			retract($request);
+			retract($response);
+			retract($event);
+			retract($manager);
+		}
+		
+end				
