X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fparent.git;a=blobdiff_plain;f=docs%2Fdrools%2Ffeature_testtransaction.rst;h=8bec1421032e1069c2c2565c0cecb9fd198afc26;hp=488ee1a50f23e10446c74812e43b418058a325f6;hb=108dd8ff62cbdfbbe1ba3589afe43582105ea275;hpb=11de40286f2a91edc9755f6ea9e621006452527b diff --git a/docs/drools/feature_testtransaction.rst b/docs/drools/feature_testtransaction.rst index 488ee1a5..8bec1421 100644 --- a/docs/drools/feature_testtransaction.rst +++ b/docs/drools/feature_testtransaction.rst @@ -2,6 +2,8 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 +.. _feature-tt-label: + ************************* Feature: Test Transaction ************************* @@ -9,9 +11,6 @@ Feature: Test Transaction .. contents:: :depth: 3 -Summary -^^^^^^^ - The Test Transaction feature provides a mechanism by which the health of drools policy controllers can be tested. When enabled, the feature functions by injecting an event object (identified by a UUID) into the drools session of each policy controller that is active in the system. Only an object with this UUID can trigger the Test Transaction-specific drools logic to execute. @@ -20,16 +19,13 @@ The injection of the event triggers the "TT" rule (see *TestTransactionTemplate. If it is ever the case that a drools controller does not have the "TT" rule present in its *.drl*, or that the forward progress counter is not incremented, the Test Transaction thread for that particular drools session (i.e. controller) is terminated and a message is logged to *error.log*. -Usage -^^^^^ - Prior to being enabled, the following drools rules need to be appended to the rules templates of any use-case that is to be monitored by the feature. .. code-block:: java :caption: TestTransactionTemplate.drl :linenos: - /* + /* * ============LICENSE_START======================================================= * feature-test-transaction * ================================================================================ @@ -38,9 +34,9 @@ Prior to being enabled, the following drools rules need to be appended to the ru * 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. @@ -48,15 +44,15 @@ Prior to being enabled, the following drools rules need to be appended to the ru * limitations under the License. * ============LICENSE_END========================================================= */ - + package org.onap.policy.drools.rules; - + import java.util.EventObject; - + declare ForwardProgress counter : Long end - + rule "TT.SETUP" when then @@ -64,9 +60,9 @@ Prior to being enabled, the following drools rules need to be appended to the ru fp.setCounter(0L); insert(fp); end - + rule "TT" - when + when $fp : ForwardProgress() $tt : EventObject(source == "43868e59-d1f3-43c2-bd6f-86f89a61eea5") then