• 1 reply
  • Latest Post - ‏2013-03-13T19:17:19Z by IsaacGraf
172 Posts

Pinned topic Unable to develop rule in TBSM

‏2013-03-12T13:57:37Z |

(M1,M2) together form one group while (G1,G2) form another group.The rules are
1a).If M1,M2,G1,G2 all are marginal then P is marginal or
1b).If either of M1,M2,G1,G2 is bad then P is marginal.
2).If (M1&M2) are bad or (G1&G2) are bad then P is bad i.e if either of the group is completely bad then the parent is bad.
We can apply %rule to rule'1a' and any child rule to rule'1b' but Im confused on how to implement rule'2'.
Can someone help me out with rule 2...?

Updated on 2013-03-13T19:17:19Z at 2013-03-13T19:17:19Z by IsaacGraf
  • IsaacGraf
    34 Posts

    Re: Unable to develop rule in TBSM

    You can do this with an aggregation rule policy function.
    In the example below, I assume that m1, m2, g1, g2 belong to the same template. You would configure the UI screen for the rule to depend on the OverallAttribute of that template and use the function you configure in the policy.
    Note that I am using the AllChildrenArray since that enables you to get the instance name and other properties of the children aswell as the status of its rules.
    You can add the logic for the other 2 rules at the bottom aswell, so you should be able to have just the one rule.
    You would check the status checkbox for the rule and set Marginal threshold to 3 and Bad threshold to 5.
    function MyFunc(ChildrenStatusArray, AllChildrenArray, ServiceInstance, Status) {
    i = 0;
    m1 = 0;
    m2 = 0;
    g1 = 0;
    g2 = 0;
    Status = 0;
    // to get the instance name or display name of a service, you use the serviceinstancename or displayname properties
    // this example uses the instance name
    while (AllChildrenArray[i] != NULL) {
    Child = AllChildrenArray[i];
    if (Child.serviceinstancename = "m1") {
    m1 = Child.StateModelNode.OverallAttribute.Value;
    if (Child.serviceinstancename = "m2") {
    m2 = Child.StateModelNode.OverallAttribute.Value;
    if (Child.serviceinstancename = "g1") {
    g1 = Child.StateModelNode.OverallAttribute.Value;
    if (Child.serviceinstancename = "g1") {
    g1 = Child.StateModelNode.OverallAttribute.Value;
    i = i + 1;

    if (m1 = 5 AND m2 = 5) {
    Status = 5;
    if (g1 = 5 AND g2 = 5) {
    Status = 5;
    // can add more logic here to set status to 3 (Marginal) if other conditions are met