Fixing FlowRule priority in intent compilers

Change-Id: I13998e88d2a116017e87c019f4829101db6c6b6b
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
index 90e3981..7add217 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
@@ -76,7 +76,9 @@
         for (int i = 0; i < links.size() - 1; i++) {
             ConnectPoint ingress = links.get(i).dst();
             ConnectPoint egress = links.get(i + 1).src();
-            FlowRule rule = createFlowRule(intent.selector(), intent.treatment(), ingress, egress, isLast(links, i));
+            FlowRule rule = createFlowRule(intent.selector(), intent.treatment(),
+                                           ingress, egress, intent.priority(),
+                                           isLast(links, i));
             rules.add(rule);
         }
 
@@ -84,7 +86,8 @@
     }
 
     private FlowRule createFlowRule(TrafficSelector originalSelector, TrafficTreatment originalTreatment,
-                                    ConnectPoint ingress, ConnectPoint egress, boolean last) {
+                                    ConnectPoint ingress, ConnectPoint egress,
+                                    int priority, boolean last) {
         TrafficSelector selector = DefaultTrafficSelector.builder(originalSelector)
                 .matchInPort(ingress.port())
                 .build();
@@ -101,7 +104,7 @@
                 .forDevice(ingress.deviceId())
                 .withSelector(selector)
                 .withTreatment(treatment)
-                .withPriority(123)
+                .withPriority(priority)
                 .fromApp(appId)
                 .makePermanent()
                 .build();