An example of IBM tbsm Business Association Rule Configuration

Source: Internet
Author: User

Recently, IBM tbsm was used in the company's project for business association configuration. The entire model is described as follows:

From the perspective of model design, the business system is as follows:

Service status B

Business nodes C1, D2, E3

Business resources C11, C12, C13, D21, D22, d31, E32

The business nodes b1, b2, and B3 must set weight importance.

Business Rules:

When a yellow event occurs to business resources, the affected business nodes are yellow, and the overall business status is yellow.

If weight is 1, the affected business nodes are red, and the overall business status is red. If weight is 0, the affected business nodes are red, the overall business status is yellow.

In the tbsm template configuration,

First, establish a digital aggregation rule to obtain the most serious status of business resources and obtain the node status of C, D, and E.

Because we need to refer to the weight value, we need to establish a digital publicity rule to calculate the value of business status B.

The publicity script is as follows:

Log ("name value:" + serviceinstance. displayname); log (0, "Child value:" + serviceinstance. numchildren); log (0, "Weight Value:" + serviceinstance. weight); log (0, "status value:" + int (serviceinstance. radstatus); log (0, "status1 value:" + instancenode. urm_app_status1.value );

If (INT (instancenode. urm_status.value) <> 2 and INT (servicestatus)> = 3 and INT (serviceinstance. weight) = 0) {log (0, "Filter A:"); values = 3;} elseif (INT (instancenode. urm_status.value) <> 2 and INT (servicestatus)> = 3 and INT (servicestatus) <5 and INT (serviceinstance. weight) = 1) {log (0, "filter B :");

Values = 3;} elseif (INT (instancenode. urm_status.value) <> 2 and INT (servicestatus) = 5 and INT (serviceinstance. weight) = 1) {values = 5;} else {values = 0;} log (0, "values:" + values );

Status = values;

According to the definition of IBM Business, when the resource status changes, the digital aggregation rule is called to generate status changes. When the digital formula rule is called to calculate the business status, however, in actual use, it is found that the service status cannot be recovered. After an analysis, it seems that when the status of the digital aggregation rule returned by tbsm changes in the system flow, the digital formula rule is also called when the service status is changed, but servicestatus may not be locked at this time, this results in some parallel operations on servicestatus, resulting in a state computing problem (this place may be hard to understand by the General implementers, and I have communicated with IBM several times without making it clear, they keep saying that their products are okay, and they have changed the script several times according to their requirements, which cannot solve the problem. Then they thought of a solution, determine the status of all resources in the script to solve the service recovery problem. refer to the following script)

Log ("name value:" + serviceinstance. displayname); log (0, "Child value:" + serviceinstance. numchildren );

Log (0, "Weight Value:" + serviceinstance. weight); log (0, "status value:" + int (serviceinstance. radstatus); log (0, "status1 value:" + instancenode. urm_app_status1.value );

Servicestatus = instancenode. urm_app_status1.value; If (servicestatus <instancenode. urm_app_status2.value) {servicestatus = instancenode. urm_app_status2.value;} sevstatus = serviceinstance. radstatus;

If (sevstatus> servicestatus) {servicestatus = sevstatus;} index1 = 0; Index = 0; Count = 0; Red = 0; yellow = 0; Green = 0; nodesum = 1; nodesum = serviceinstance. numchildren;

While (index1 <serviceinstance. numchildren) {log ("childname value:" + serviceinstance. childinstancebeans [index1]. displayname); log ("childrad value:" + serviceinstance. childinstancebeans [index1]. radstatus );

If (serviceinstance. childinstancebeans [index1]. radstatus = 0) {Green = green + 1;} If (serviceinstance. childinstancebeans [index1]. radstatus = 3) {yellow = yellow + 1;} If (serviceinstance. childinstancebeans [index1]. radstatus = 5) {Red = red + 1 ;}

Index1 = index1 + 1;} log (0, "Green:" + green); If (Green = nodesum ){

Servicestatus = 0;} log (0, "Yellow:" + yellow); If (yellow> 0) {servicestatus = 3;} If (nodesum> 0) {reddiv = red/nodesum; log (0, "Red:" + red); log (0, "nodesum:" + nodesum); If (reddiv >=0.51) {log (0, "Red/nodesum:" + reddiv); servicestatus = 5;} else {If (reddiv> 0) {servicestatus = 3 ;}

} If (INT (instancenode. urm_status.value) <> 2 and INT (servicestatus)> = 3 and INT (serviceinstance. weight) = 0) {log (0, "Filter A:"); values = 3;} elseif (INT (instancenode. urm_status.value) <> 2 and INT (servicestatus)> = 3 and INT (servicestatus) <5 and INT (serviceinstance. weight) = 1) {log (0, "filter B :");

Values = 3;} elseif (INT (instancenode. urm_status.value) <> 2 and INT (servicestatus) = 5 and INT (serviceinstance. weight) = 1) {values = 5;} else {values = 0;} log (0, "values:" + values );

Status = values;

 

(If you have any questions, contact me)

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.