From 704e2b4fd3da2ff0a7efccda2e12563c390a0ccf Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Tue, 10 Oct 2017 15:28:55 -0500 Subject: add structure only for PAP rule management PAP currently generates a set up rule that inserts a Params object when the session is loaded. Since the official template also has an equivalent rule that is used by the drools applications team to perform initializations tasks, at runtime we end up with 2 Params objects with the same control loop data. This has sideeffects where the same rule becomes true for 2 Params objects therefore performing duplicated actions which introduces somewhat anomalous behavior. The PapParams is introduced to satisfy current PAP needs for management of rules. The structure is included here only for those purposes but it carries no significance at runtime during drools executions since the rules go by Params instead of PapParams. In the near future, the plan is to have the PAP not generating SET UP rules. There is a companion review on the PAP side to refer to PapParams instead of Params to fulfill the resolution of POLICY-302. Change-Id: I2f9ed3cee3d5d5209eecd43823cfc44a4b937600 Issue-ID: POLICY-302 Signed-off-by: Jorge Hernandez --- .../main/resources/__closedLoopControlName__.drl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'controlloop/templates') diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl index fc0cd29b7..e601ed43f 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl @@ -75,18 +75,39 @@ import java.util.Iterator; import org.onap.policy.drools.system.PolicyEngine; +/* + * This structure mimics the Params structure. + * Its only purpose is to allow management of + * rules by the PAP component.. + * It has no use at runtime since the rules go by + * Params for matching purposes. + */ +declare PapParams + closedLoopControlName : String + controlLoopYaml : String +end + +/* + * Control Loop Identity + */ declare Params closedLoopControlName : String controlLoopYaml : String end +/* + * Operation Timer + */ declare OperationTimer closedLoopControlName : String requestID : String delay : String end +/* + * Control Loop Timer + */ declare ControlLoopTimer closedLoopControlName : String requestID : String -- cgit 1.2.3-korg