CKRule BRMS-Decision Table instructions, ckrulebrms-

Source: Internet
Author: User
Tags table definition

CKRule BRMS-Decision Table instructions, ckrulebrms-

There are two steps to edit a decision table: Rule package editing, Rule Data setting, and publishing.

1. Edit rule set

Double-click ckboot.exe to open the CKRule Rule Engine editing interface. Click new. A new rule package is displayed in the project window on the left. Click the root node to modify the Rule Set Name.

1.1. Pass in outgoing Parameters

Double-click the object library-input outgoing parameters to open the editing interface and enter fields in the common format to the interface.

 

The content entered in the name column must comply with the. Net field naming rules, such as-, space, @, and other characters cannot be used, and the first letter cannot be a number.


The input parameters and custom type definitions will affect all subsequent encodings.

During json communication with the outside, the property name used is the ing name. If the ing name is null, The ing name is used.

1.2. Decision Table Definition

Open the rule repository-decision table definition page.

A decision table stores rule data in the form of tables, so that a large number of rules can be processed at once.

The core processing logic is to scan each row, check the values of related cells, and execute the corresponding action when a certain condition is reached.


For example, when setting a parking lot decision table, you must fill in the column information of the table, including the title, database fields, data types, logical types, precision, rules, and other content. Where

The title is the column title when the decision table is finally displayed at the front end.

The database field is the field bound to the management platform or other databases. Currently, it is bound to the RoolTbl table on the management platform. The data of this table is as follows:


The data type is used to control the type used for input to reduce input errors.

Logical type refers to conditions, conclusions, or none. When setting, the conditions and conclusions must both exist. Multiple conditions and conclusions can exist. If multiple conditions exist, that is, when multiple conditions are met, one or more conclusions are executed. When the code is complex and not suitable for this definition, you can directly use the conclusion column to fill in the relevant code, while the condition column is filled with 1 = 1, it means like if (1 = 1) {} in the editing ){}.

Rule writing

Select the script for the conclusion column and click set. The following page is displayed.


This interface allows you to set the scripts used throughout the process.

To obtain the object of the current Row, use the Row attribute, Row. cells ["Prop1"]. value indicates the Value of the cell whose database name is Prop1 and the current row is obtained. The Value type is string. You can use this Row attribute to obtain the values of all cells.

CDouble is a built-in method of the system. Click category-extension (15) on the left of the interface to view the usage of different functions. At the same time, this interface can also directly use all the. Net APIs.

The code above indicates to find the values of each cell, convert them to the correct type, and traverse all input point data. If the point value is in the range and the type is "information ", set the information to the content of one of the cells.

1.3. Master rule

This function is used to call the rules written by the client.

The preceding two steps are used to define a decision table. The main rule interface can call the Decision Table logic. Double-click rule repository-master rule to add a rule set.


Add the following code to the rule set:


The Code is as follows:


The purpose of the code is to read the data of RuleTbl on the rule management platform, initialize the decision table, and then execute the decision table.

2. Rule Data setting and Publishing

Editing rule data and publishing rules are all performed on the rule management platform.

2.1. Rule Set Management

Log on to the rule management platform, open the rule package management interface, find the corresponding category, and right-click to add a rule.


Click Browse, find the generated ckp file, the system automatically loads the rule package name, and fill in the encoding and name. The field will pull out the input and output information of the rule. In the editing type, select a decision table.

2.2. Rule Publishing

Open the rule Publishing Page


Locate the unreleased rule set and double-click the row record.

Information about the rule is displayed in the lower part of the interface, such as the current rule, service start time, service end time, and service type. The Service start time must be earlier than the current time, and the service end time must be later than the current time. Select Json as the service type. Click Publish.

2.3. Rule Data settings

Open the rule data settings page, which displays all published records.


Find the corresponding rule and click set with the decision table. The Edit Decision Table Page is displayed.


The runtime and description are both set when the rule set is edited, and the columns in the table are the columns set in the decision table. After the data is saved, it is saved to the RoolTbl table based on the content of the database field.

So far, a decision table has been edited.

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.