Simple Example tibco hawk rule

we can use one rule to stop multiple ADB instances and/or applications.

In 'TestEditor' we can add multiple actions. In 'Action Editor' choose 'Method' for action type and search for adapters' microagent where we can select 'stopApplicationInstance' method.

Here is one simple example.

<?xml version="1.0" encoding="UTF-8" ?>
<ruleBase>
    <version>4.6.0</version>
    <name><![CDATA[stopRule]]></name>
    <schedule></schedule>
    <author>XPMUser on host at 09:56 uto, lip 7, 2011</author>
    <lastModification>XPMUser on host  at 09:57 uto, lip 7, 2011</lastModification>
    <comment><![CDATA[]]></comment>
    <rule>
        <name><![CDATA[Self:getUptime():60]]></name>
       <schedule></schedule>
        <overRuling>0</overRuling>
        <dataSource>
            <microAgentName><![CDATA[COM.TIBCO.hawk.microagent.Self]]></microAgentName>
            <methodName>getUptime</methodName>
            <interval>60000</interval>
        </dataSource>
        <test>
            <name><![CDATA[(Total millisec > 0)]]></name>
            <schedule></schedule>
            <operator class="COM.TIBCO.hawk.config.rbengine.rulebase.operators.GreaterThan" >
                <operator class="COM.TIBCO.hawk.config.rbengine.rulebase.operators.RuleData" >
                   <dataObject class="java.lang.String" ><![CDATA[Total millisec]]></dataObject>
                </operator>
                <dataObject class="java.lang.Long"  value="0" />
            </operator>
            <consequenceAction>
                <name><![CDATA[stopApplicationInstance()]]></name>
                <schedule></schedule>
                <microAgentName>COM.TIBCO.ADAPTER.adr3.SomeAdapter</microAgentName>
                <methodName>stopApplicationInstance</methodName>
                <properties>
                </properties>
                <performOnceOnly/>
                <escalationTime>0</escalationTime>
            </consequenceAction>
            <consequenceAction>
               <name><![CDATA[stopApplicationInstance():1]]></name>
                <schedule></schedule>
                <microAgentName>COM.TIBCO.ADAPTER.adr3.SomeOtherAdapter</microAgentName>
                <methodName>stopApplicationInstance</methodName>
                <properties>
                </properties>
                <performOnceOnly/>
                <escalationTime>0</escalationTime>
            </consequenceAction>
            <trueConditionPolicy>
                <trueCountThreshold>1</trueCountThreshold>
            </trueConditionPolicy>
            <clearOn>
               <clearOnFirstFalse/>
            </clearOn>
        </test>
    </rule>
</ruleBase>





  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP